supervisor(进程管理)

1.安装程序

yum -y install supervisor

2.路径文件

/etc/supervisord.d

/etc/supervisord.conf

3.生成配置.

echo_supervisord_conf > /etc/supervisord.conf

4.更改配置项

vim  /etc/supervisord.conf

#界面进程管理

[inet_http_server] 
port=192.168.182.187:9001 ; ip_address:port specifier, *:port for all iface
username=user ; default is no username (open server)
password=123

#默认进程开启路径

[include]
files = relative/directory/*.ini

5.测试任务.在配置文件添加如下脚本,

 [program:es]
command=bash /etc/supervisord.d/echo.sh

[]program:haha]
command=bash /root/haha.sh

6.开启服务,测试服务

supervisorctl 进入交互式shell.help查看相关命令

supervisorctl -c /etc/supervisord.conf

ss -nutlp | grep supervisord #会开启一个界面管理

 

[root@localhost ~]# supervisorctl
es EXITED Dec 24 10:31 AM
haha EXITED Dec 24 10:31 AM

vv

 

posted @ 2020-12-24 10:35  升级打怪之路  阅读(222)  评论(0编辑  收藏  举报