问题来源:在删除var目录下的log文件时,将redis文件夹删除了。然后在重启时:/etc/init.d/redis-server start,提示:
Starting redis-server:
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file,at line 94
>>> 'logfile /var/log/redis/redis-server.log'
Can't open the log file: No such file or directory
Starting redis-server:
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file,at line 94
>>> 'logfile /var/log/redis/redis-server.log'
Can't open the log file: Permission denied
Failed
*** FATAL CONFIG FILE ERROR ***
Reading the configuration file,at line 94
>>> 'logfile /var/log/redis/redis-server.log'
Can't open the log file: Permission denied
Failed
查了一下,最终发现有可能是权限不够的问题,于是,ls -l /var/log/redis/redis-server.log
提示:-rw-r--r-- 1 root root 0 6月 2 10:05 /var/log/redis/redis-server.log。如下图所示:
解决办法:
chmod 777 /var/log/redis/redis-server.log