redis三節點sentinel部署
角色 ip port
master 127.0.0.1 6379
slave-1 127.0.0.1 6380
slave-2 127.0.0.1 6381
sentinel-1 127.0.0.1 26379
sentinel-2 127.0.0.1 26380
sentinel-3 127.0.0.1 26381
分別在 /etc/redis_6380.conf 和/etc/redis_6381.conf 文件加入如下參數,使6380和6381成為6379的從庫
slaveof 127.0.0.1 6379
vi /etc/redis_sentinel_26379.conf
port 26379
daemonize yes
dir /data/redis/26379/
logfile "26379.log"
sentinel monitor mymaster 127.0.0.1 6379 2
sentinel down-after-milliseconds mymaster 30000
sentinel parallel-syncs mymaster 1
sentinel failover-timeout mymaster 180000
redis_sentinel_26380.conf 和 redis_sentinel_26381.conf 配置類似
啟動sentinel節點
redis-sentinel /etc/redis_sentinel_26379.conf &
redis-sentinel /etc/redis_sentinel_26380.conf &
redis-sentinel /etc/redis_sentinel_26381.conf &
redis三節點sentinel部署