프로그램/LINUX

[Redis] Node [redis] is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0. error 해결하기

프뚜 2023. 1. 13. 10:00
728x90
반응형
SMALL

안녕하세요! 프뚜입니다.

 

Node [redis] is not empty. Either the node already knows other nodes (check with CLUSTER NODES) or contains some key in database 0.

레디스 클러스터를 연결하려고 했으나 위와 같은 에러를 발생하게 되었습니다. 해결 방법은 아래와 같습니다.


[개발환경]

 - OS: Ubuntu 22.04.1 LTS


# aof/rdb 백업 파일 제거하기

redis.conf에 dir로 지정된 경로의 appendonly.aof와 dump.rdb를 삭제합니다.


# node.conf 파일 제거하기

redis.conf에 cluster-config-file로 지정된 경로의 nodes.conf를 삭제합니다.


# 해당 클러스터 접속 후 flushall 하기

redis-cli -c -p [port]
flushall

위 3가지를 통해 해결할 수 있습니다.

728x90
반응형
LIST