在写入 Redis ( SET foo bar) 期间,我收到以下错误:
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-cli,您可以阻止它尝试保存快照:
config set stop-writes-on-bgsave-error no这是一个快速的解决方法,但如果关心使用它的数据,应该首先检查以确定 bgsave 失败的原因。因为有可能会出现以下案例的日志
product@app-srv01:~$ sudo tail -f /var/log/redis/redis-server.log [913] 19 Nov 10:24:07.082 * 10 changes in 300 seconds. Saving...[913] 19 Nov 10:24:07.083 * Background saving started by pid 16825[16825] 19 Nov 10:24:07.084 * DB saved on disk[16825] 19 Nov 10:24:07.084 * RDB: 4 MB of memory used by copy-on-write[913] 19 Nov 10:24:07.183 * Background saving terminated with success[913] 19 Nov 10:29:08.000 * 10 changes in 300 seconds. Saving...[913] 19 Nov 10:29:08.001 * Background saving started by pid 21391[21391] 19 Nov 10:29:08.003 * DB saved on disk[21391] 19 Nov 10:29:08.003 * RDB: 4 MB of memory used by copy-on-write[913] 19 Nov 10:29:08.101 * Background saving terminated with success这是因为写入 RDB 时,您的后台写入线程被终止:
redis-rdb-bgsave 127.0.0.1:6379(logStackTrace+0x33)[0x4468c3]redis-rdb-bgsave 127.0.0.1:6379(lzf_compress+0x3ff)[0x41ed6f]建议:运行大内存测试使用redis-server --test-memory [MB to test]
| 留言与评论(共有 0 条评论) “” |