1,生成redis的啟動(dòng)腳本
進(jìn)入redis的安裝目錄驮审,查看READEME.md文件
image.png
image.png
-
根據(jù)提示生成redis的啟動(dòng)腳本以及配置文件等鲫寄。
image.png
2,生成sentinel的啟動(dòng)腳本
- 根據(jù)提示生成sentinel的啟動(dòng)腳本以及配置文件等疯淫。
image.png
2)修改啟動(dòng)腳本地来,以sentinel的模式啟動(dòng)。vim /etc/init.d/sentinel_7579
image.png
3)修改sentinel的配置文件熙掺。vim /usr/local/redis/sentinel_7579.conf
,shift + : 然后輸入1,$d 回車(chē)
加入對(duì)master的監(jiān)控未斑,重啟sentinel。
bind 0.0.0.0
protected-mode no
port 7579
daemonize yes
dir "/usr/local/redis/sentinel_7579_dir"
pidfile "/var/run/sentinel_7579.pid"
logfile "/usr/local/redis/sentinel_7579.log"
sentinel monitor redis_6379_master 127.0.0.1 6379 2
sentinel down-after-milliseconds redis_6379_master 10000
sentinel parallel-syncs redis_6379_master 2
sentinel failover-timeout redis_6379_master 180000`
/etc/init.d/sentinel_7579 start
tail -400f /usr/local/redis/sentinel_7579.log