Supervisor安装步骤:

来源:互联网 发布:淘宝购买数量点到1000 编辑:程序博客网 时间:2024/06/09 13:39

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的进程;

0 0
原创粉丝点击