redis实现哨兵机制

将cd /usr/local/redis/sentinel.conf复制到/usr/local/redis/etc/下

cd /usr/local/redis/
cp sentinel.conf /usr/local/redis/etc/

修改sentinel.conf配置文件

cd etc/
vim sentinel.conf
192.168.1.111 6379 1

启动哨兵模式

cd /usr/local/redis/bin/
./redis-server ../etc/redis.conf
./redis-server /usr/local/redis/etc/sentinel.conf --sentinel &

当主机宕机后,112从机自动变成主机

posted @ 2019-06-10 15:41  知识追求者  阅读(355)  评论(0编辑  收藏  举报