实际上,我正在为公司的新生产服务器切换到debian 9的路上,并希望为他们提供ansible。到目前为止,一切都很好,但现在我只能使用redis服务器了。
默认情况下,Debian 9附带了redis版本3.2。我正在通过apt-get install redis-server安装软件包。之后,redis在后台作为守护进程启动。现在,我想应用一些自定义配置,比如绑定到两个不同的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连接到服务器。但这该死的过程很艰难。
有人能帮忙吗?如果你需要更多的信息,就告诉我。我会提供任何可能的,如果这解决了问题!
最佳克里斯
发布于 2017-09-26 16:57:56
在Centos 7服务器上,我也遇到过类似的情况。
解决方案是将supervised从no改为auto
# 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进行交互以进行流程管理(如果我阅读了一些文档的话)。
谢谢
https://stackoverflow.com/questions/46407019
复制相似问题