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

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

1. 登录每台机器查看启动的redis服务,然后停掉所以的redis服务,按照进程号kill掉

ps -ef| grep redis
kill 12455 12460

2. 登录每台机器,删除上个集群的相关文件,如下四个文件都删掉(log可以不用管)

[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 

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 技术工厂 设计师:CSDN官方博客 返回首页