169.supervisor配置

发表于 linux 分类,标签:
1.安装客户端
yum install epel-release
yum install -y supervisor

2.创建supervisor工作目录
rm -rf supervisord.d/
rm -rf supervisord.conf
mkdir /etc/supervisor
mkdir /etc/supervisor/conf.d

3.生成配置文件
echo_supervisord_conf > /etc/supervisor/supervisord.conf

4.替换supervisord.conf配置文件
................
[inet_http_server] ; inet (TCP) server disabled by default
port=0.0.0.0:9001  ; ip_address:port specifier, *:port for all iface
username=admin    ; default is no username (open server)
password=aytxtt589 ; default is no password (open server)
...............
[include]
files = conf.d/*.conf

5.运行实例
ps:见阿里云盘包

6.开机启动
vim /usr/lib/systemd/system/supervisord.service
[Unit]
Description=Process Monitoring and Control Daemon
After=rc-local.service nss-user-lookup.target
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
ExecReload=/usr/bin/supervisorctl reload
ExecStop=/usr/bin/supervisorctl shutdown
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable supervisord
systemctl start supervisord

设置755权限
chmod 755 /usr/lib/systemd/system/supervisord.service

7.通过shell来管理supervisor
supervisorctl start appname #启动特定程序
supervisorctl stop appname #停止特定程序
supervisorctl restart appname #重启特定程序
supervisorctl start all #启动所有程序
supervisorctl stop all #停止所有程序
supervisorctl restart all #重启所有程序
supervisorctl status #查看所有进程的状态
supervisorctl update #配置文件修改后使用该命令加载新的配置
supervisorctl reload #重新启动配置中的所有程序
supervisorctl tail redis

8.配置cesi
ps:见阿里云盘文档


0 篇评论

发表我的评论