supervisor安装配置及使用

2019-01-25  本文已影响0人  米斯特_李

sudo yum -y install supervisor

安装完后可以通过echo_supervisord_conf > /etc/supervisord.conf 生成supervisord.conf文件

supervisord -c /etc/supervisord.conf  //启动supervisor

supervisorctl //打开命令行

Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting supervisord

unlink /tmp/supervisor.sock

/etc/supervisord.conf中配置:

[include]

files = /xxx/supervisor/c2c.ini

c2c.ini 中配置

[program:c2c]

command=uwsgi3 --ini  /xxx/xxxt/xxx/uwsgi_test.ini

directory=/xxx/xxx/xxx

startsecs=1; 进程启动后跑了几秒钟,才被认定为成功启动,默认1

stopwaitsecs=0; max num secs to wait b4 SIGKILL (default 10)

autostart=true ; 是否随supervisord启动一起启动,默认true

autorestart=true; 这个是设置子进程挂掉后自动重启的情况,有三个选项,false,unexpected

                                 和true。如果为false的时候,无论什么情况下,都不会被重新启动,

                                 如果为unexpected,只有当进程的退出码不在下面的exitcodes里面定义的退 

                                 出码的时候,才会被自动重启。当为true的时候,只要子进程挂掉,将会被无

                                 条件的重启

stdout_logfile=/klb_home/supervisor/logs/c2c_out.log

redirect_stderr=true

重启

unlink /tmp/supervisor.sock

supervisord -c /etc/supervisord.conf

supervisorctl start all

上一篇 下一篇

猜你喜欢

热点阅读