lua连接redis报错

1.系统内存不足引起的报错

failed to set: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.

解决方法在这里:

https://blog.csdn.net/xc_zhou/article/details/80893326?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.nonecase

  1. 在/etc/sysctl.conf 添加一项
vm.overcommit_memory = 1
  1. 使其生效
sysctl vm.overcommit_memory=1
  1. 重启redis

备注:

https://stackoverflow.com/questions/19581059/misconf-redis-is-configured-to-save-rdb-snapshots

2.因为系统被攻击导致的报错

我用自己的云服务器做redis测试而不是虚拟机。
由于设置了redis远程访问,但是没设置密码,而导致其他人的攻击而报错。

Failed opening the RDB file dump.rdb (in server root dir /var/spool/cron) for saving: Permission denied

不设置远程连接可以不用在意。
解决办法,给redis设置密码。

参考文档:
https://zhuanlan.zhihu.com/p/28745465

https://stackoverflow.com/questions/41887280/redis-config-dir-periodically-modified-to-var-spool-cron-with-failed-opening

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值