我有一个nodeBB安装,它依靠Redis作为数据存储。 它只是一个testing安装在我解决任何问题的时刻。 Redis实例保持了几天,但随后在日志中出现以下错误:
3693:C 01 Dec 03:34:22.056 # Error moving temp DB file on the final destination: Operation not permitted 7089:M 01 Dec 03:34:22.155 # Background saving error 7089:M 01 Dec 03:34:28.067 * 1 changes in 900 seconds. Saving... 7089:M 01 Dec 03:34:28.068 * Background saving started by pid 3699 3699:C 01 Dec 03:34:28.069 # Error moving temp DB file on the final destination: Operation not permitted 7089:M 01 Dec 03:34:28.168 # Background saving error 7089:M 01 Dec 03:34:34.080 * 1 changes in 900 seconds. Saving... 7089:M 01 Dec 03:34:34.081 * Background saving started by pid 3700 3700:C 01 Dec 03:34:34.083 # Error moving temp DB file on the final destination: Operation not permitted 7089:M 01 Dec 03:34:34.181 # Background saving error
Redis作为root用户安装在Centos 6.7上,使用以下方法(默认的yum包太旧)使用以下方法 :
tar xzf redis-3.0.x.tar.gz cd redis-3.0.1 make make test make install cd utils chmod +x install_server.sh ./install_server.sh
工作目录在/etc/redis/6379.conf设置:
# The filename where to dump the DB dbfilename dump.rdb # The working directory. # # The DB will be written inside this directory, with the filename specified # above using the 'dbfilename' configuration directive. # # The Append Only File will also be created inside this directory. # # Note that you must specify a directory here, not a file name. dir /var/lib/redis/6379
任何人都可以提出什么会导致这一点,以及如何最好地解决这个问题? Redis将在哪里尝试并保存临时文件,哪个用户可以使用,哪些权限可以安全地解决这个问题?
另外感兴趣的是一个监视Redis实例的免费方法,所以我知道它是否/何时崩溃。
6359.conf:
daemonize yes pidfile /var/run/redis_6379.pid port 6379 tcp-backlog 511 timeout 0 tcp-keepalive 0 loglevel notice logfile /var/log/redis_6379.log databases 16 save 900 1 save 300 10 save 60 10000 stop-writes-on-bgsave-error yes rdbcompression yes rdbchecksum yes dbfilename dump.rdb dir /var/lib/redis/6379 slave-serve-stale-data yes slave-read-only yes repl-diskless-sync no repl-diskless-sync-delay 5 repl-disable-tcp-nodelay no slave-priority 100 appendonly no appendfilename "appendonly.aof" appendfsync everysec no-appendfsync-on-rewrite no auto-aof-rewrite-percentage 100 auto-aof-rewrite-min-size 64mb aof-load-truncated yes lua-time-limit 5000 slowlog-log-slower-than 10000 slowlog-max-len 128 latency-monitor-threshold 0 notify-keyspace-events "" hash-max-ziplist-entries 512 hash-max-ziplist-value 64 list-max-ziplist-entries 512 list-max-ziplist-value 64 set-max-intset-entries 512 zset-max-ziplist-entries 128 zset-max-ziplist-value 64 hll-sparse-max-bytes 3000 activerehashing yes client-output-buffer-limit normal 0 0 0 client-output-buffer-limit slave 256mb 64mb 60 client-output-buffer-limit pubsub 32mb 8mb 60 hz 10
检查你是否用sestatus启用了SELinux。 如果启用(推荐的东西),请通过setenforce 0将其置于宽容模式。
之后再次检查你的系统,我猜这个错误会消失,检查安全日志,看看SELinux阻塞了什么,在你的策略中启用它,并把SELinux恢复到强制模式(当然,如果你想让你的服务器安全由SELinux)
OP目前还不清楚在错误发生之前,后台保存是否成功,但是我发现这个与磁盘空间问题相关的错误 – 在说明显而易见的情况下,如果空间不足,请检查df 。
重要信息 – 您所附带的conf指出您的服务器没有使用密码validation( requirepass指令),不会重命名pipe理命令,也不会绑定到特定的接口( bind指令)。 这是一个潜在的安全风险 – 更多在http://antirez.com/news/96 。