您的位置:首页 > 数据库 > Redis

【redis】关于集群创建遇到的问题

2015-05-18 20:06 453 查看
1.先是下载最新版的redis: https://github.com/antirez/redis/archive/unstable.zip
2.解压后, 运行 make & make instal;

3.修改了redis.conf, 改动点:

[plain] view
plaincopy





port 6379

loglevel verbose

cluster-enabled yes

cluster-config-file nodes-<port>.conf

cluster-node-timeout 15000

4.接着运行集群创建命令:

./redis-trib.rb create 192.168.1.13:6379 192.168.1.13:6390 192.168.1.15:6380 192.168.1.89:6381

结果操作一直阻塞在 Waiting for the cluster to join.........................

5.后来根据huangz的建议,使用add-node一个个的添加节点,来发现问题所在;最后还是没把192.168.1.15添加成功,此时还是没有提示错误信息。

此时在shell中用cluster info查看状态,显示为

[html] view
plaincopy





192.168.1.13:6379> cluster info

cluster_state:ok

cluster_slots_assigned:16384

cluster_slots_ok:16384

cluster_slots_pfail:0

cluster_slots_fail:0

cluster_known_nodes:3

cluster_size:3

cluster_current_epoch:0

cluster_stats_messages_sent:116180

cluster_stats_messages_received:116179

6.接着尝试CLUSTER MEET方法来添加最后一个节点,出现了如下错误:

[html] view
plaincopy





127.0.0.1:7000> cluster meet 192.168.1.15 6380

[7180] 25 Feb 14:20:45.429 - Accepted cluster node 192.168.1.13:36252

[7180] 25 Feb 14:20:45.429 # Bad message length or signature received from Cluster bus.

7. 到此时,集群已经有三个节点了,算是一个最小完整的集群。至于第四个节点没有添加成功的原因,还有待研究。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: