中止BGSAVE已经在进行中

时间:2017-01-27 07:21:28

标签: database redis

我通过在redis-db中调用BGSAVE命令开始保存redis-cli快照。

它已经开始运行但我在日志中不断收到这些错误

[30853] 27 Jan 07:18:41.129 # Background saving error
[30853] 27 Jan 07:18:47.043 * 1 changes in 900 seconds. Saving...
[30853] 27 Jan 07:18:47.058 * Background saving started by pid 13204
[13204] 27 Jan 07:18:47.058 # Failed opening .rdb for saving: Permission denied
[30853] 27 Jan 07:18:47.158 # Background saving error
[30853] 27 Jan 07:18:53.070 * 1 changes in 900 seconds. Saving...
[30853] 27 Jan 07:18:53.085 * Background saving started by pid 13207
[13207] 27 Jan 07:18:53.085 # Failed opening .rdb for saving: Permission denied
[30853] 27 Jan 07:18:53.186 # Background saving error
[30853] 27 Jan 07:18:59.098 * 1 changes in 900 seconds. Saving...
[30853] 27 Jan 07:18:59.113 * Background saving started by pid 13210
[13210] 27 Jan 07:18:59.114 # Failed opening .rdb for saving: Permission denied
[30853] 27 Jan 07:18:59.213 # Background saving error

看起来redis BGSAVE命令无限期地运行。如何制止这一点。

我也尝试通过ps -aux| grep redis命令检查进程pid。

13196 pts/11   S+     0:00 grep --color=auto redis
30853 ?        Ssl  1292:57 /usr/bin/redis-server *:6379

没有杀人的过程。

编辑:这些是redis文件夹和dump.rdb文件的权限

f: /var/lib/redis
drwxr-xr-x root  root  /
drwxr-xr-x root  root  var
drwxr-xr-x root  root  lib
drwxr-xr-x redis redis redis

f: /var/lib/redis/dump.rdb
drwxr-xr-x root  root  /
drwxr-xr-x root  root  var
drwxr-xr-x root  root  lib
drwxr-xr-x redis redis redis
-rw-rw-rw- redis redis dump.rdb

EDIT2:得到了答案。问题是以某种方式改变了配置参数。 dbfilenamedir值已更改。

通过CONFIG SET命令将这些值设置为原始值,现在它正常工作。添加以防有人有同样的问题。

但问题是他们是如何改变的。这是否发生在其他人身上?

帮帮我

由于

1 个答案:

答案 0 :(得分:0)

您可以尝试修复文件权限错误(默认保存位置是否存在,redis是否有权写入?)或者您可以使用以下命令禁用保存:

config set save ""