2017-09-25 54 views
0

其实我正在转移到公司新生产服务器的debian 9上,并希望为它们配置合适的。到目前为止,一切正常,但现在我坚持使用redis-server。Debian Stretch上的Redis启动问题(9)

默认情况下,Debian 9自带redis 3.2版本。我正在通过apt-get install redis-server安装软件包。之后,redis在后台启动为守护进程。现在我想应用一些自定义配置,例如绑定到2个不同的IP(127.0.0.1和服务器IP)。

将此选项以及daemonize选项(至yes)更改后,redis不再愿意在后台启动。无论何时执行service redis-server start/etc/init.d/redis-server start,该命令都会执行。

journalctl -xe告诉我,那个pid文件不可读(redis-server.service: PID file /var/run/redis/redis-server.pid not readable (yet?) after start-post: No such file or directory),即使它应该创建根据的init.d脚本:

start) 
    echo -n "Starting $DESC: " 
    mkdir -p $RUNDIR 
    touch $PIDFILE 
    chown redis:redis $RUNDIR $PIDFILE 
    chmod 755 $RUNDIR 

毕竟,我可以看到,这两个service redis-server start/etc/init.d/redis-server正在启动服务器,我也可以通过redis-cli连接到服务器。但该死的过程陷入困境。

任何人都可以帮忙吗?如果您需要更多信息,请告诉我。如果这能解决问题,我会尽可能提供!

最好 克里斯

+0

这可能是[超级用户](http://superuser.com/)或[UNIX和Linux堆栈交易所(http://unix.stackexchange.com/)一个更好的问题。听起来你有配置问题,而不是编程问题。 – jww

回答

0

我有一个CentOS 7服务器上有类似的情况。

分辨率是从没有改变supervised自动

# By default Redis does not run as a daemon. Use 'yes' if you need it. 
 
# Note that Redis will write a pid file in /var/run/redis.pid when daemonized. 
 
daemonize yes 
 

 
# If you run Redis from upstart or systemd, Redis can interact with your 
 
# supervision tree. Options: 
 
# supervised no  - no supervision interaction 
 
# supervised upstart - signal upstart by putting Redis into SIGSTOP mode 
 
# supervised systemd - signal systemd by writing READY=1 to $NOTIFY_SOCKET 
 
# supervised auto - detect upstart or systemd method based on 
 
#      UPSTART_JOB or NOTIFY_SOCKET environment variables 
 
# Note: these supervision methods only signal "process is ready." 
 
#  They do not enable continuous liveness pings back to your supervisor. 
 
supervised auto

当您运行过程,守护它需要与systemd过程管理相结合(如果我阅读一些文件)。

感谢