解決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 設置為 no,然后重啟服務。
三、其它問題
一般還會同時有兩個警告:
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é)
到此這篇關于解決Redis報錯MISCONF Redis is configured to save RDB snapshots的文章就介紹到這了,更多相關Redis報錯MISCONF Redis內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
Redis集群利用Redisson實現(xiàn)分布式鎖方式
這篇文章主要介紹了Redis集群利用Redisson實現(xiàn)分布式鎖方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-05-05通過docker和docker-compose安裝redis兩種方式詳解
這篇文章主要介紹了通過docker和docker-compose安裝redis的兩種方式,Docker安裝方式包括拉取鏡像、查看本地鏡像、運行容器和測試連接,Docker Compose安裝方式包括目錄結(jié)構(gòu)、配置文件、啟動和關閉容器、檢查啟動情況以及查看CPU和內(nèi)存使用狀態(tài),需要的朋友可以參考下2024-12-12RedisTemplate中boundHashOps的使用小結(jié)
redisTemplate.boundHashOps(key)?是 RedisTemplate 類的一個方法,本文主要介紹了RedisTemplate中boundHashOps的使用小結(jié),具有一定的參考價值,感興趣的可以了解一下2024-04-04Redis內(nèi)存碎片產(chǎn)生原因及Pipeline管道原理解析
這篇文章主要為大家介紹了Redis內(nèi)存碎片產(chǎn)生原因及Pipeline管道原理解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪2023-03-03Redis Cluster集群收縮主從節(jié)點詳細教程
集群收縮的源端就是要下線的主節(jié)點,目標端就是在線的主節(jié)點,這篇文章主要介紹了Redis Cluster集群收縮主從節(jié)點詳細教程,需要的朋友可以參考下2021-11-11