mkdir /data/tools && cd /data/tools
wget --no-check-certificate https://bootstrap.pypa.io/ez_setup.py
sudo python ez_setup.py --insecure
wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
tar -xf pip-9.0..tar.gz
cd pip-9.0.
sudo python setup.py install
sudo easy_install supervisor
sudo mkdir /etc/supervisor
sudo mkdir /etc/supervisor/conf
sudo chown wwwad.wwwad /etc/supervisor/ -R
echo_supervisord_conf > /etc/supervisor/supervisord.conf
mkdir /data/supervisor/
supervisord.conf 配置文件内容为
; Sample supervisor config file.
;
; For more information on the config file, please see:
; http://supervisord.org/configuration.html
;
; Notes:
; - Shell expansion ("~" or "$HOME") is not supported. Environment
; variables can be expanded using this syntax: "%(ENV_HOME)s".
; - Quotes around values are not supported, except in the case of
; the environment= options as shown below.
; - Comments must have a leading space: "a=b ;comment" not "a=b;comment".
; - Command will be truncated if it looks like a config file comment, e.g.
; "command=bash -c 'foo ; bar'" will truncate to "command=bash -c 'foo ". [unix_http_server]
file=/data/supervisor/supervisor.sock ; the path to the socket file
chmod= ; socket file mode (default )
chown=wwwad:wwwad ; socket file uid:gid owner
;username=user ; default is no username (open server)
;password= ; default is no password (open server) ;[inet_http_server] ; inet (TCP) server disabled by default
;port= ; ip_address:port specifier, *:port for all iface
;username=admin ; default is no username (open server)
;password=kongzg!@# ; default is no password (open server) [supervisord]
logfile=/data/supervisor/supervisord.log ; main log file; default $CWD/supervisord.log
logfile_maxbytes=50MB ; max main logfile bytes b4 rotation; default 50MB
logfile_backups= ; # of main logfile backups; means none, default
loglevel=info ; log level; default info; others: debug,warn,trace
pidfile=/data/supervisor/supervisord.pid ; supervisord pidfile; default supervisord.pid
nodaemon=false ; start in foreground if true; default false
minfds= ; min. avail startup file descriptors; default
minprocs= ; min. avail process descriptors;default
;umask= ; process file creation umask; default
user=wwwad ; default is current user, required if root
;identifier=supervisor ; supervisord identifier, default is 'supervisor'
;directory=/tmp ; default is not to cd during start
;nocleanup=true ; don't clean up tempfiles at start; default false
;childlogdir=/tmp ; 'AUTO' child log dir, default $TEMP
;environment=KEY="value" ; key value pairs to add to environment
;strip_ansi=false ; strip ansi escape codes in logs; def. false ; The rpcinterface:supervisor 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:x] sections. [rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface ; The supervisorctl section configures how supervisorctl will connect to
; supervisord. configure it match the settings in either the unix_http_server
; or inet_http_server section. [supervisorctl]
serverurl=unix:///data/supervisor/supervisor.sock ; use a unix:// URL for a unix socket
;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
;username=chris ; should be same as in [*_http_server] if set
;password= ; should be same as in [*_http_server] if set
;prompt=mysupervisor ; cmd line prompt (default "supervisor")
;history_file=~/.sc_history ; use readline history if available ; The sample program section below shows all possible program subsection values.
; Create one or more 'real' program: sections to be able to control them under
; supervisor. ;[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= ; number of processes copies to start (def )
;directory=/tmp ; directory to cwd to before exec (def no cwd)
;umask= ; umask for process (default None)
;priority= ; the relative start priority (default )
;autostart=true ; start at supervisord start (default: true)
;startsecs= ; # of secs prog must stay up to be running (def. )
;startretries= ; max # of serial start failures when starting (default )
;autorestart=unexpected ; when to restart if exited after running (def: unexpected)
;exitcodes=, ; 'expected' exit codes used with autorestart (default ,)
;stopsignal=QUIT ; signal used to kill process (default TERM)
;stopwaitsecs= ; max num secs to wait b4 SIGKILL (default )
;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= ; # of stdout logfile backups ( means none, default )
;stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default )
;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= ; # of stderr logfile backups ( means none, default )
;stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default )
;stderr_events_enabled=false ; emit events on stderr writes (default false)
;environment=A="",B="" ; process environment additions (def no adds)
;serverurl=AUTO ; override serverurl computation (childutils) ; The sample eventlistener section below shows all possible eventlistener
; subsection values. Create one or more 'real' eventlistener: sections to be
; able to handle event notifications sent by supervisord. ;[eventlistener:theeventlistenername]
;command=/bin/eventlistener ; the program (relative uses PATH, can take args)
;process_name=%(program_name)s ; process_name expr (default %(program_name)s)
;numprocs= ; number of processes copies to start (def )
;events=EVENT ; event notif. types to subscribe to (req'd)
;buffer_size= ; event buffer queue size (default )
;directory=/tmp ; directory to cwd to before exec (def no cwd)
;umask= ; umask for process (default None)
;priority=- ; the relative start priority (default -)
;autostart=true ; start at supervisord start (default: true)
;startsecs= ; # of secs prog must stay up to be running (def. )
;startretries= ; max # of serial start failures when starting (default )
;autorestart=unexpected ; autorestart if exited after running (def: unexpected)
;exitcodes=, ; 'expected' exit codes used with autorestart (default ,)
;stopsignal=QUIT ; signal used to kill process (default TERM)
;stopwaitsecs= ; max num secs to wait b4 SIGKILL (default )
;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=false ; redirect_stderr=true is not allowed for eventlisteners
;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= ; # of stdout logfile backups ( means none, default )
;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= ; # of stderr logfile backups ( means none, default )
;stderr_events_enabled=false ; emit events on stderr writes (default false)
;environment=A="",B="" ; process environment additions
;serverurl=AUTO ; override serverurl computation (childutils) ; The sample group section below shows all possible group values. Create one
; or more 'real' group: sections to create "heterogeneous" process groups. ;[group:thegroupname]
;programs=progname1,progname2 ; each refers to 'x' in [program:x] definitions
;priority= ; the relative start priority (default ) ; 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 = relative/directory/*.ini [include]
files = /etc/supervisor/conf/*.conf 
program 的配置文件
[program: test]
command=xxxxxxxx ;如果有多条命令,可以写入shell脚本再在这里调用
directory=xxxxx ;执行命令时切换到的目录
user=xxxx ;执行命令所用的linux用户身份
autorestart=true ;是否自动重启
autostart=true ;启动supervisor时是否自行启动该程序
redirect_stderr=true ;如果为true则将stderr发送到stdout相应的log文件中去
stdout_logfile=/path/to/logfile ;制定stdout的输出文件
stdout_logfile_maxbytes=10MB ;限定logfile的大小, 默认为50M
stdout_logfile_backups= ;保存logfile的最大数目,如果操作这个数目则对最早的logfile进行覆盖,默认为10
environment=A="", B="" ;设置环境变量,这里可以保存运行程序需要的参数 这里记住,我们每添加一次program的时候,我们需要更新新的配置到supervisord
supervisorctl update 这里的supervisorctl reload的功能是重启所有的程序 启动某一个程序
supervisorctl start programe_name 一、添加好配置文件后 二、更新新的配置到supervisord
supervisorctl update 三、重新启动配置中的所有程序
supervisorctl reload 四、启动某个进程(program_name=你配置中写的程序名称)
supervisorctl start program_name 五、查看正在守候的进程
supervisorctl status 六、停止某一进程 (program_name=你配置中写的程序名称)
spervisorctl stop program_name 七、重启某一进程 (program_name=你配置中写的程序名称)
supervisorctl restart program_name 八、停止全部进程
supervisorctl stop all 注意:显示用stop停止掉的进程,用reload或者update都不会自动重启。

supervisor 执行命令的额时候报一下错误
Error: .ini file does not include supervisorctl section
For help, use /usr/local/bin/supervisorctl -h 或者 error: <class 'socket.error'>, [Errno ] Network is unreachable: file: /usr/lib64/python2./socket.py line: 这个时候 切换到/etc/supervisor目录执行以上的命令

supervisor 安装脚本的更多相关文章

  1. supervisor安装和配置

    直接命令 easy_install supervisor 如果报错先安装 yum install python-setuptools,再上面一条命令: 安装成功后显示finished,我们再次进行py ...

  2. Supervisor 安装及配置管理uwsgi进程

    Supervisor介绍 Supervisor 允许其用户在UNIX类操作系统上控制多个进程. 块如下: 方便 需要为每个进程实例编写rc.d脚本通常是不方便的. rc.d脚本是进程初始化/自动启动/ ...

  3. Supervisor安装与配置(Linux/Unix进程管理工具)

    原文链接:http://blog.csdn.net/xyang81/article/details/51555473 Supervisor(http://supervisord.org/)是用Pyth ...

  4. Linux系统下 Supervisor 安装搭建

    在 web 应用部署到线上后,需要保证应用一直处于运行状态,在遇到程序异常.报错等情况,导致 web 应用终止时,需要保证程序可以立刻重启,继续提供服务. 所以,就需要一个工具,时刻监控 web 应用 ...

  5. Supervisor安装与配置

    Supervisor(http://supervisord.org/)是用Python开发的一个client/server服务,是Linux/Unix系统下的一个进程管理工具,不支持Windows系统 ...

  6. CentOS7下Supervisor安装与配置

    Supervisor(http://supervisord.org/)是用Python开发的一个client/server服务,是Linux/Unix系统下的一个进程管理工具,不支持Windows系统 ...

  7. mysql 自动备份和nginx自动安装脚本

    一.自动备份Mysql脚本: 如下脚本为mysql自动备份脚本,仅供参考,可以根据实际情况修改. #!/bin/sh #auto backup mysql #wugk #Define PATH定义变量 ...

  8. Linux安装脚本需要交互之如何实现自动安装

    Linux中shell脚本运行时经常需要进行交互,比如安装软件的过程中对license声明的确认,需要输入yes,回车之类的确认信息.这个在自动化安装的时候就会是个问题. 通常对于这个问题比较灵活的解 ...

  9. iredmail安装脚本分析(一)---iRedmail.sh

    iredmail是一套以postfix为核心的整合邮件系统的安装脚本,可以达到快速部署邮件服务器的目的.为了让自己不遗忘shell的语法,所以闲来无事,学习一下他的代码. 我从官网下载他的最新版,解压 ...

随机推荐

  1. http 206请求

    1.概要 在客户端表明自己只需要目标URL上的部分资源的时候返回的.这种情况经常发生在客户端继续请求一个未完成的下载的时候(通常是当客户端加载一个体积较大的嵌入文件,比如视屏或PDF文件). 通常在展 ...

  2. http协议版本历史

    1.http 0.9 2.http 1.0 3. http 1.1 4.http 2.0 推送:主动发送js.css推送到浏览器. 二进制流:可以并行发送数据. 2019.3.18补充: (1)htt ...

  3. java 八种基本数据类型之初始值、取值范围、对应的封装类

      CreateTime--2017年12月6日10:03:53 Author:Marydon 一.java数据类型之基本数据类型 (二)八种基本数据类型的特征 import java.math.Bi ...

  4. python之模块base64

    # -*- coding: cp936 -*- #python 27 #xiaodeng >>> help(base64) #用来作base64编码解码 FUNCTIONS #函数( ...

  5. kibana对logstash监控获取不到数据

    需求: kibana监控elasticsearch+kibana+logstash的性能寻找,性能瓶颈! 发现启动logstash加载logstash.yml,不读取配置好的xpack.monitor ...

  6. bootstrap table + spring + springmvc + mybatis 实现从前端到后端的表格分页

    1.使用准备 前台需要的资源文件,主要有Bootstrap3相关css.js以及bootstrap Table相关css.js: <-- 样式 --> <link rel=" ...

  7. 【转】【MySQL】MySQL的双机互信实战

    [转]https://www.cnblogs.com/mchina/archive/2013/03/15/2956017.html MySQL双机实战原理:利用ssh传输文件,通过公.私钥的共享,实现 ...

  8. DialogFragment 监听按键事件的方法(onkeydown)

                    我们在TV软件开发的时候,会使用DialogFragment,有时候要对它的按键事件进行监听,但是DialogFragment的监听方法和其它的不一样.         ...

  9. [转载]RHEL-6启动时提示:“/usr/libexec/gconf-sanit

    原文地址:RHEL-6启动时提示:"/usr/libexec/gconf-sanity-check-2 exited with status 256"作者:huage 系统环境:R ...

  10. java获取n个工作日后的日期, 排除周末和节假日(顺延)

    一.写在前面 需求: 工作需要获取n个工作日后的日期, 需要排除weekend和holiday, holiday存在数据库中, 存入的形式是一个节日有起始日期和截止日期(以下文中有关于节假日的表截图) ...