我的Redis Sentinel故障转移不工作,当主服务器完成时,不会进行握手,也不会发生故障转移;但是,sentinel会显示主服务器何时恢复正常状态或何时关闭。我的sentinel.conf文件内容如下:
# Process Info
port 26379
daemonize yes
pidfile "/var/run/redis/sentinel.pid"
# Log files
loglevel notice
logfile "/var/log/redis/sentinel.log"
# Master setup
sentinel monitor mymaster 10.0.2.94 6379 2
sentinel auth-pass mymaster 118
sentinel down-after-milliseconds mymaster 10000
sentinel failover-timeout mymaster 60000
sentinel parallel-syncs mymaster 1
# Slave setup
sentinel monitor redis2 10.0.3.56 6379 2
sentinel auth-pass redis2 118
sentinel down-after-milliseconds redis2 15000
sentinel failover-timeout redis2 65000
sentinel parallel-syncs redis2 1Redis.conf文件是相当标准的,并且redis工作起来没有任何问题。
我真的很感谢大家对我的帮助。
发布于 2016-08-09 18:50:24
查看您发布的conf文件,它似乎设置错误您的群集名称mymaster和redis2有变化,请尝试以下命令
# Process Info
port 26379
daemonize yes
pidfile "/var/run/redis/sentinel.pid"
# Log files
loglevel notice
logfile "/var/log/redis/sentinel.log"
# Master setup
sentinel monitor redis2 10.0.2.94 6379 2
sentinel auth-pass redis2 118
sentinel down-after-milliseconds redis2 10000
sentinel failover-timeout redis2 60000
sentinel parallel-syncs redis2 1
# Slave setup
sentinel monitor redis2 10.0.3.56 6379 2
sentinel auth-pass redis2 118
sentinel down-after-milliseconds redis2 15000
sentinel failover-timeout redis2 65000
sentinel parallel-syncs redis2 1基本上clister的名字必须是相同的。实际上,你可以在每台服务器上使用相同的.conf文件,这样会更容易。
https://stackoverflow.com/questions/38753697
复制相似问题