在centos上安装supervisor 4.1

1、环境安装与准备:需要提前安装python、pip,安装过程此处省略

2、pip install supervisor

3、安装完毕会在python的安装目录生成3个文件supervisord、supervisorctl、echo_supervisor_conf,这三个程序分别是:守护程序、supervisor客户端、创建默认supervisor的配置文件

4、创建配置文件存放目录:sudo mkdir /soft/supervisor/conf.d 目录没有先创建目录

5、使用echo_supervisor_conf生成默认配置,分别执行以下命令:

cd python3/bin
echo_supervisor_conf > /soft/supervisor/conf.d/supervisored.conf 

6、启动supervisor:supervisord -c /soft/supervisor/conf.d/supervisord.conf

7、报错

[root@localhost apps]# supervisord -c /soft/supervisor/conf.d/supervisord.conf
-bash: supervisord: command not found

8、错误7的解决方案

/python3.6.5/bin/supervisord -c /soft/supervisor/supervisord.conf

9、报错

Error: .ini file does not include supervisord section
For help, use /python3.6.5/bin/supervisord -h

10、错误9的解决方案:在supervisord.conf的配置文件中添加以下三行配置(直接复制放进去就行了)

[supervisord]
nodaemon=true
[supervisorctl]

11、启动,使用如下命令,当然如果你的配置文件直接放在/etc下面,启动是可以不加-c的参数

sudo /python3.6.5/bin/supervisord -c /soft/supervisor/supervisord.conf

你可能感兴趣的:(运维)