redis创建集群报错can‘t connect to node 192.168.163.203

【README】

创建集群报错 can't connect to node 192.168.163.203  

[root@centos201 ~]# /usr/local/redis-cluster/bin/redis-trib.rb create --replicas 0 192.168.163.201:6379 192.168.163.202:6379 192.168.163.203:6379
>>> Creating cluster
Connecting to node 192.168.163.201:6379: OK
Connecting to node 192.168.163.202:6379: OK
Connecting to node 192.168.163.203:6379: [ERR] Sorry, can't connect to node 192.168.163.203:6379

【1】解决方法

切换到 203机器,关闭其防火墙;

systemctl stop firewalld.service    

 

【2】再次创建redis集群

--replicas 参数为0 ,表示0个副本,即所有节点全部是 master 

[root@centos201 ~]# /usr/local/redis-cluster/bin/redis-trib.rb create --replicas 0 192.168.163.201:6379 192.168.163.202:6379 192.168.163.203:6379
>>> Creating cluster
Connecting to node 192.168.163.201:6379: OK
Connecting to node 192.168.163.202:6379: OK
Connecting to node 192.168.163.203:6379: OK
>>> Performing hash slots allocation on 3 nodes...
Using 3 masters:
192.168.163.201:6379
192.168.163.202:6379
192.168.163.203:6379
M: 5571f088f9d8798dd0c2e973ced830c2cd8033a2 192.168.163.201:6379
   slots:0-5460 (5461 slots) master
M: 99a3516a03612dba4b73c32e7e1e03ff1145a660 192.168.163.202:6379
   slots:5461-10922 (5462 slots) master
M: 5c0ea563b464e58dd8dc9722cdfcb97a85c44714 192.168.163.203:6379
   slots:10923-16383 (5461 slots) master
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.163.201:6379)
M: 5571f088f9d8798dd0c2e973ced830c2cd8033a2 192.168.163.201:6379
   slots:0-5460 (5461 slots) master
M: 99a3516a03612dba4b73c32e7e1e03ff1145a660 192.168.163.202:6379
   slots:5461-10922 (5462 slots) master
M: 5c0ea563b464e58dd8dc9722cdfcb97a85c44714 192.168.163.203:6379
   slots:10923-16383 (5461 slots) master
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.

bingo ! 

创建redis集群成功 ! 

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值