【Linux】类Unix 操作系统进程监控控制工具 Supervisor
Supervisor 是一个客户端服务器系统,允许用户监控和控制类 Unix 操作系统上的进程数。
官网 http://supervisord.org
安装
1. easy_install supervisor
2.
setuptools (latest) from http://pypi.python.org/pypi/setuptools.
meld3 (latest) from http://www.plope.com/software/meld3/.
elementtree (latest) from http://effbot.org/downloads#elementtree.
建立配置文件
echo_supervisord_conf > /etc/supervisord.conf
指定配置文件
supervisord -c supervisord.conf
查找配置文件路经
-c 指定配置文件
无指定配置文件时,查找顺序:
1 $CWD/supervisord.conf
2 $CWD/etc/supervisord.conf
3 /etc/supervisord.conf
配置文件说明
HTTP/XML-RPC 相关配置
[unix_http_server]
file = /tmp/supervisor.sock
chmod = 0777
chown= nobody:nogroup
username = user
password = 123
Web管理界面配置
[inet_http_server]
port = 127.0.0.1:9001
username = user
password = 123
[supervisorctl]
serverurl = unix:///tmp/supervisor.sock 和[unix_http_server]匹配
username = chris
password = 123
prompt = mysupervisor
日志 环境等配置
[supervisord]
logfile = /tmp/supervisord.log
logfile_maxbytes = 50MB
logfile_backups=10
loglevel = info
pidfile = /tmp/supervisord.pid
nodaemon = false
minfds = 1024
minprocs = 200
umask = 022
user = chrism
identifier = supervisor
directory = /tmp
nocleanup = true
childlogdir = /tmp
strip_ansi = false
environment = KEY1="value1",KEY2="value2"
配置单个进程
[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=/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)
autorestart=unexpected ; whether/when to restart (default: unexpected)
startsecs=1 ; number of secs prog must stay running (def. 1)
startretries=3 ; max # of serial start failures (default 3)
exitcodes=0,2 ; 'expected' exit codes for process (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)
stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=10 ; # of stdout logfile backups (default 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 (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)
另外配置还有
[fcgi-program:x]
[eventlistener:x]
[rpcinterface:x]
包含指定的配置文件
[include]
files = /an/absolute/filename.conf /an/absolute/*.conf foo.conf config??.conf
【Linux】类Unix 操作系统进程监控控制工具 Supervisor的更多相关文章
- monitorix(linux)系统和网络监控公工具
一.monitorix Monitorix是一款功能非常强大的免费开源轻型工具,目的在于监测Linux中的系统和网络资源.它可以定期收集系统和网络数据,并使用自己的Web界面,通过图形显示相关信息.M ...
- 进程管理工具 Supervisor
要想在终端后台常驻进程,首先想到的是在命令后加 & 符号,来达到隐藏程序在后台的目的,尽管看起来进程已经在后台运行了,实际上终端会话关闭时进程还是会被 kill 掉,这种问题一般是采用搭配 n ...
- Linux和类Unix系统上5个最佳开源备份工具
一个好的备份最基本的目的就是为了能够从一些错误中恢复: 人为的失误 磁盘阵列或是硬盘故障 文件系统崩溃 数据中心被破坏等等. 所以,我为大家罗列了一些开源的软件备份工具. 当为一个企业选择备份工具的时 ...
- Linux 和类 Unix 系统上5个最佳开源备份工具
转载:http://linux.cn/article-4623-weixin.html#rd?sukey=cbbc36a2500a2e6cb7678c4d38b691a9fa7403b259f898e ...
- Linux资源监控命令/工具(综合)
目录: ps pstree pidof top free uptime ifuser lsof mpstat vmstst pidstat iostat iotop watch sar 1.ps 1) ...
- 监控 Linux 系统的 7 个命令行工具
监控 Linux 系统的 7 个命令行工具: " 深入 关于Linux最棒的一件事之一是你能深入操作系统,来探索它是如何工作的,并寻找机会来微调性能或诊断问题.这里有一些基本的命令行工具,让 ...
- UNIX操作系统和Linux操作系统介绍
UNIX操作系统(尤尼斯),是一个强大的多用户.多任务操作系统,支持多种处理器架构,按照操作系统的分类,属于分时操作系统,最早由KenThompson.DennisRitchie和DouglasMcI ...
- 监控Linux性能的18个命令行工具
监控 Linux 性能的 18 个命令行工具 对于系统和网络管理员来说每天监控和调试Linux系统的性能问题是一项繁重的工作.在IT领域作为一名Linux系统的管理员工作5年后,我逐渐 认识到监控和保 ...
- 《Unix/Linux日志分析与流量监控》书稿完成
<Unix/Linux日志分析与流量监控>书稿完成 近日,历时3年创作的75万字书稿已完成,本书紧紧围绕网络安全的主题,对各种Unix/Linux系统及网络服务日志进行了全面系统的讲解,从 ...
随机推荐
- chrome一直提示adobe flash player 因过期而遭阻止
链接:https://www.zhihu.com/question/32223811/answer/128088278 很多新用户在安装了Chrome浏览器或者更新过的的时候,经常提示 adobe f ...
- ax Mail
SysMailer mailer = new SysMailer(); SysEmailParameters parameters = SysEmailParameters::find(); ; tr ...
- [SharePoint 2013] Automatic deployment script
Implement automatic deployment through windows task. Add-PsSnapin Microsoft.SharePoint.PowerShell $t ...
- Web自动化测试工具调研
背景 Web自动化测试越来越被重视, 因为现在Web已经是工程化的状态. 如何通过工具测试, 保证Web开发的质量,提升开发效率,是Web工具的诞生的来由. Web测试分为以下几个方面: 1. 界面测 ...
- 使用mybatis-generator自动生成映射配置
使用mybatis时,编写实体类与数据库的映射是一项繁琐的工作,很容易出错,而mybatis-generator工具很好地解决了这个问题. 一.工具下载与配置 下载地址:① https://gith ...
- Eclipse安装svn插件的几种方式
Eclipse安装svn插件的几种方式 1.在线安装: (1).点击 Help --> Install New Software... (2).在弹出的窗口中点击add按钮,输入Name(任意) ...
- 整理了一下eclipse 快捷键注释的一份文档
// 文档名称 codetemplates.xml <?xml version="1.0" encoding="UTF-8" standalone=&qu ...
- 用node-inspector调试Node.js(转自NOANYLOVE'S BLOG)
原文地址:http://www.noanylove.com/2011/12/node-the-inspector-debugging-node-js/ 用node-inspector调试Node.js ...
- Ubuntu14.04台式机r8169有线网卡驱动问题
由于台式在安装了Ubuntu14.04后插入网线后灯不亮,不能使用有线网. 查找资料发现原来是网卡驱动问题,解决办法如下: 1.查看网卡驱动名称 lspci -v 找到以太网连接的kernel dri ...
- Azure VM上传小文件
因为需要传一些脚本到Azure的VM里,有个简单方法可以实现,如下 编辑这个rdp文件 点击确定,连接远程计算机 可以在我的电脑里看到本地硬盘