事件:
接到同事保障,redis挂了,使用 ping 时报 (error) MISCONF … 错误。
处理过程:
登录系统确认问题
[root@redis01 ~]# redis-cli
127.0.0.1:6379> ping
(error) 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.
127.0.0.1:6379> exit
查看日志,按照网上办法
请在/etc/sysctl.conf 添加一项 ‘vm.overcommit_memory = 1’ ,然后重启(或者运行命令’sysctl vm.overcommit_memory=1’ )使其生效。
查看 vm.overcommit_memory 设置,发现原配置已。重启redis后,redis正常启动并加载数据到内存。
[root@redis01 ~]# redis-cli
127.0.0.1:6379> ping
PONG
127.0.0.1:6379> info
但几分钟后,redis 再次重现同样错误。
查看进程、内存和磁盘使用情况
[root@redis01 ~]# free -m
total used free shared buffers cached
Mem: