2017-09-25 97 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過程管理相結合(如果我閱讀一些文件)。

感謝