supervisor 配置篇

1,配置管理進程html

進程管理配置參數,不建議全都寫在supervisord.conf文件中,應該每一個進程寫一個配置文件放在include指定的目錄下包含進supervisord.conf文件中。 
1> 建立/etc/supervisor/目錄,用於存放進程管理的配置文件 
2> 修改/etc/supervisord.conf中的include參數,將/etc/supervisor/目錄添加到include中redis

[include] files = /etc/supervisor/*.ini

 

在 /etc/supervisor/ 目錄下創建 redis.ini 文件ui

[program:redis] command=/data/redis/src/redis-server /data/redis/redis.conf autorstart=true autorestart=true stdout_logfile=/tmp/supervisor.log

 

2.重啓supervisorspa

[root@kafka60 supervisor]# supervisorctl status
[root@kafka60 supervisor]# supervisorctl reload
Restarted supervisord
[root@kafka60 supervisor]# supervisorctl status
redis                            BACKOFF   Exited too quickly (process log may have details)

 

3,子進程管理(supervisorctl)
rest

1) 查看全部子進程的狀態: code

# supervisorctl status
blog                             RUNNING    pid 2395, uptime 0:08:41
zhoujy                           RUNNING    pid 2396, uptime 0:08:41

2)關閉、開啓指定的子進程:server

# supervisorctl stop Redis
zhoujy: stopped

# supervisorctl start Redis
zhoujy: started

3)關閉、開啓全部的子進程:htm

# supervisorctl stop all
blog: stopped
zhoujy: stopped
# supervisorctl start all
blog: started
zhoujy: started

4):其餘參數:supervisor開啓後子進程自動開啓(autostart=true)和子進程退出後自動啓動(autorestart=tureblog

相關文章
相關標籤/搜索