我有一个nodeBB安装,它依赖Redis作为数据存储.它只是一个测试安装,而我解决任何问题. 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
使用following method使用以下说明(默认的yum包太旧)使用following method在Centos 6.7上以root身份安装Redis:
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将其置于许可模式.
原文链接:https://www.f2er.com/centos/373498.html之后再次检查您的系统,我猜错误将消失,检查安全日志以查看SELinux阻止了什么,在您的策略中启用它并将SELinux重新置于强制模式(当然,如果您想让您的服务器受到保护)作者:SELinux)