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

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

处理办法:

解决方法:

1)、停止所有redis进程,将需要新增的节点下aof、rdb等本地备份文件删除;

2)、同时将新Node的集群配置文件删除,即:删除你redis.conf里面cluster-config-file所在的文件,一般为nodes.conf;

3)、再次添加新节点如果还是报错,则登录新Node,./redis-cli–h x –p对数据库进行清除:

192.168.15.102:6000>  flushdb      #清空当前数据库

启动redis进程重新执行集群新建命令

./redis-trib.rb create –replicas 1 192.168.15.102:6000 192.168.15.102:6001 192.168.15.102:6002 192.168.15.102:6003 192.168.15.102:6004 192.168.15.102:6005

>> Creating cluster
>>> Performing hash slots allocation on 6 nodes…
Using 3 masters:
192.168.15.102:6000
192.168.15.102:6001
192.168.15.102:6002
Adding replica 192.168.15.102:6004 to 192.168.15.102:6000
Adding replica 192.168.15.102:6005 to 192.168.15.102:6001
Adding replica 192.168.15.102:6003 to 192.168.15.102:6002
>>> Trying to optimize slaves allocation for anti-affinity
…….
Can I set the above configuration? (type ‘yes’ to accept): yes
>>> Nodes configuration updated
>>> Assign a different config epoch to each node
>>> Sending CLUSTER MEET messages to join the cluster
Waiting for the cluster to join…