Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands th

6 篇文章 0 订阅
1 篇文章 0 订阅

Redis故障

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.; nested exception is redis.clients.jedis.exceptions.JedisDataException: 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 erro

有道翻译

Redis被配置为保存RDB快照,但目前无法持久化到磁盘上。可能修改数据集的命令被禁用。请检查Redis日志的详细错误。Redis被配置为保存RDB快照,但目前不能持久化到磁盘上。可能修改数据集的命令被禁用。请检查Redis日志的详细错误

查看redis的日志文件

如果不知道日志文件在哪里,在redis.conf文件中查看配置

whereis redis.conf

配置文件中包含大量注释,过滤掉注释查看内容(找到文件当前目录)

grep -v "^#" redis.conf | more

我的路径是:logfile /var/log/redis/redis.log

查看日志内容

Can't save in background: fork: Cannot allocate memory

重启后会报警告

WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. 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
内存不足解决办法

允许overcommit

编辑文件:/etc/sysctl.conf,增加一行

vm.overcommit_memory=1
执行命令,完美解决
sysctl -p

redis启动时其它警告

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 511 > /proc/sys/net/core/somaxconn
  1. 一劳永逸,编辑文件:/etc/sysctl.conf,增加一行
net.core.somaxconn= 1024
执行命令,完美解决
sysctl -p
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

失忆老幺

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值