Redis自发地失败了:“失败打开.rdb保存:权限被拒绝”

我在Rackspace Cloud Server的Ubuntu 14.04上运行redis-server(版本2.8.4)。 redis服务器进程正在由redis用户运行。

今天早上,Redis服务器自发地失败了“打开.rdb进行保存”。 这个过程发生了20多天没有发生。

正如你可以从下面的日志中看到的那样,Redis正常运行,然后在UTC时间上午8:08开始失败。 稍后closures服务器电源解决了问题。

[26083] 31 Aug 07:54:47.089 * RDB: 2 MB of memory used by copy-on-write [17183] 31 Aug 07:54:47.186 * Background saving terminated with success [17183] 31 Aug 07:59:48.028 * 10 changes in 300 seconds. Saving... [17183] 31 Aug 07:59:48.029 * Background saving started by pid 26653 [26653] 31 Aug 07:59:48.032 * DB saved on disk [26653] 31 Aug 07:59:48.032 * RDB: 2 MB of memory used by copy-on-write [17183] 31 Aug 07:59:48.129 * Background saving terminated with success [17183] 31 Aug 08:04:49.061 * 10 changes in 300 seconds. Saving... [17183] 31 Aug 08:04:49.061 * Background saving started by pid 27197 [27197] 31 Aug 08:04:49.064 * DB saved on disk [27197] 31 Aug 08:04:49.065 * RDB: 2 MB of memory used by copy-on-write [17183] 31 Aug 08:04:49.162 * Background saving terminated with success [17183] 31 Aug 08:07:56.881 * DB saved on disk [17183] 31 Aug 08:08:05.880 # Failed opening .rdb for saving: Permission denied [17183] 31 Aug 08:12:57.047 * 10 changes in 300 seconds. Saving... [17183] 31 Aug 08:12:57.047 * Background saving started by pid 28087 [28087] 31 Aug 08:12:57.048 # Failed opening .rdb for saving: Permission denied [17183] 31 Aug 08:12:57.148 # Background saving error [17183] 31 Aug 08:13:03.068 * 10 changes in 300 seconds. Saving... [17183] 31 Aug 08:13:03.069 * Background saving started by pid 28088 [28088] 31 Aug 08:13:03.070 # Failed opening .rdb for saving: Permission denied [17183] 31 Aug 08:13:03.169 # Background saving error [17183] 31 Aug 08:13:09.087 * 10 changes in 300 seconds. Saving... [17183] 31 Aug 08:13:09.087 * Background saving started by pid 28089 [28089] 31 Aug 08:13:09.088 # Failed opening .rdb for saving: Permission denied (... continues like this until server restart) 

所以,我的问题:这怎么可能发生?

我很难过,但这里是我模糊的预感:

  • 内存使用率太高(我只运行一个512MB的实例,Redis警告我在/etc/sysctl.conf中设置'vm.overcommit_memory = 1')
  • Redis在连续运行20天后遇到了某种内部限制(所以这会在另外的20天内再次发生)。
  • Rackspace在上午8点(美国东部时间凌晨4点)做了一些事情,这会影响我的服务器。

运行redis-cli并查看CONFIG GET dbfilenameCONFIG GET dir的输出

我有一种感觉可能已经改变了。 值应该是dump.rdb ,分别是/var/lib/redis

如果他们改变了,有人会损害你的redis服务器。 如果是这样,请检查您的redis服务是否对公众开放。 您不能从外部IP连接到它。