Ubuntu 安装和使用 Supervisor(进程管理)
服务器版本 Ubuntu 16.04 LTS。
Supervisor 是一个用 Python 写的进程管理工具,可以很方便的对进程进行启动、停止、重启等操作。
安装命令:
$ apt-get install supervisor
安装成功后,会在/etc/supervisor
目录下,生成supervisord.conf
配置文件。
你也可以使用echo_supervisord_conf > supervisord.conf
命令,生成默认的配置文件(不建议,内容比较多)。
supervisord.conf
示例配置:
; supervisor config file
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
; The [include] section can just contain the "files" setting. This
; setting can list multiple files (separated by whitespace or
; newlines). It can also contain wildcards. The filenames are
; interpreted as relative to this file. Included files *cannot*
; include files themselves.
[include]
files = /etc/supervisor/conf.d/*.conf
进程配置会读取/etc/supervisor/conf.d
目录下的*.conf
配置文件,我们在此目录下创建一个hwapp.conf
进程配置文件:
[program:hwapp]
directory=/root/wwwroot/hwapp/publish
command=dotnet hwapp.dll
autostart=true
autorestart=true
startretries=10
redirect_stderr=true
stdout_logfile=/root/wwwroot/hwapp/hwapp.log
environment=ASPNETCORE_ENVIRONMENT="Development"
需要注意的是,如果不是 在接触supervisor进程管理工具之前,使用springboot打包部署到linux服务器的流程是这样子的,如下图所示: 上图展示的就是最一般的流程,如果项目是小项目或者demo可以这样子去部署, ... Supervisor进程管理 在后台应用中,有时候程序进程会异常中止退出,如果没有一个守护进程去守护这个应用进程我们就需要及时发现并重启进程.如果每一个应用进程都写一个自己的守护进程难免会比较麻烦,而 ... SUPERVISOR进程管理器配置指南1. supervisor简介1.1. 官网http://supervisord.org/ 1.2. 介绍Supervisor是一个进程控制系统. 它是一个C/S ... 简介: Supervisor 进程管理工具 一.安装 shell > yum -y install python-pip shell > pip install supervisor # ... 介绍 Supervisor是用Python开发的一套通用的进程管理程序,能将一个普通的命令行进程变为后台daemon,并监控进程状态,异常退出时能自动重启.它是通过fork/exec的方式把这些被管理 ... 这几天在用supervisor管理爬虫和Flask, 每次都记不住命令,花点时间记录下. supervisor是一个进程管理工具,用来启动.停止.重启和监测进程.我用这个东西主要用来监测爬虫和Flas ... Supervisor 一个python写的进程管理工具,用来启动.关闭.重启进程,可以同时控制多个进程. 安装: pip install supervisor 配置: 通过配置文件来满足自己的需求 配 ... supervisor是一款进程管理工具,当想让应用随着开机启动,或者在应用崩溃之后自启动的时候,supervisor就派上了用场. 广泛应用于服务器中,用于引导控制程序的启动 安装好superviso ... 一.Supervisor简单介绍supervisor是一个 Client/Server模式的系统,允许用户在类unix操作系统上监视和控制多个进程,或者可以说是多个程序.supervisor与laun ... 题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1253 全为红边的情况下,ans=C(n,3).假设被黑边相连 ... 背景 客户无大企业证书,只有开发者证书,如果进行开发分发测试只能采用两种方式 testfight ad-hoc打包 上testfight存在一定的审核时间,排除掉,最后选择打ad-hoc的包 解决 查 ... 1.mybatis_generator自动生成代码demo github项目地址:https://github.com/JsonShare/mybatis_generator 2.设计模式解密系列示例 ... 背景:在公司中警察需要做技术支持,查看日志,而查看日志首先要自己清楚日志是如何生成的,所以有必要知道日志的前世今生! 转载出处:http://www.cnblogs.com/godtrue/p/644 ... [前言] AI 在人工智能进展的如火如荼的今天,我们如果不尝试去接触新鲜事物,马上就要被世界淘汰啦~ 本文拟使用Python开发语言实现类似于WIndows平台的“小娜”,或者是IOS下的“Siri” ... 背景 近期,公司网络要迁移到新的网段,所以原来在服务器上面搭建的docker swarm需要重新构建... 拿到新的服务器地址看了一下,“10.xxx.xxx.xxx" ... 纳尼,这IP ... 说明: 本文参考官方Ref Guide,Developer API和众多博客,并结合实测代码编写,详细总结HBase的Filter功能,并附上每类Filter的相应代码实现. 本文尽量遵从Ref Gu ... 这几天一直在学习开发Rss阅读器,遇到一个很坑的问题,InputSource这里总是出错.弄了好久,终于让我找到一个解决方法----看代码: new Thread(){ @Override publi ... 简介 迭代器是遍历容器的一种常用方法,它屏蔽了容器的实现细节,无需暴露数据结构内部,就可以对容器进行遍历,迭代器本身也是一种设计模式,迭代是一种特殊的遍历方式 Iterator 在java中,迭代器接 ... Angular4.0基础知识之组件 Angular4.0基础知识之路由 Angular4.0依赖注入 数据绑定 数据绑定允许你将组件控制器的属性和方法与组件的模板连接起来,大大降低了开发时的编码量. ...root
账号,需要对这些目录进行权限设置,要不然会报一些错误(一定要在 root 账号下进行配置,要不然一系列权限引起的问题
Ubuntu 安装和使用 Supervisor(进程管理)的更多相关文章
随机推荐