| IP地址 | 节点角色 | 端口 |
| — | — | — |
| 192.168.211.104 | Redis Master/ Sentinel | 6379/26379 |
| 192.168.211.105 | Redis Slave/ Sentinel | 6379/26379 |
| 192.168.211.106 | Redis Slave/ Sentinel | 6379/26379 |
关闭防火墙:
由于是自己学习使用,我们不针对专门的端口最策略(在公司这一块有专门的运维同时来做),这里我们直接关闭服务器的防火墙(三台都需要关闭)
systemctl status firewalld.service # 查看防火墙状态
systemctl stop firewalld.service # 停止防火墙(重启后会失效)
systemctl disable firewalld.service # 禁止开机启动
效果图,不会的朋友可以参考一下
整体架构简图
二、配置一主二从
这里的Redis的主节点是192.168.211.104,所以我们在192.168.211.105和192.168.211.106的Redis配置文件中,配置replicaof指向的Master IP +port。