Supervisor安装步骤:

Supervisor
Supervisor Components:supervisord、supervisorctl、Web Server、XML-RPC Interface
Platform Requirements

Supervisor has been tested and is known to run on Linux (Ubuntu 9.10), Mac OS X (10.4/10.5/10.6), and Solaris (10 for Intel) and FreeBSD 6.1.
It will likely work fine on most UNIX systems.
Supervisor will not run at all under any version of Windows.
Supervisor is known to work with Python 2.4 or later but will not work under any version of Python 3.

Supervisor安装步骤:
1.检查python版本:python –version
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.
然后 python setup.py install
最后下载supervisor 3.3.1
然后 python setup.py install

3.配置
echo_supervisord_conf > supervisord.conf
将路径/tmp修改为 /data/supervisor
4.启动 (-n表示foreground方式启动)
supervisord -n -c supervisord.conf

5.添加program
[program:theelasticsearch]
command=/usr/local/elasticsearch-1.7.0/bin/elasticsearch start
startsecs=10
startretries=3
autostart=true
6.重新启动supervisor
7.试验,当杀死elasticsearch后,Supervisor监控到elasticearch进程消失后,会拉活elasticsearch
8.Supervisor客户端工具:
supervisorctl -c 配置文件(与supervisord共用一个配置文件)
进入后,命令
status
start program name
stop program name
restart program name

注意事项:autostart设置true表示,supervisord启动时,也把程序给启动,在如下场景中:
程序事先已经启动了(或者说Supervisord是事后才安装启动的),那么需要把原先的程序停止,然后启动Supervisor时,由于
设置autostart=true,所以,也一并把程序给启动了;

startsecs :
The total number of seconds which the program needs to stay running after a startup
to consider the start successful (moving the process from the STARTING state to the RUNNING state).
Set to 0 to indicate that the program needn’t stay running for any particular amount of time.

问题 : from xml.etree.ElementTree import fixtag
解决方法 : pip install meld3==0.6.7
参考: http://blog.sina.com.cn/s/blog_55b759e60101ngnc.html

注意:supervisord是只能监控非daemonize的进程;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值