标签 supervisor 下的文章

1.安装supervisor

yum install -y supervisor

安装supervisor.jpg

2.配置config文件

  vim /etc/supervisord.conf

进入配置界面
配置界面2.png
□配置访问 将127.0.0.1:9001 修改为0.0.0.0:9001 所有都可以访问 user password就是访问用户和密码 自定义即可
1.png
□配置子配置进程文件
2.png
3.supervisor的常规操作

开机启动supervisor

systemctl enable supervisord

启动supervisor

systemctl start supervisord

停止supervisor

systemctl stop supervisord

查看supervisor状态

systemctl status supervisord

重载supervisor配置

supervisorctl reload

查看supervisor使用的端口

ps aux | grep supervisord

卸载supervisor

yum -y remove supervisor

停止supervisor所有进程

supervisorctl stop all

4.开启防火墙
A、腾讯云或阿里云 安全组添加9001端口(自行在服务商处理)
B、服务器开放端口

firewall-cmd --query-port=9001/tcp          //监测端口是否开启
firewall-cmd --add-port=9001/tcp            //开启80端口
firewall-cmd --remove-port=9001/tcp       //关闭80端口
sudo firewall-cmd --reload                  //重新加载配置

5.其他
查询系统日志命令

journalctl -xe

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

6.常见问题

error: <class 'socket.error'>, [Errno 2] No such file or directory: file: /usr/lib64/python2.7/socket.py line: 224

解决:

/usr/bin/python2 /usr/bin/supervisord -c /etc/supervisord.conf

supervisorctl管理命令

supervisorctl status        //查看所有进程的状态
supervisorctl stop [all]|[x]    //停止所有或指定关闭x
supervisorctl start [all]|[x]    //启动所有或指定启动x
supervisorctl restart       //重启es
supervisorctl update        //配置文件修改后使用该命令加载新的配置
supervisorctl reload        //重新启动配置中的所有程序