Monit无法正常启动redis-server。
init.d
运行Redis正常工作:$ sudo su
$ /etc/init.d/redis_6379 start
$ #=> Starting Redis server...
$ ps aux | grep redis
$ #=> root 8980 0.0 0.0 42128 1964 ? Ssl 04:56 0:00 /etc/redis/src/redis-server *:6379
$ /etc/init.d/redis_6379 stop
$ #=> Stopping ...
$ #=> Redis stopped
$ #=> (ps aux| grep redis) There's no redis process.
Monit
运行Redis无法正常运行:(我杀死了Redis进程和rm /var/run/redis_6379.pid
)
$ sudo su
$ monit start redis
$ ps aux | grep redis
$ #=> root 9082 0.0 0.0 35076 1972 ? Ssl 05:08 0:00 /etc/redis/src/redis-server *:6379
monit.log:
[MSK Jan 6 05:08:14] info : 'redis' start on user request
[MSK Jan 6 05:08:14] info : monit daemon at 3947 awakened
[MSK Jan 6 05:08:14] info : Awakened by User defined signal 1
[MSK Jan 6 05:08:14] info : 'redis' start: /etc/init.d/redis_6379
[MSK Jan 6 05:08:44] error : 'redis' failed to start
[MSK Jan 6 05:08:44] info : 'redis' start action done
$ ps aux | grep redis
$ #=> root 9018 0.0 0.0 35076 1968 ? Ssl 05:02 0:00 /etc/redis/src/redis-server *:6379
$ monit stop redis
$ ps aux | grep redis
$ #=> root 9082 0.0 0.0 35076 1972 ? Ssl 05:08 0:00 /etc/redis/src/redis-server *:6379
monit.log
[MSK Jan 6 05:10:02] info : 'redis' stop on user request
[MSK Jan 6 05:10:02] info : monit daemon at 3947 awakened
[MSK Jan 6 05:10:02] info : Awakened by User defined signal 1
[MSK Jan 6 05:10:02] info : 'redis' stop action done
答案 0 :(得分:2)
我遇到了同样的问题,并且没有关于这种情况的讨论。我用另一个解决方案修复了它,它可能与其他人有关,所以我在这里发布它。
在monit配置文件中我有
start program = "/etc/init.d/redis start"
stop program = "/etc/init.d/redis stop"
通过以下方式替换修复了问题(使用Ubuntu)
start program = "/usr/sbin/service redis start"
stop program = "/usr/sbin/service redis stop"
答案 1 :(得分:0)
只需更改/etc/redis dir
$ chown -R root /etc/redis
并重启monit
$ monit restart
问题已经消失。奇怪。我希望它有所帮助。