该模式为从服务器的默认模式
代码语言:javascript复制[root@m2 tmp]# grep slave-read-only redisnew.conf
slave-read-only yes
[root@m2 tmp]#
停止同步
代码语言:javascript复制127.0.0.1:6379> config get slave*
1) "slave-priority"
2) "100"
3) "slave-serve-stale-data"
4) "yes"
5) "slave-read-only"
6) "yes"
7) "slaveof"
8) "m1 6379"
127.0.0.1:6379> CONFIG SET slaveof nil
(error) ERR Unsupported CONFIG parameter: slaveof
127.0.0.1:6379> SLAVEOF no one
OK
127.0.0.1:6379> config get slaveof
1) "slaveof"
2) ""
127.0.0.1:6379>