1、在/tmp目录下创建3个文件夹S1,S2,S3作为sentinel 集群配置文件存放目录
2、在s1,s2,s3目录下创建配置文件 :
[root@k8s-node01 s2]# cat ../s1/sentinel.conf
port 27001
sentinel announce-ip 192.168.66.20
sentinel monitor mymaster 92.168.66.20 7001 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 60000
dir "/tmp/s1"
[root@k8s-node01 s2]# cat ../s2/sentinel.conf
port 27002
sentinel announce-ip 192.168.66.20
sentinel monitor mymaster 92.168.66.20 7001 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 60000
dir "/tmp/s2"
[root@k8s-node01 s2]# cat ../s3/sentinel.conf
port 27003
sentinel announce-ip 192.168.66.20
sentinel monitor mymaster 92.168.66.20 7001 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 60000
dir "/tmp/s3"
27001,27002,27003为sentinel 集群的节点监听端口,
sentinel announce-ip 192.168.66.20 表示集群主节点IP
sentinel monitor mymaster 92.168.66.20 7001 2 中mymaster 表示集群或主节点 名称, 最后一个数字2 表示,客观 判断 节点是否 断线需要的 sentinel 节点同意的数量,此集群为3台sentinel,所以需要超过半数的,即为 2
sentinel down-after-milliseconds mymaster 5000
sentinel failover-timeout mymaster 60000 此2条语句为节点下线时间,及故障恢复时间,默认即为此配置
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~