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

你可能感兴趣的:(异常记录)