File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -340,11 +340,27 @@ esac
340
340
- 第一个从库配置的信息是连上主库,后面的第二个从库配置的连接信息是连上第一个从库, 假如还有第三个从库的话,我们可以把第三个从库的配置信息连上第二个从库上,以此类推。
341
341
342
342
343
- ## Redis 3 主 3 从 配置
343
+ ## Redis 3 主 2 从 3 哨兵--配置集群+HA(高可用、故障转移)
344
+
345
+ - 3 主 2 从 3 哨兵(平均每台机子是:1 主 2 从 3 哨兵)
346
+ - 一个健康的集群部署,至少需要 3 个 Sentinel 实例,官网(Example 2: basic setup with three boxes):< https://redis.io/topics/sentinel >
347
+ - 这里使用了 3 台阿里云服务器,系统:CentOS 6.8
348
+ - 3 主:
349
+
350
+ ```
351
+ 192.168.1.1
352
+ ```
353
+
354
+ 先做 Redis 集群,然后写个 Spring Data Redis 测试是否可以正常使用该集群
355
+
356
+
344
357
345
- - 用一台机子模拟:4CPU-4GMemory
346
358
347
359
360
+ - 每台服务器各有一个 Redis 程序,然后有 3 个不同配置文件,启动 Redis 的时候指定各自的配置文件,依次表示 3 个 Redis 程序。
361
+ - 先关闭防火墙,避免各种端口未开放问题
362
+ - Redis 目前支持主从复制,但是主挂掉后,从也只能只读,所以需要在主挂掉后,从一个其中一个从节点中升级到主,这里用到的是:redis sentinel
363
+ - 漂移 IP 这里用到 keepalived
348
364
349
365
350
366
You can’t perform that action at this time.
0 commit comments