3、Redis 集群特性之容错、数据迁移

前言:

该篇中主要讲解一下redis的容错以及数据的迁移(横向拓展)


redis 集群信息

在前面章节中讲到将Node加入到cluster以后打印了如下日志:

[root@localhost src]# ./redis-trib.rb create --replicas 1 192.168.1.103:7000 192.168.1.103:7001 192.168.1.103:7002 192.168.1.103:7003 192.168.1.103:7004 192.168.1.103:7005 
>>> Creating cluster
Connecting to node 192.168.1.103:7000: OK
Connecting to node 192.168.1.103:7001: OK
Connecting to node 192.168.1.103:7002: OK
Connecting to node 192.168.1.103:7003: OK
Connecting to node 192.168.1.103:7004: OK
Connecting to node 192.168.1.103:7005: OK
>>> Performing hash slots allocation on 6 nodes...
Using 3 masters:
192.168.1.103:7000
192.168.1.103:7001
192.168.1.103:7002
Adding replica 192.168.1.103:7003 to 192.168.1.103:7000
Adding replica 192.168.1.103:7004 to 192.168.1.103:7001
Adding replica 192.168.1.103:7005 to 192.168.1.103:7002
M  4bc092eb4731152d15172b065c74c7a795fe6304 192.168.1.103:7000
   slots:0-5460(5461 slots) master 
M: f37ec54101536425ce8798e041ad75a582d7e153 192.168.1.103:7001
   slots:5461-10922 (5462 slots) master
M: 7b0ca3978858454051ad572aa816eec450f31a53 192.168.1.103:7002
   slots:10923-16383 (5461 slots) master
S: 778e649f47fa98f6d1f6b1f1043812c6685dc4a8 192.168.1.103:7003
   replicates 4bc092eb4731152d15172b065c74c7a795fe6304
S: 907feee1b665554cadc64921c7fcb8c05b8a5ab6 192.168.1.103:7004
   replicates f37ec54101536425ce8798e041ad75a582d7e153
S: b2bea8ede402e2112cced7d7cea52127f18edef2 192.168.1.103:7005
   replicates 7b0ca3978858454051ad572aa816eec450f31a53
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 192.168.1.103:7000)
M: 4bc092eb4731152d15172b065c74c7a795fe6304 192.168.1.103:7000
   slots:0-5460 (5461 slots) master
M: f37ec54101536425ce8798e041ad75a582d7e153 192.168.1.103:7001
   slots:5461-10922 (5462 slots) master
M: 7b0ca3978858454051ad572aa816eec450f31a53 192.168.1.103:7002
   slots:10923-16383 (5461 slots) master
M: 778e649f47fa98f6d1f6b1f1043812c6685dc4a8 192.168.1.103:7003
   slots: (0 slots) master
   replicates 4bc092eb4731152d15172b065c74c7a795fe6304
M: 907feee1b665554cadc64921c7fcb8c05b8a5ab6 192.168.1.103:7004
   slots: (0 slots) master
   replicates f37ec54101536425ce8798e041ad75a582d7e153
M: b2bea8ede402e2112cced7d7cea52127f18edef2 192.168.1.103:7005
   slots: (0 slots) master
   replicates 7b0ca3978858454051ad572aa816eec450f31a53
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

可以得到如下信息


节点名称

7000

7001

7002

7003

7004

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值