我刚刚用yum安装了redis集群over3centos7VM。当试图更改日志文件路径和dir时,redis没有开始使用systemctl,输出是
Jun 18 16:53:11 v-mht-db01 redis-server[21278]: *** FATAL CONFIG FILE ERROR ***
Jun 18 16:53:11 v-mht-db01 redis-server[21278]: Reading the configuration file, at line 170
Jun 18 16:53:11 v-mht-db01 redis-server[21278]: >>> 'logfile /opt/redis.log'
Jun 18 16:53:11 v-mht-db01 redis-server[21278]: Can't open the log file: Permission denied
Jun 18 16:53:11 v-mht-db01 systemd[1]: redis.service: main process exited, code=exited, status=1/FAILURE
Jun 18 16:53:11 v-mht-db01 systemd[1]: Failed to start Redis persistent key-value database.
Jun 18 16:53:11 v-mht-db01 systemd[1]: Unit redis.service entered failed state.即使更改了conf文件路径,也会有权限被拒绝的异常,除非目录具有所有权限。
发布于 2019-06-18 15:35:45
**更改这一点可能不是一个好主意**这样做可能不会让日志旋转、管理日志文件等等。
只要修好它,快跑
touch /opt/redis.log作为root,然后刷新文件,这样运行redis服务器的用户就有了写权限。
https://serverfault.com/questions/971912
复制相似问题