Docker的redis容器突然报错,不能使用,(error) MISCONF Redis is configured to save RDB snapshots...

前言

Redis突然链接不上了...

解决方案


#docker 进入redis容器中,其中"f0dd"为redis容器的id开始四位
[root@iZ2zeca7jric8sx4f3n7spZ ~]# docker exec -it f0dd /bin/bash

#错误示例-Begin,已经忘了redis命令是啥了...
root@f0dd1681b64f:/data# get
bash: get: command not found
root@f0dd1681b64f:/data# key
bash: key: command not found
root@f0dd1681b64f:/data# redis
bash: redis: command not found
#错误示例-End,已经忘了redis命令是啥了...

#进入客户端(redis client)
root@f0dd1681b64f:/data# redis-cli

#写入一个键值
127.0.0.1:6379> set name zf
#报错信息
(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.
#解决命令
127.0.0.1:6379> config set stop-writes-on-bgsave-error no
OK
#验证错误是否解决
127.0.0.1:6379> set name zf
OK

摘抄文档

posted @ 2021-02-25 22:20  zh89233  阅读(928)  评论(0编辑  收藏  举报