redis集群及常用的操作命令

最近在研究redis集群的搭建,在此做一个总结

<span style="font-size:12px;">[root@localhost src]#  ./redis-trib.rb create --replicas 1  127.0.0.1:7000 127.0.0.1:7001 127.0.0.1:7002 127.0.0.1:7003 127.0.0.1:7004 127.0.0.1:7005
>>> Creating cluster
Connecting to node 127.0.0.1:7000: OK
Connecting to node 127.0.0.1:7001: OK
Connecting to node 127.0.0.1:7002: OK
Connecting to node 127.0.0.1:7003: OK
Connecting to node 127.0.0.1:7004: OK
Connecting to node 127.0.0.1:7005: OK
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
127.0.0.1:7000
127.0.0.1:7001
127.0.0.1:7002
Adding replica 127.0.0.1:7003 to 127.0.0.1:7000
Adding replica 127.0.0.1:7004 to 127.0.0.1:7001
Adding replica 127.0.0.1:7005 to 127.0.0.1:7002
M: ad52e4f7c14da4b8b1e8e48603c9e5515a4cec7a 127.0.0.1:7000
   slots:0-5460 (5461 slots) master
M: d3058a19483d7be5c30c042779e56130f6ebf074 127.0.0.1:7001
   slots:5461-10922 (5462 slots) master
M: 5814305e71552ab45c44b9b8233681a63c3a57b1 127.0.0.1:7002
   slots:10923-16383 (5461 slots) master
S: e50676757acbe7c6a21e8abf4eda26ababb08285 127.0.0.1:7003
   replicates ad52e4f7c14da4b8b1e8e48603c9e5515a4cec7a
S: ab307ba26d6dabe8edb2f2a7287be6f01aa46d88 127.0.0.1:7004
   replicates d3058a19483d7be5c30c042779e56130f6ebf074
S: 11174332eb6ad40c0327750536fa776d706caf85 127.0.0.1:7005
   replicates 5814305e71552ab45c44b9b8233681a63c3a57b1
Can I set the above configuration? (type 'yes' to accept): yes
>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join...
>>> Performing Cluster Check (using node 127.0.0.1:7000)
M: ad52e4f7c14da4b8b1e8e48603c9e5515a4cec7a 127.0.0.1:7000
   slots:0-5460 (5461 slots) master
M: d3058a19483d7be5c30c042779e56130f6ebf074 127.0.0.1:7001
   slots:5461-10922 (5462 slots) master
M: 5814305e71552ab45c44b9b8233681a63c3a57b1 127.0.0.1:7002
   slots:10923-16383 (5461 slots) master
M: e50676757acbe7c6a21e8abf4eda26ababb08285 127.0.0.1:7003
   slots: (0 slots) master
   replicates ad52e4f7c14da4b8b1e8e48603c9e5515a4cec7a
M: ab307ba26d6dabe8edb2f2a7287be6f01aa46d88 127.0.0.1:7004
   slots: (0 slots) master
   replicates d3058a19483d7be5c30c042779e56130f6ebf074
M: 11174332eb6ad40c0327750536fa776d706caf85 127.0.0.1:7005
   slots: (0 slots) master
   replicates 5814305e71552ab45c44b9b8233681a63c3a57b1
<span style="color:#009900;">[OK] All nodes agree about slots configuration.</span>
>>> Check for open slots...
>>> Check slots coverage...
<span style="color:#009900;">[OK] All 16384 slots covered.</span></span>


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值