Redis 에러 bgsave

2022. 9. 10. 17:25카테고리 없음

728x90

(error) MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to 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.

 

위와 같은 에러는 여러 가지 상황으로 인해 나타날 수 있다.

자세한 건 로그를 확인해야 하지만 대부분은 폴더 권한이 없어서 메모리에 있는 데이터를 File 저장할 시 에러가 나는 경우가 많다.

 

redis-cli 접속 후 redis.conf 설정을 확인한다.

CONFIG GET dir
CONFIG GET dbfilename

첫 번째는 File을 만들 경로고 두 번째는 파일 명이다.

근데 위 명령어로 볼 경우 dir 경로가 "/"로 돼있는 걸 볼 수 있다.

redis.conf의 dir를 확인한다.

./으로 되어있는 걸 볼 수 있다.

./이었던 경로명을 원하는 경로명으로 변경해준다.

왜 명령어로 확인할 때와 redis.conf로 확인할 때의 경로가 모두 루트 경로("/")를 지정하는지 모르겠지만 내가 원하는 폴더 경로로 변경 하자.

ls -l
덤프 파일을 생성할 폴더 권한이 있는지 확인

나 같은 경우 redis-stable 폴더에 만들고 폴더 권한을 보니 쓰기 권한이 없다!

쓰기 권한 및 하위 권한들도 적용하게 수정한다.

sudo chmod 777 -R redis-stable

레디스 서비스를 재시작한다

sudo systemctl restart [서비스명]

레디스를 사용하면서 시간이 지나 File로 남기는지 확인하면 된다.

 

 

참고 링크 : https://stackoverflow.com/questions/19581059/misconf-redis-is-configured-to-save-rdb-snapshots

 

MISCONF Redis is configured to save RDB snapshots

During writes to Redis ( SET foo bar ) I am getting the following error: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modi...

stackoverflow.com