liunx redis 搭建 ruby 安装

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 

就可以了

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值