centos6.8 install supervisor

yum 安装

yum install epel-release
yum install -y supervisor

开机自启动

# systemctl enable supervisord // 7.x
# chkconfig supervisord on  // 6.8

启动supervisord服务

# systemctl start supervisord // 7.x 
# service supervisord start // 6.x

查看supervisord服务状态

systemctl status supervisord

但是这种方式在yum 上安装的是1.0版本。完全没法使用。1是没日志,2是没法重启。

解决办法是自己编译安装python, 然后重新安装

pip install

//1. 安装
wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz
tar zxvf Python-3.6.0.tgz
cd Python-3.6.0
./configure --prefix=/usr/local/python3.6 --with-ssl
make
make install
// 2.创建链接来使系统默认python变为新版本
ln -fs /usr/local/python3.6/bin/python3.6 /usr/bin/python
// 检查Python版本
python –V
// 3.修改yum配置(否则yum无法正常运行)
vi /usr/bin/yum
将第一行的#!/usr/bin/python修改为系统原有的python版本地址#!/usr/bin/python2.6

这个办法不能安装python3.9.2, 会报pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

安装supervisor

pip install --upgrade pip
pip install supervisor
# 需要把/usr/local/python3.6/bin 加入到path路径下 
echo_supervisord_conf > /etc/supervisord.conf
supervisord  -c /etc/supervisord.conf