解決Redis報錯MISCONF?Redis?is?configured?to?save?RDB?snapshots
一、問題描述
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.
二、解決方法
兩種方法解決:一是通過命令行修改,一是通過配置文件修改。
1.命令行修改
redis-cli auth XXX 127.0.0.1:6379> config set stop-writes-on-bgsave-error no
2.配置文件修改
修改 redis.conf ,將 stop-writes-on-bgsave-error 設(shè)置為 no,然后重啟服務(wù)。
三、其它問題
一般還會同時有兩個警告:
WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
和
WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
警告1解決方法:
echo 1 > /proc/sys/vm/overcommit_memory
警告2解決方法:
vi /etc/sysctl.conf
#添加配置 net.core.somaxconn = 1024
檢查是否成功:sysctl -p
總結(jié)
到此這篇關(guān)于解決Redis報錯MISCONF Redis is configured to save RDB snapshots的文章就介紹到這了,更多相關(guān)Redis報錯MISCONF Redis內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
基于?Spring?Aop?環(huán)繞通知實現(xiàn)?Redis?緩存雙刪功能(示例代碼)
基于 spring aop 常規(guī)應(yīng)用場景多是用于日志記錄以及實現(xiàn) redis 分布式鎖,在 github 中也有項目是把它拿來當(dāng)作緩存的異常捕捉,這篇文章主要介紹了基于?Spring?Aop?環(huán)繞通知實現(xiàn)?Redis?緩存雙刪,需要的朋友可以參考下2022-08-08
通過 Redis 實現(xiàn) RPC 遠(yuǎn)程方法調(diào)用(支持多種編程語言)
這篇文章主要介紹了通過 Redis 實現(xiàn) RPC 遠(yuǎn)程方法調(diào)用,支持多種編程語言,本文就以Ruby和Python為例,給出了實現(xiàn)代碼,需要的朋友可以參考下2014-09-09
Redis?中ZSET數(shù)據(jù)類型命令使用及對應(yīng)場景總結(jié)(案例詳解)
這篇文章主要介紹了Redis?中ZSET數(shù)據(jù)類型命令使用及對應(yīng)場景總結(jié),本文通過示例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2023-01-01
Redis哨兵模式在Spring Boot項目中的使用與實踐完全指南
Redis哨兵模式為SpringBoot項目提供高可用Redis管理,實現(xiàn)自動故障轉(zhuǎn)移與監(jiān)控,通過配置依賴、參數(shù)及最佳實踐(如哨兵節(jié)點數(shù)量、網(wǎng)絡(luò)規(guī)劃),可提升系統(tǒng)穩(wěn)定性與可靠性,本文給大家介紹Redis哨兵模式在Spring Boot項目中的使用與實踐,感興趣的朋友跟隨小編一起看看吧2025-09-09
CentOS7.5使用mysql_multi方式安裝MySQL5.7.28多實例(詳解)
這篇文章主要介紹了CentOS7.5使用mysql_multi方式安裝MySQL5.7.28多實例,非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下2020-01-01
redisson中RRateLimiter分布式限流器的使用
Redisson Ratelimiter是Redisson框架中的一種限流算法,用于限制對資源的訪問頻率,本文主要介紹了redisson中RRateLimiter分布式限流器的使用,感興趣的可以了解一下2024-06-06
Redis遠(yuǎn)程字典服務(wù)器?hash類型示例詳解
這篇文章主要介紹了Redis遠(yuǎn)程字典服務(wù)器?hash類型示例詳解,本文通過示例代碼給大家介紹的非常詳細(xì),感興趣的朋友跟隨小編一起看看吧2024-08-08

