redis集群在主机宕机后再次启动集群会报一个错误,如下图。
>>> Creating cluster
[ERR] Node x.x.x.x:x is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database0.
解决方法:
1)删除redis配置文件里“cluster-config-file”node集群文件。
2)清除所以节点redis数据库里的内容。
x.x.x.x:x> flushdb
所以节点执行“flushdb”命令。
3)重新启动redis节点。
4)启动redis集群。
redis-trib.rb create --replicas 1 x.x.x.x:x x.x.x.x:x ........