当前位置:   article > 正文

redis.clients.jedis.exceptions.JedisClusterException & [ERR] Node 192.168.10.32:7001 is not emp

redis.clients.jedis.exceptions.jedisclusterexception: clusterdown the cluste

1:redis.clients.jedis.exceptions.JedisClusterException: CLUSTERDOWN The cluster is down\n\tat

2: [ERR] Node 192.168.10.32:7001 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.

 

  从redis单机版切换到redis集群(redis-cluster)后,    

  运行项目,牵扯到使用redis的部分报错:

  1. status: 500
  2. msg:
  3. redis.clients.jedis.exceptions.JedisClusterException: CLUSTERDOWN The cluster is down\n\tat redis.clients.jedis.Protocol.processError(Protocol.java:115)\n\tat
  4. redis.clients.jedis.Protocol.process(Protocol.java:142)\n\tat redis.clients.jedis.Protocol.read(Protocol.java:196)\n\tat
  5. redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:288)\n\tat redis.clients.jedis.Connection.getIntegerReply(Connection.java:213)\n\tat
  6. redis.clients.jedis.Jedis.hdel(Jedis.java:726)\n\tat redis.clients.jedis.JedisCluster$34.execute(JedisCluster.java:404)\n\tat

 

 确定问题出在redis集群处,

 到redis集群服务器重新创建集群时,报错

  1. [root@campusnetwork redis-cluster]# ./redis-trib.rb create --replicas 1 192.168.10.32:7001 192.168.10.32:7002 192.168.10.32:7003 192.168.10.32:7004 192.168.10.32:7005 192.168.10.32:7006
  2. >>> Creating cluster
  3. Connecting to node 192.168.10.32:7001: OK
  4. [ERR] Node 192.168.10.32:7001 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.

那么可能和redis快照有关
 

dump.rdb文件:

         dump.rdb是由Redis服务器自动生成的 默认情况下 每隔一段时间redis服务器程序会自动对数据库做一次遍历,把内存快照写在一个叫做“dump.rdb”的文件里,这个持久化机制叫做SNAPSHOT。有了SNAPSHOT后,如果服务器宕机,重新启动redis服务器程序时redis会自动加载dump.rdb,将数据库状态恢复到上一次做SNAPSHOT时的状态。

 

解决方法:

  将每个节点下dump.rdb、nodes.conf本地备份文件删除

 

  再执行脚本创建集群,成功!!!  

  运行集群运行项目,成功!!!   

  激动!!!

 

 

 

 

 

 

 

 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/638442
推荐阅读
相关标签
  

闽ICP备14008679号