redis 集群 新增 master 节点 与 slave 挂靠命令

1.新增 master

redis-cli --cluster add-node 192.168.1.113:7007 192.168.1.111:7001   

2.slave 挂靠 master

[root@eshop-cache01 ~]# redis-cli --cluster add-node 192.168.1.113:7008 192.168.1.112:7004  --cluster-slave --cluster-master-id a7c1dd92253e952bb2f1d93d00dd801d1bc0f7eb
>>> Adding node 192.168.1.113:7008 to cluster 192.168.1.112:7004
>>> Performing Cluster Check (using node 192.168.1.112:7004)
M: a7c1dd92253e952bb2f1d93d00dd801d1bc0f7eb 192.168.1.112:7004
   slots:[1365-5460] (4096 slots) master
   1 additional replica(s)
S: 441d74da253e86db4e8aec0e26e2ed055c709405 192.168.1.111:7001
   slots: (0 slots) slave
   replicates a7c1dd92253e952bb2f1d93d00dd801d1bc0f7eb
M: 5a36b804152cf43a4c0d4c5fd628ff39885ae06b 192.168.1.113:7007
   slots:[0-1364],[5461-6826],[10923-12287] (4096 slots) master
M: a5bbab4f7ff2c9e984437229e8f65fa9ac70630c 192.168.1.112:7003
   slots:[6827-10922] (4096 slots) master
   1 additional replica(s)
S: 537fdb0807dc92d22d5b1463985184d60ef32be0 192.168.1.113:7006
   slots: (0 slots) slave
   replicates a5bbab4f7ff2c9e984437229e8f65fa9ac70630c
M: 6cfedc8e2561185e021c9c3b3e986ea7bcebe1f8 192.168.1.111:7002
   slots:[12288-16383] (4096 slots) master
   1 additional replica(s)
S: c42d4d0979d18d6d5c0bb931bbbe5e3c5198e375 192.168.1.113:7005
   slots: (0 slots) slave
   replicates 6cfedc8e2561185e021c9c3b3e986ea7bcebe1f8
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
>>> Send CLUSTER MEET to node 192.168.1.113:7008 to make it join the cluster.
Waiting for the cluster to join

>>> Configure node as replica of 192.168.1.112:7004.
[OK] New node added correctly.

  

  

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值