2020-12-09 11:52:25|21965|ERROR|storage/DRedisAsyncCallback.cpp:394[cbIncrby]Cmd 'INCRBY' failed, key: T:Gear:0:2019120515244332428:772:9, error: 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不能再root權限下運行,所以要進行降權切成普通用戶等操作,剛剛做完切權操作,客戶監控發出來專案服務的報錯郵件,經過查看發現是Redis問題.
日志報錯大概就是以上內容,大致意思是Redis配置了RDB持久化,但它目前無法在磁盤上持久存盤,可以修改資料集的命令被禁用,因為如果RDB快照失敗,這個實體被配置為在寫期間報告錯誤(stop-write -on-bgsave-error選項),看到這里就明白,原來redis沒有辦法在磁盤上行程持久化存盤,
但是這個問題是如何引發出來的呢?
當時解決思路:
1.磁盤是否損壞
2.磁盤是否飽和
3.強制關閉Redis快照導致不能持久化
4.權限問題導致無法寫入
排查了一圈,最終因為強制把redis快照關閉了導致不能持久化的問題
解決方法很簡單:通過stop-writes-on-bgsave-error值設定為no即可避免這種問題,
命令方式:
下次重啟redis會失效
redis-cli -h xxxxx -p 7003 -a xxxxxx config set stop-writes-on-bgsave-error no
修改組態檔:
stop-writes-on-bgsave-error no
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/232254.html
標籤:Linux
