본문 바로가기
개발/기타

Redis MISCONF Redis is configured to save RDB snapshots 에러 해결하기

by mabyoungg 2023. 9. 3.

프로젝트 진행 과정에서 Redis를 사용하다 아래와 같은 오류가 발생했다. 

MISCONF Redis is configured to save RDB snapshots, but it is currently not able to persist on disk. Commands that may modify the data set are disabled, because this instance is configured to report errors during writes if RDB snapshotting fails (stop-writes-on-bgsave-error option). Please check the Redis logs for details about the RDB error.

 

Redis는 persistent를 유지하기 위해서 주기적으로 BGSAVE로 RDB 파일을 저장하게 된다.

이 과정에서 메모리가 부족하여 RDB 파일을 작성하다 실패하면 모든 쓰기 요청이 막혀 데이터 쓰기가 불가능해진다.

프로젝트에서 Redis를 단순 캐시용도로 사용하고 있기 때문에 bgsave 에러가 났을 때 멈추는 설정을 끄기로 한다.

 

현재는 AWS Free Tier 계정이라 사양이 낮은 인스턴스의 메모리 부족으로 발생했는데, 발생 가능한 사유는 인스턴스의 물리적 여유 공간이 부족하거나, 권한 문제 등이 있다.


아래와 같이 redis-cli 접속해서 config set stop-writes-on-bgsave-error no 입력해 변경한다.

ubuntu@ip-0-0-0-0:~$ redis-cli
127.0.0.1:6379> config set stop-writes-on-bgsave-error no
OK

 

또는 redis.conf 파일 내 SNAPSHOTTING 부분에 stop-writes-on-bgsave-error 부분이 기본 설정은 yes인데 no로 변경한다.

sudo vi /etc/redis/redis.conf
############### SNAPSHOTTING ###############
stop-writes-on-bgsave-error no

'개발 > 기타' 카테고리의 다른 글

Naver Cloud Platform (NCP) 서버 배포하기  (1) 2023.12.18
23년 08월 다섯째주 WIL  (0) 2023.09.04
AWS EC2 ubuntu Redis 설치하기  (0) 2023.09.02
23년 08월 넷째주 WIL  (0) 2023.08.28
23년 08월 셋째주 WIL  (0) 2023.08.21