欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

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

发布时间:2023/12/3 53 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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:6379slots:0-5460 (5461 slots) master M: 99a3516a03612dba4b73c32e7e1e03ff1145a660 192.168.163.202:6379slots:5461-10922 (5462 slots) master M: 5c0ea563b464e58dd8dc9722cdfcb97a85c44714 192.168.163.203:6379slots: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:6379slots:0-5460 (5461 slots) master M: 99a3516a03612dba4b73c32e7e1e03ff1145a660 192.168.163.202:6379slots:5461-10922 (5462 slots) master M: 5c0ea563b464e58dd8dc9722cdfcb97a85c44714 192.168.163.203:6379slots: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集群成功 ! 

 

 

总结

以上是生活随笔为你收集整理的redis创建集群报错can‘t connect to node 192.168.163.203的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。