我的配置:

1个master,1个slave,3个sentinel

搭建的过程网上已经有很多了,这里列几个重点关注:

  1. 修改sentinel.conf的protected-mode与redis.conf的一致,要么都为yes,要么都为no。若未配置好可能会在主从切换时出现 failover-abort-no-good-slave 的故障
  2. 修改sentinel.conf的bind为本地ip。
  3. 每个redis.conf中的密码最好一致,因为同步的时候,redis会根据redis.conf中配置的masterauth去连接远程master。
  4. 若配置文件sentinel.conf中有myid,确保每个文件的myid值全局唯一(与其他sentinel.conf文件的不相同),否则可能导致明明起了多个sentinel,通过info sentinel命令却只能查到1个sentinel实例。
  5. 若以上配置没问题,但仍然出现各种诡异问题,如failover-abort-no-good-slave及info sentinel命令查到的sentinels数量不正确,就得检查防火墙配置了。可以通过redis-cli远程连接redis及sentinel端口,看看是否可以连接上,而不会出现“No route to host”等连接故障

 

相关文章:

  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2022-01-31
  • 2021-10-25
  • 2021-12-07
  • 2021-10-05
  • 2021-11-24
猜你喜欢
  • 2021-12-06
  • 2022-01-03
  • 2021-09-26
  • 2022-02-20
  • 2021-10-03
  • 2021-06-09
相关资源
相似解决方案