啟動sentinel
執(zhí)行
redis-sentinel /path/to/sentinel.conf
或
redis-server /path/to/sentinel.conf --sentinel
以上兩種方式啟動sentinel的效果是一樣的叫榕。注意,sentinel.conf文件在sentinel運行期間被實時修改的遭顶,要確保sentinel.conf文件對當(dāng)前用戶是可寫的
redis-sentinel 默認(rèn)使用的端口是26379
#最簡單的sentinel配置:
sentinel monitor mymaster 127.0.0.1 6379 1
sentinel down-after-milliseconds mymaster 60000
sentinel failover-timeout mymaster 180000
sentinel parallel-syncs mymaster 1
#redis-sentinel默認(rèn)是前臺啟動的,想要后臺啟動加在sentinel.conf文件插入以下內(nèi)容:
daemonize yes
logfile "/data/logs/redis-sentinel/sentinel.log"