Supervisor 安装与配置
· 阅读需 6 分钟
Supervisor 安装与配置
安装 supervisor
Yum 安装
# 配置 yum 源安装
yum install epel-release #安装yum源
yum install -y supervisor
# 启动 supervisor
/usr/bin/supervisord -c /etc/supervisord.conf
### 如果报错:error:class 'socket.error' [Errno 2] No such file or directory: file: /usr/lib64/python2.7/socket
/usr/bin/python2 /usr/bin/supervisord -c /etc/supervisord.conf
二进制安装
cd /usr/local/src
wget https://pypi.python.org/packages/7b/17/88adf8cb25f80e2bc0d18e094fcd7ab300632ea00b601cbbbb84c2419eae/supervisor-3.3.2.tar.gz
tar -zxvf supervisor-3.3.2.tar.gz
cd supervisor-3.3.2
python setup.py install #本地python版本为python2.7
# python2.7 setup.py install #本地python版本为python3以上
py工具安装
# 安装easy_install
sudo yum install python-setuptools-devel
# 安装Supervisor
easy_install supervisor
# 生成配置文件
echo_supervisord_conf > /etc/supervisord.conf
# 启动
supervisord -c /etc/supervisord.conf
ps aux | grep supervisord
Supervisor 配置文件路径
supervisor配置文件:/etc/supervisord.conf
子进程配置文件路径:/etc/supervisord.d/