1.yum安装python依赖包
输入命令 yum install python-setuptools
2.yum安装Supervisor
输入命令easy_install supervisor
3.配置Supervisor
(1)在etc下创建目录,并赋予权限
输入命令 mkdir -m 700 -p /etc/supervisor
(2)在目录“/etc/supervisor“ 创建配置文件
输入命令 echo_supervisord_conf > /etc/supervisor/supervisord.conf
(3)修改配置文件
输入命令 vim /etc/supervisor/supervisord.conf
(4)在目录“/etc/supervisor”下创建.NET Core 进程配置文件目录
输入命令 mkdir -m 700 /etc/supervisor/conf.d
(6)创建Supervisor自启动服务
输入命令 vim /etc/systemd/system/supervisor.service
在文件末尾添加以下代码(注意:首尾需无空格,需顶格)
[Unit]
Description=supervisor
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
ExecStop=/usr/bin/supervisorctl shutdown
ExecReload=/usr/bin/supervisorctl reload
KillMode=process
Restart=on-failure
RestartSec=42s
[Install]
WantedBy=multi-user.target
(7)使配置生效
输入命令 systemctl daemon-reload
(8)设置开机自启动
输入命令 systemctl enable supervisor.service
(9)启动服务
输入命令 systemctl start supervisor.service
(10)验证DONET进程是否启动
输入命令 ps -ef|grep donet
(11)Supervisor远程管理
输入命令 vim /etc/supervisor/supervisord.conf
[inet_http_server] ; inet (TCP) server disabled by default
port=192.168.1.223:9001 ; ip_address:port specifier, *:port for all iface
username=user ; default is no username (open server)
password=123 ; default is no password (open server)
(12)重启服务
输入命令
停止 systemctl stop supervisor.service
开启 systemctl start supervisor.service