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

关于启动redis集群时:

[ERR] Node 172.168.63.202:7001 is not empty. Either the nodealready knows other nodes (check with CLUSTER NODES) or contains some

的问题

解决办法:

1)将每个节点下aof、rdb、nodes.conf本地备份文件删除; 

rm -rf appendonly.aof
rm -rf dump.rdb
rm -rf nodes.conf


2)172.168.63.201:7001> flushdb #清空当前数据库(可省略) 
3)之后再执行脚本,成功执行;

这里解释一下dump.rdb文件:

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

SNAPSHOT即快照

重新启动redis集群,成功

你可能感兴趣的:([ERR] Node 172.16.6.154:7002 is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.)