Linux与.Net Core(十) Supervisor进程守护安装

1.yum安装python依赖包

   输入命令  yum install python-setuptools

Linux与.Net Core(十) Supervisor进程守护安装

2.yum安装Supervisor

   输入命令easy_install supervisor

Linux与.Net Core(十) Supervisor进程守护安装

3.配置Supervisor

(1)在etc下创建目录,并赋予权限

Linux与.Net Core(十) Supervisor进程守护安装

输入命令  mkdir -m 700 -p /etc/supervisor

Linux与.Net Core(十) Supervisor进程守护安装

(2)在目录“/etc/supervisor“ 创建配置文件

Linux与.Net Core(十) Supervisor进程守护安装

输入命令 echo_supervisord_conf > /etc/supervisor/supervisord.conf

Linux与.Net Core(十) Supervisor进程守护安装

(3)修改配置文件

          输入命令   vim /etc/supervisor/supervisord.conf

Linux与.Net Core(十) Supervisor进程守护安装

(4)在目录“/etc/supervisor”下创建.NET Core 进程配置文件目录

           输入命令  mkdir -m 700 /etc/supervisor/conf.d

Linux与.Net Core(十) Supervisor进程守护安装

(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

Linux与.Net Core(十) Supervisor进程守护安装

(7)使配置生效

               输入命令  systemctl daemon-reload

Linux与.Net Core(十) Supervisor进程守护安装

(8)设置开机自启动

                输入命令  systemctl enable supervisor.service

Linux与.Net Core(十) Supervisor进程守护安装

(9)启动服务

                 输入命令   systemctl start supervisor.service

(10)验证DONET进程是否启动

      输入命令   ps -ef|grep donet

Linux与.Net Core(十) Supervisor进程守护安装

(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)

Linux与.Net Core(十) Supervisor进程守护安装

(12)重启服务

输入命令  

停止 systemctl stop supervisor.service

开启 systemctl start supervisor.service

 

 

 

 

 

 

 

 

上一篇:进程管理工具supervisor


下一篇:CentOS7 supervisord 进程管理器一些配置