哨兵
配置/usr/local/redis/conf/sentinel.conf
sh
bind 0.0.0.0
daemonize yes
logfile "/usr/local/redis/log/sentinel.log"
pidfile /var/run/sentinel.pid
#指示sentinel去见识一个名为mymaster的主服务器
sentinel monitor mymaster 192.168.0.90 6379 2
#访问主节点的密码
sentinel auth-pass mymaster password
#sentinel 认为服务器已经断线所需的毫秒数
sentinel down-after-milliseconds mymaster 10000
#若sentinel在该配置值内未能完成failover操作,则认为本次failover失败
sentinel failover-timeout mymaster 1800000
启动
sh
/usr/local/redis/bin/redis-server /usr/local/redis/conf/sentinel.conf --sentinel
/usr/local/redis/bin/redis-sentinel /usr/local/redis/conf/sentinel.conf