文章目录
- 1、在主机6379写入数据
- 2、在从机6380上写数据报错
- 3、从机只能读数据,不能写数据
1、在主机6379写入数据
127.0.0.1:6379> keys *
(empty array)
127.0.0.1:6379> set uname jim
OK
127.0.0.1:6379> get uname
"jim"
127.0.0.1:6379>
2、在从机6380上写数据报错
127.0.0.1:6380> set address usa
(error) READONLY You can't write against a read only replica.
127.0.0.1:6380>
3、从机只能读数据,不能写数据
127.0.0.1:6380> set address usa
(error) READONLY You can't write against a read only replica.
127.0.0.1:6380> get uname
"jim"
127.0.0.1:6380>