1. 程式人生 > >MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk

MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk

問題 -c lease serve check ons cau conf exc

ubuntu上面redis報下列錯誤:

Caused by: redis.clients.jedis.exceptions.JedisDataException: MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk.

Commands that may modify the data set are disabled. Please check Redis logs for details about the error.

原因分析:
查看redis-server.log,發現報Failed opening .rdb for saving: Read-only file system
分析可能是rdb權限問題,於是給文件授予777,完了還是不行,於是把啟動方式改成配置文件啟動,居然成功了。。


解決方案:
a.連接redis-cli後執行config set stop-writes-on-bgsave-error no(此方式試過不行)
b.查看redis.conf裏的dir 目錄,將redis.conf授權成755以上
c.將啟動方式 /etc/init.d/redis-server改成配置文件啟動(原因可能是安裝時的配置文件路徑問題造成)。

MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk