一、安装

//直接使用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

最新文章

  1. 给大家分享一个jQuery TAB插件演示
  2. Spring Boot 实践折腾记(三):三板斧,Spring Boot下使用Mybatis
  3. Backbone.js学习之二
  4. (zz) 谷歌技术"三宝"之BigTable
  5. 关于Mvvm的一些深入理解
  6. JAVA中压缩与解压缩
  7. codeforces 678C C. Joty and Chocolate(水题)
  8. [Linux]Vim的安装及使用
  9. Spring中使用log4j随笔
  10. PHP关于时区问题
  11. Happy 2004(快速幂+乘法逆元)
  12. POJ(1195)(单点修改,区间查询)(二维)
  13. StringBuffer和String需要注意的
  14. SpringBoot系列——Spring-Data-JPA(究极进化版) 自动生成单表基础增、删、改、查接口
  15. 1、FreeRTOS移植
  16. 一文读懂遗传算法工作原理(附Python实现)
  17. Session配置之WebApi支持
  18. Java界面编程—事件的种类
  19. 用Putty连接连接Linux
  20. Codeforces807 B. T-Shirt Hunt 2017-05-08 23:23 175人阅读 评论(0) 收藏

热门文章

  1. CNN延拓至 复数域
  2. HDUJ 2052 Picture 模拟
  3. 5.1 《锋利的jQuery》jQuery对表单的操作
  4. iOS开发中集成Reveal
  5. CodeChef - ANDMIN —— 线段树 (结点最多被修改的次数)
  6. Linux中常用文件传输命令及使用方法
  7. linux应用之bugfree的安装及配置
  8. 反向ssh
  9. linux 进程学习笔记-运行新进程
  10. TCP/IP--VLSM