0

我使用安装了redis

sudo apt-get -y install redis-server 

默认数据目录是/var/lib/redis/,但是当我在文件:sudo gedit /etc/redis/redis.conf中切换到另一个目录/some path/redisDB时,我无法再次启动redis服务器。我收到一个错误

Job for redis-server.service failed because the control process exited with error code. See "systemctl status redis-server.service" and "journalctl -xe" for details.

systemctl status redis-server.service
 redis-server.service - Advanced key-value store
 Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; 
 vendor preset: enabled)
 Active: inactive (dead) (Result: exit-code) since Do 2018-06-14 17:29:03 CEST; 8s ago
 Docs: http://redis.io/documentation,
       man:redis-server(1)
 Process: 18601 ExecStopPost=/bin/run-parts --verbose /etc/redis/redis-server.post-down.d (code=exited, status=0/SUCCESS)
 Process: 18597 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
 Process: 18594 ExecStop=/bin/run-parts --verbose /etc/redis/redis-server.pre-down.d (code=exited, status=0/SUCCESS)
 Process: 18730 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=1/FAILURE)
Process: 18727 ExecStartPre=/bin/run-parts --verbose /etc/redis/redis-server.pre-up.d (code=exited, status=0/SUCCESS)
Main PID: 18000 (code=exited, status=0/SUCCESS)

Jun 14 17:29:03 gaurav-GB-BSi3-6100 systemd[1]: Failed to start Advanced key-value store.
Jun 14 17:29:03 gaurav-GB-BSi3-6100 systemd[1]: redis-server.service: Unit entered failed state.
Jun 14 17:29:03 gaurav-GB-BSi3-6100 systemd[1]: redis-server.service: Failed with result 'exit-code'.
Jun 14 17:29:03 gaurav-GB-BSi3-6100 systemd[1]: redis-server.service: Service hold-off time over, scheduling restart.
Jun 14 17:29:03 gaurav-GB-BSi3-6100 systemd[1]: Stopped Advanced key-value store.
Jun 14 17:29:03 gaurav-GB-BSi3-6100 systemd[1]: redis-server.service: Start request repeated too quickly.
Jun 14 17:29:03 gaurav-GB-BSi3-6100 systemd[1]: Failed to start Advanced key-value store.
4

1 回答 1

0

您引用的路径不存在或启动redis的用户对其没有写权限。

于 2018-06-15T09:48:57.217 回答