redis sentinel搭建
主sentinel配置
port 6310
dir "/tmp"
logfile "/usr/local/src/redis-6.0.5/logs/sentinel-6310.log"
daemonize yes
sentinel monitor mymaster 192.168.128.101 6300 2
sentinel auth-pass mymaster 123456
sentinel down-after-milliseconds mymaster 15000
sentinel failover-timeout mymaster 120000
sentinel parallel-syncs mymaster 1
#发生切换之后执行的一个自定义脚本:如发邮件、vip切换等
#sentinel notification-script <master-name> <script-path>
从sentinel配置
port 6310
dir "/tmp"
logfile "/usr/local/src/redis-6.0.5/logs/sentinel-26380.log"
daemonize yes
sentinel monitor mymaster 192.168.128.101 6100 2
sentinel down-after-milliseconds mymaster 15000
sentinel failover-timeout mymaster 120000
sentinel auth-pass mymaster linlin
sentinel config-epoch mymaster 0
#发生切换之后执行的一个自定义脚本:如发邮件、vip切换等
#sentinel notification-script <master-name> <script-path>
创建日志目录
cd /usr/local/src/redis-6.0.5/
mkdir logs
开启sentinel端口
firewall-cmd --add-port=6310/tcp
运行sentinel
./redis-sentinel /usr/local/src/redis-6.0.5/sentinel_6310.conf
ps -aux|grep sentinel
网友评论