假如156 和 157 是不同的两台服务器 两台redis主从复制基础上搭建哨兵模式如下
156
redis.conf
masterauth 123456
bind 0.0.0.0
requirement 123456
daemonize yes
sentinel.conf
sentinel auth-pass mymaster 123456
sentinel monitor mymaster 10.190.107.156 6379 2
157
redis.conf
masterauth 123456
slaveof 10.190.107.156 6379
bind 0.0.0.0
requirement 123456
daemonize yes
sentinel.conf
sentinel auth-pass mymaster 123456
sentinel monitor mymaster 10.190.107.156 6379 2
./redis-server /redis/redis-7.0.9/redis.conf & &:代表后台运行
./redis-sentinel /redis/redis-7.0.9/sentinel.conf &
最后用info replication这个命令查看那个是主服务器,那个是从服务器
标签:mymaster,主从复制,0.0,redis,哨兵,conf,sentinel,123456 From: https://www.cnblogs.com/codeLearn/p/17743276.html