解決Redis報(bào)錯(cuò)MISCONF?Redis?is?configured?to?save?RDB?snapshots
一、問(wèn)題描述
Redis 之前一直使用正常,某一天突然報(bào)錯(cuò):
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.
二、解決方法
兩種方法解決:一是通過(guò)命令行修改,一是通過(guò)配置文件修改。
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ù)。
三、其它問(wèn)題
一般還會(huì)同時(shí)有兩個(gè)警告:
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報(bào)錯(cuò)MISCONF Redis is configured to save RDB snapshots的文章就介紹到這了,更多相關(guān)Redis報(bào)錯(cuò)MISCONF Redis內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Redis集群利用Redisson實(shí)現(xiàn)分布式鎖方式
這篇文章主要介紹了Redis集群利用Redisson實(shí)現(xiàn)分布式鎖方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-05-05通過(guò)docker和docker-compose安裝redis兩種方式詳解
這篇文章主要介紹了通過(guò)docker和docker-compose安裝redis的兩種方式,Docker安裝方式包括拉取鏡像、查看本地鏡像、運(yùn)行容器和測(cè)試連接,Docker Compose安裝方式包括目錄結(jié)構(gòu)、配置文件、啟動(dòng)和關(guān)閉容器、檢查啟動(dòng)情況以及查看CPU和內(nèi)存使用狀態(tài),需要的朋友可以參考下2024-12-12RedisTemplate中boundHashOps的使用小結(jié)
redisTemplate.boundHashOps(key)?是 RedisTemplate 類(lèi)的一個(gè)方法,本文主要介紹了RedisTemplate中boundHashOps的使用小結(jié),具有一定的參考價(jià)值,感興趣的可以了解一下2024-04-04解決redis sentinel 頻繁主備切換的問(wèn)題
這篇文章主要介紹了解決redis sentinel 頻繁主備切換的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2021-04-04Redis內(nèi)存碎片產(chǎn)生原因及Pipeline管道原理解析
這篇文章主要為大家介紹了Redis內(nèi)存碎片產(chǎn)生原因及Pipeline管道原理解析,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-03-03Linux環(huán)境下升級(jí)redis的詳細(xì)步驟記錄
這篇文章主要給大家介紹了關(guān)于Linux環(huán)境下升級(jí)redis的詳細(xì)步驟,描述了如何從舊版本升級(jí)到新版本Redis,包括備份舊數(shù)據(jù)、下載和安裝新版本、復(fù)制配置文件和數(shù)據(jù)、停止舊版本并啟動(dòng)新版本的過(guò)程,需要的朋友可以參考下2024-12-12Redis Cluster集群收縮主從節(jié)點(diǎn)詳細(xì)教程
集群收縮的源端就是要下線的主節(jié)點(diǎn),目標(biāo)端就是在線的主節(jié)點(diǎn),這篇文章主要介紹了Redis Cluster集群收縮主從節(jié)點(diǎn)詳細(xì)教程,需要的朋友可以參考下2021-11-11Redis分布式鎖如何設(shè)置超時(shí)時(shí)間
這篇文章主要介紹了Redis分布式鎖如何設(shè)置超時(shí)時(shí)間,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2022-11-11