加入收藏 | 设为首页 |

空腹喝牛奶-装置和装备 supervisor

海外新闻 时间: 浏览:258 次

装置和装备 supervisor

1. 晋级python 到 2.7

yum install zlib

yum install zlib-devel

yum -y remove python

wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz

tar -xzvf Python-2.7.11.tgz

cd Python-2.7.11

./configure

make && make install

mv /usr/bin/python /usr/bin/python_2.6

ln -s /usr/local/bin/python2.7 /usr/bin/python

cd /bin/yum

2. 装置 setuptools

yum install zlib

yum install zlib-devel

sudo wget --no空腹喝牛奶-装置和装备 supervisor-check-certificate http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz

sudo wget https://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz

tar -xzvf setuptools-0.6c11.tar.gz

cd setuptools-0.6c11

sudo python setup.py build

sudo python setup.py inst空腹喝牛奶-装置和装备 supervisorall

3. 装置 https://pypi.org/project/supervisor/#files

wget https://files.pythonhosted.org/packages/44/60/698e54b4a4a9b956b2d709b4b7b676空腹喝牛奶-装置和装备 supervisor119c833d811d53ee2500f1b5e96dc3/supervisor-3.3.4.tar.gz

tar -xzvf supervisor-3.3.4.tar.gz

cd supervisor-3.3.4

sudo python setup.py install

4. 装备 vim /etc/supervisord.conf

[unix_http_server]

file=/tmp/supervisor.sock ; (the path to the socket file)

chmod=0770 ; socket file mode (default 0700)

chown=root:root ; socket file uid:gid owner

[rpcinterface:supervisor]

supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]

serverurl=unix:///tmp/supervisor希灵帝国.sock ;

numprocs=10

process空腹喝牛奶-装置和装备 supervisor_name=%(program_name)s_sub_process_%(process_num)d

5. 装备

ln -s /usr/local/bin/supervisord /usr/bin/supervisord

ln -s /usr/local/bin/supervisorctl /usr/bin/supervisorctl

sudo supervisord

sudo supervisorctl

6. 办理

ps aux | grep supervisord

supervisorctl reload

sudo /usr/local/bin/supervisord -c /etc/supervisord.conf

sudo /usr/local/bin/supervisorctl -c /etc/supervisord.conf

ln -s /usr/local/bin/supervisord /usr/bin/supervisord

ln -s /usr/local/bin/supervisorctl /usr/bin/supervisorctl

supervisord -c /etc/supervisord.conf空腹喝牛奶-装置和装备 supervisor

supervisor空腹喝牛奶-装置和装备 supervisord : 发动supervisor

supervisorctl reload :修正完装备文件后重新发动supervisor

supervisorctl status :检查supervisor监管的进程状况

supervisorctl start 进程名 :发动XXX进程

supervisorctl stop 进程名 :中止XXX进程

supervisorctl stop all:中止悉数进程,注:start、restart、stop都不会载入最新的装备文件。

supervisorctl update:依据最新的装备文件,发动新装备或有改动的进程,装备没有改动的进程不会受影响而重启

ps aux|grep task.php|grep -v grep|awk '{print $2}'|xargs kill -USR2