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