随笔 - 384  文章 - 3 评论 - 0 阅读 - 48556
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

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条语句为节点下线时间,及故障恢复时间,默认即为此配置

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

posted on   401335990  阅读(466)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~
点击右上角即可分享
微信分享提示