zhongxia245 / blog

这是一个Blog, 如果喜欢可以订阅,是Watch, 不是 Star 哈。。。
https://zhongxia245.github.io/blog/
160 stars 33 forks source link

MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error. #92

Closed zhongxia245 closed 5 years ago

zhongxia245 commented 5 years ago

原文地址:https://www.jianshu.com/p/3aaf21dd34d6

时间:2018-11-08 14:58:48

标题即错误信息。

Redis问题

MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.

Redis被配置为保存数据库快照,但它目前不能持久化到硬盘。用来修改集合数据的命令不能用。请查看Redis日志的详细错误信息。

原因

强制关闭Redis快照导致不能持久化。

解决方案

stop-writes-on-bgsave-error设置为no

127.0.0.1:6379> redis-cli 
127.0.0.1:6379> config set stop-writes-on-bgsave-error no
zhongxia245 commented 5 years ago

原谅一个前端定位不熟悉的部分,才做这么简单的记录哈

记录一下该问题的由来!

之前使用 egg-cnode 的开源代码部署了一个网站,今天访问突然500报错,然后就开始定位错误的路程。

解决问题路线

1. 定位问题

# 所以去找到 egg-cnode 日志放的位置, 因为太久没有更新了,都忘记放哪里了。 
# 关闭
npm stop 
# 启动, 启动信息有日志存放位置的信息
npm start

# 找到 ~/log/egg-cnode/ 目录

2. 实时查看日志

# 查看错误日志文件
tail -f ~/log/egg-cnode/common-error.log

# 找到错误信息
name: 'ReplyError'
message: 'MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.'
command: { name: 'set', args: [ 'tops', '[{"_id":"5b0525da32db5b2d37cb6884","accessToken":"3b16e790-ae2b-445f-821f-837e79b9e046","avatar":"http://p92r923kj.bkt.clouddn.com/7597581.jpeg","email":"izhongxia@sina.com","pass":"$2a$10$u1KN1Z2lLOlRAOTKClbLcuVlxECRdIYM4E6TQoZ5KIf.tvDeiyhJi","loginname":"zhongxia","name":"zhongxia","__v":0,"location":"","signature":"","url":"","weibo":"","receive_at_mail":true,"receive_reply_mail":true,"active":true,"update_at":"2018-09-28T06:41:49.601Z","create_at":"2018-05-23T08:27:06.258Z","collect_topic_count":0,"collect_tag_count":0,"following_count":0,"follower_count":0,"reply_count":87,"topic_count":-1,"score":430,"is_block":false}]', 'EX', '60' ] }
pid: 20011
hostname: iZ2zehejz8ufzy9vmvt9xlZ

3. 如何解决这个错误呢?

google 了下,上面的内容就是解决方案了。