Centos7 使用 supervisor 管理进程
一、安装
//直接使用pip安装(pip的安装 http://www.cnblogs.com/yxhblogs/p/8971251.html)
pip install supervisor
二、配置
//运行echo_supervisord_conf 命令重定向到一个配置文件
echo_supervisord_conf > /etc/supervisord.conf
三、修改配置文件
//创建一个目录
mkdir /etc/supervisor.d
//把/etc/supervisord.conf 里 include 部分的的配置修改一下,改为如下:
[include]
files = /etc/supervisor.d/*.conf
四、program 配置
[root@localhost supervisord.d]# cat test.conf
;[program:theprogramname]
;command=/bin/cat ; the program (relative uses PATH, can take args) //启动命令,与手动在命令行启动的命令是一样的
;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
;numprocs=1 ; number of processes copies to start (def 1)
;directory=/var/tmp ; directory to cwd to before exec (def no cwd) //程序的启动目录
;umask=022 ; umask for process (default None)
;priority=999 ; the relative start priority (default 999)
;autostart=true ; start at supervisord start (default: true) //在 supervisord 启动的时候也自动启动
;startsecs=1 ; # of secs prog must stay up to be running (def. 1) //启动 1 秒后没有异常退出,就当作已经正常启动了
;startretries=3 ; max # of serial start failures when starting (default 3) //启动失败自动重试次数,默认是 3
;autorestart=unexpected ; when to restart if exited after running (def: unexpected)
;exitcodes=0,2 ; 'expected' exit codes used with autorestart (default 0,2)
;stopsignal=QUIT ; signal used to kill process (default TERM)
;stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)
;stopasgroup=false ; send stop signal to the UNIX process group (default false)
;killasgroup=false ; SIGKILL the UNIX process group (def false)
;user=chrism ; setuid to this UNIX account to run the program //用哪个用户启动
;redirect_stderr=true ; redirect proc stderr to stdout (default false) //把 stderr 重定向到 stdout,默认 false
;stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO
;stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB) //stdout 日志文件大小,默认 50MB
;stdout_logfile_backups=10 ; # of stdout logfile backups (0 means none, default 10) //stdout 日志文件备份数 , 默认10
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)
;stdout_events_enabled=false ; emit events on stdout writes (default false)
;stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO
;stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
;stderr_logfile_backups=10 ; # of stderr logfile backups (0 means none, default 10)
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)
;stderr_events_enabled=false ; emit events on stderr writes (default false)
;environment=A="1",B="2" ; process environment additions (def no adds)
;serverurl=AUTO ; override serverurl computation (childutils)
更详细配置请参考:https://blog.csdn.net/chenyulancn/article/details/52789565
五、启动
//启动supervisor
supervisord -c /etc/supervisord.conf
Centos7 使用 supervisor 管理进程的更多相关文章
- supervisor管理进程 superlance对进程状态报警
supervisor介绍 首先,介绍一下supervisor.Supervisor(http://supervisord.org/)是用Python开发的一个client/server服务,是Linu ...
- Supervisor管理进程
Supervisor管理进程 转载 2016年04月14日 18:26:45 标签: supervisord 28344 Supervisor重新加载配置启动新的进程 liaojie 发布于 1年前, ...
- Supervisor 管理进程,Cloud Insight 监控进程,完美!
Supervisor 是由 Python 语言编写.基于 linux 操作系统的一款服务器管理工具,用于监控服务器的运行,发现问题能立即自动预警及自动重启等. Cloud Insight 是一款次世代 ...
- Centos7 使用 Supervisor 守护进程 Celery
一.Supervisor 安装(centos7 还有另一个进程守护命令 Systemd ) Centos 7 安装 Supervisord 二.Supervisor 守护进程 Centos7 使用 S ...
- Linux服务:使用Supervisor管理进程
一.简介 由于基本每个公司都会用到supervisor这个进程管理工具,这里简单阐述一下. Supervisor (http://supervisord.org) 是一个用Python写Linux下的 ...
- CentOS7 安装supervisor守护进程管理器
supervisor没有发布在标准的CentOS源在,需要安装epel源.这种方式安装的可能不是最新版本,但比较方便,安装完成之后,配置文件会自动帮你生成. 默认配置文件:/etc/superviso ...
- Django与supervisor 管理进程
1.前言 在Django项目中,我们需要用到一些独立于Django框架外的脚本.这样一些脚本可能需要独立的持续运行,且具有很强的可维护性,这个时候supervisor就可以排上用场了. 基于pytho ...
- supervisor管理进程工具配置
Supervisor(http://supervisord.org/)是用Python开发的一个client/server服务,是Linux/Unix系统下的一个进程管理工具,不支持Windows系统 ...
- 在Docker里使用(支持镜像继承的)supervisor管理进程(转)
这篇文章是受 dockboard 之托帮忙翻译的与 docker 有关的技术文章.译自 Using Supervisor with Docker to manage processes (suppor ...
随机推荐
- ICMP控制报文协议
1.引言 ICMP经常被认为是IP层的一个组成部分.它传递差错以及其他需要注意的信息.ICMP报文通常被IP层或更高层 协议(TCP或UDP)使用.一些ICMP报文把差错报文返回给用户进程.ICMP报 ...
- 基于live555实现的RTSPServer对底层进行性能优化的方法
在博客<EasyIPCamera高性能摄像机RTSP服务器RTSPServer解决方案>我介绍了基于live555实现的一套RTSPServer功能组件,当时开发者经过几个月的调试,已经将 ...
- 九度OJ 1038:Sum of Factorials(阶乘的和) (DP、递归)
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:1845 解决:780 题目描述: John von Neumann, b. Dec. 28, 1903, d. Feb. 8, 1957, ...
- The Log-Structured Merge-Tree (LSM-Tree
https://www.cs.umb.edu/~poneil/lsmtree.pdf [Log-Structured Merge-Tree ][结构化日志归并树][要解决的问题]The Log-S ...
- Magnetic Fingerprinting Approach to Indoor Localization
Magnetic Fingerprinting Approach to Indoor Localization
- Grunt学习笔记【5】---- expand使用方法
本文主要讲expand使用方法. 当你希望处理大量的单个文件时,这里有一些附加的属性可以用来动态的构建一个文件列表.这些属性都可以用于 Compact 和 Files Array 文件映射格式. ex ...
- 安装postgresql碰到Unable to write inside TEMP environment path
搞了半天,原来是 AVAST搞的鬼,把原来注册表的键值改成它自己了.其实应该是 C:\Windows\System32\vbscript.dll The answer in the following ...
- Data Structure Binary Search Tree: Inorder Successor in Binary Search Tree
struct node { int val; node *left; node *right; node *parent; node() : val(), left(NULL), right(NULL ...
- Matlab的publish功能和cell功能
Matlab的publish功能能够让写的代码变成优美的文档.类似为知笔记的markdown语言. cell功能配合publish使用,可以形成不同的功能块.而且调试的时候,可以按section调试. ...
- 常用JS组件整理
1.漂亮的弹出层----artDialog http://aui.github.io/artDialog/ 2.弹出层 ------layer http://sentsin.com/jquery/la ...