PYTHON

Redis RDB 저장 에러 (MISCONF Redis is configured to save RDB snapshots)

Neda 2022. 5. 18. 15:47

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.

내용: redis는 rdb 스냅샷을 찍어 데이터를 보관하게 되는데, RDB 저장시 폴더의 쓰기 권한이 없어 저장을 못해 발생

해결방안:

RDB의 기본 저장 폴더는 /etc/redis/redis.conf 파일 내에 dir ./ 와 같이 경로가 지정되어 있다.

vi 에디터를 이용해 dir ./ -> dir /home/user/redis 와 같이 원하는 폴더로 지정한 후 

지정한 폴더의 권한을 Redis로 변경한다 

chown redis:redis -R /home/user/redis
참고 https://stackoverflow.com/questions/22160753/redis-failed-opening-rdb-for-saving-permission-denied