centos7安装supervisor
网上大多数都是介绍源码包安装supervisor,我这边直接使用yum安装。【注】 linux环境必须安装 python
yum install supervisor #安装
systemctl enable supervisord.service #开机启动
systemctl start supervisord.service #启动
这种安装默认配置文件路径:/etc/supervisord.conf
默认进程目录:/etc/supervisord.d/
路径配置可以修改:(
[include]
files = supervisord.d/*.ini
)
设置进程,按照配置文件进程配置应该设置在/etc/supervisord.d/*.ini
查看进程:
开启web:
[inet_http_server] ; inet (TCP) server disabled by default
port=xxxx:xxx ; (ip_address:port specifier, *:port for all iface) 注意这个ip是ifconfig看到的外网ip
username=xxx ; (default is no username (open server))
password=xxx ; (default is no password (open server))
常用命令:
supervisord -c /etc/supervisor/supervisord.conf #启动supervisor
supervisorctl reload #重新启动配置中的所有程序
supervisorctl start program_name #启动某个进程(program_name=你配置中写的程序名称)
supervisorctl #查看正在守候的进程
supervisorctl restart program_name #重启某一进程 (program_name=你配置中写的程序名称)
supervisorctl stop all #停止全部进程