Redis删除并重新创建一个集群

发现自己搭建的集群有问题, 如何删除现有集群并重写搭建:

1. 登录每台机器查看启动的redis服务,然后停掉所以的redis服务

ps -ef| grep redis
kill 12455 12460

2. 登录每台机器,删除上个集群的相关文件

[allen@localhost redis-5.0.3]$ cd 8001
[allen@localhost 8001]$ ls
8001.log  appendonly.aof  dump.rdb  nodes-8001.conf
[allen@localhost 8001]$ rm -f *
[allen@localhost 8001]$ 

[allen@localhost ~]$ cd packages/redis-5.0.3/
[allen@localhost redis-5.0.3]$ cd 8003
[allen@localhost 8003]$ rm -f *
[allen@localhost 8003]$ cd ../8006/
[allen@localhost 8006]$ rm -f *
[allen@localhost 8006]$ 

[allen@localhost redis-5.0.3]$ cd 8002
[allen@localhost 8002]$ ls
8002.log  appendonly.aof  dump.rdb  nodes-8002.conf
[allen@localhost 8002]$ rm -f *
[allen@localhost 8002]$ cd ../8004
-bash: cd: ../8004: No such file or directory
[allen@localhost 8002]$ cd ../8005
[allen@localhost 8005]$ rm -f *
[allen@localhost 8005]$ 

3. 重写启动redis 的所有服务

src/redis-server redis-cluster/8001/redis.conf 
src/redis-server redis-cluster/8004/redis.conf

src/redis-server redis-cluster/8002/redis.conf 
src/redis-server redis-cluster/8005/redis.conf

src/redis-server redis-cluster/8003/redis.conf 
src/redis-server redis-cluster/8006/redis.conf 

4. 重新创建集群

https://blog.csdn.net/pengweismile/article/details/112728366 

猜你喜欢

转载自blog.csdn.net/pengweismile/article/details/112910540