深入理解Redis Cluster(6)

# redis-cli -p 6382
127.0.0.1:6382> get k3
(error) MOVED 4576 127.0.0.1:6379
127.0.0.1:6382> readonly
OK
127.0.0.1:6382> get k3
"hello"
127.0.0.1:6382> readwrite
OK
127.0.0.1:6382> get k3
(error) MOVED 4576 127.0.0.1:6379

CLUSTER SETSLOT slot IMPORTING|MIGRATING|STABLE|NODE [node-id]:设置slot的状态。

CLUSTER DELSLOTS slot [slot ...]:

注意:

1. 是否开启集群模式,从进程名中也可看出。

[root@slowtech conf]# ps -ef | grep redis
root    17497    1  0 20:18 ?        00:00:00 redis-server 127.0.0.1:6379 [cluster]
root    17720    1  0 20:21 ?        00:00:00 redis-server 127.0.0.1:6380 [cluster]
root    17727    1  0 20:21 ?        00:00:00 redis-server 127.0.0.1:6381 [cluster]
root    17734    1  0 20:21 ?        00:00:00 redis-server 127.0.0.1:6382 [cluster]
root    17741    1  0 20:21 ?        00:00:00 redis-server 127.0.0.1:6383 [cluster]
root    17748    1  0 20:21 ?        00:00:00 redis-server 127.0.0.1:6384 [cluster]
root    18154 15726  0 20:29 pts/5    00:00:00 grep --color=auto redis

Linux公社的RSS地址https://www.linuxidc.com/rssFeed.aspx

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/175512e5abc98ac31b76089c5f089927.html