redis 一直 Waiting for the cluster to join.........
网上有的说 删除dump 和 nodes 文件,重启 ,我试了之后不行。
也有的说什么端口16379 被防火墙屏蔽了,也不行。后来 是因为内存不够了。
杀掉一些进程后 删除了所有节点的 dump 和 nodes 文件 然后再执行一次 集群创建 就成功了。
redis 下载安装
https://www.redis.net.cn/download/
修改后台启动
https://www.cnblogs.com/wanghy898/p/11194954.html
liunx 安装ruby
https://www.runoob.com/ruby/ruby-installation-unix.html
redis集群
https://blog.csdn.net/Hello_World_QWP/article/details/78257428
gem install redis
https://www.jianshu.com/p/c38369097448 安装包安装
https://www.cnblogs.com/name-lizonglin/p/12069114.html
报错:
./redis-trib.rb 报错:/usr/local/rvm/gems/ruby-2.4.2/gems/redis-4.0.1/lib/redis/client.rb:119:in `call'
错误提示是
slot插槽被占用了(这是 搭建集群前时,以前redis的旧数据和配置信息没有清理干净。)
解决方案是
用redis-cli 登录到每个节点执行 flushall 和 cluster reset 就可以了。
然后重新执行群集脚本命令:
./redis-trib.rb create --replicas 1 192.168.*.*:7001 192.168.*.*:7002 192.168.*.*:7003 192.168.*.*:7004 192.168.*.*:7005 192.168.*.*:7006
/usr/local/lib/ruby/gems/2.4.0/gems/redis-4.0.0/lib/redis/client.rb:119:in `call': ERR Slot 0 is already busy (Redis::CommandError) from /usr/local/lib/ruby/gems/2.4.0/gems/redis-4.0.0/lib/redis.rb:2742:in `block in method_missing' from /usr/local/lib/ruby/gems/2.4.0/gems/redis-4.0.0/lib/redis.rb:45:in `block in synchronize' from /usr/local/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize' from /usr/local/lib/ruby/gems/2.4.0/gems/redis-4.0.0/lib/redis.rb:45:in `synchronize' from /usr/local/lib/ruby/gems/2.4.0/gems/redis-4.0.0/lib/redis.rb:2741:in `method_missing' from src/redis-trib.rb:212:in `flush_node_config' from src/redis-trib.rb:906:in `block in flush_nodes_config' from src/redis-trib.rb:905:in `each' from src/redis-trib.rb:905:in `flush_nodes_config' from src/redis-trib.rb:1426:in `create_cluster_cmd' from src/redis-trib.rb:1830:in `<main>'
把所有节点下的 dump.rdb 和 nodes.conf 删除,然后 节点全部重启一下 在执行
./redis-trib.rb create --replicas 1 192.168.*.*:7001 192.168.*.*:7002 192.168.*.*:7003 192.168.*.*:7004 192.168.*.*:7005 192.168.*.*:7006
就可以了