1.删除每个节点的.aof |.rdb | nodes-*.conf
rm -rf appendonly.aof rm -rf dump.rdb rm -rf nodes-*.conf
2.启动所有节点
如果已经启动了就不需要启动 : 启动命令
/usr/local/redis/src/redis-server /usr/local/redis-cluster/8001/redis.conf
3.连接集群每个节点
使用如下命令连接
/usr/local/redis/src/redis-cli -a liuxs -c -h 192.168.154.146 -p 8001
执行redis命令 :
flushdb cluster reset
4.重启所有节点
先关闭 再启动
/usr/local/redis/src/redis-cli -a liuxs -c -h 192.168.154.146 -p 8001 shutdown /usr/local/redis/src/redis-server /usr/local/redis-cluster/8001/redis.conf
5.重新创建redis集群
/usr/local/redis/src/redis-cli -a liuxs --cluster create --cluster-replicas 1 192.168.154.146:8001 192.168.154.147:8002 192.168.154.148:8003 192.168.154.146:8004 192.168.154.147:8005 192.168.154.148:8006
6.集群信息查看
集群信息查看
cluster info
查看各个节点
cluster nodes