1.yum安装python依赖包 输入命令 yum install python-setuptools2.yum安装Supervisor 输入命令easy_install supervisor3.配置Supervisor(1)在etc下创建目录,并赋予权限输入命令 mkdir -m 700 -p /etc/su...
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
本文标题为:Linux与.Net Core(十) Supervisor进程守护安装
基础教程推荐
- unity实现动态排行榜 2023-04-27
- C# List实现行转列的通用方案 2022-11-02
- 一个读写csv文件的C#类 2022-11-06
- C#控制台实现飞行棋小游戏 2023-04-22
- ZooKeeper的安装及部署教程 2023-01-22
- winform把Office转成PDF文件 2023-06-14
- C#类和结构详解 2023-05-30
- linux – 如何在Debian Jessie中安装dotnet core sdk 2023-09-26
- C# windows语音识别与朗读实例 2023-04-27
- C# 调用WebService的方法 2023-03-09