Supervisor安装

一、基础信息

安装环境:
 CentOS Linux release 7.4.1708 (Core) 
Supervisor安装包:

https://files.pythonhosted.org/packages/44/60/698e54b4a4a9b956b2d709b4b7b676119c833d811d53ee2500f1b5e96dc3/supervisor-3.3.4.tar.gz

地址:https://pypi.org/project/supervisor/3.3.4/

二、安装

curl https://bootstrap.pypa.io/pip/2.7/get-pip.py | python -;pip install meld3
#安装python-setuptools
rpm -qa | grep python-setuptools||yum -y install python-setuptools
#下载supervisor-3.3.4安装包
wget https://files.pythonhosted.org/packages/44/60/698e54b4a4a9b956b2d709b4b7b676119c833d811d53ee2500f1b5e96dc3/supervisor-3.3.4.tar.gz
#解压
tar -zxvf supervisor-3.3.4.tar.gz 
cd supervisor-3.3.4/
#执行安装
python setup.py install
#确认版本
supervisord -v
3.3.4

三、配置

#配置模板:./supervisor/skel/sample.conf
IP=$(ifconfig $(route -n | grep ^0.0.0.|awk '{print$NF}') | grep "inet "|awk '{print$2}')
cat << EOF > /etc/supervisord.conf
[unix_http_server]
file=/var/run/supervisor.sock ; the path to the socket file

[supervisord]
logfile=/var/log/supervisord.log ; main log file; default $CWD/supervisord.log
logfile_maxbytes=50MB ; max main logfile bytes b4 rotation; default 50MB
logfile_backups=10 ; # of main logfile backups; 0 means none, default 10
loglevel=info ; log level; default info; others: debug,warn,trace
pidfile=/var/run/supervisord.pid ; supervisord pidfile; default supervisord.pid
nodaemon=false ; start in foreground if true; default false
minfds=65536 ; min. avail startup file descriptors; default 1024
minprocs=200 ; min. avail process descriptors;default 200
childlogdir=/data/supervisor ; 'AUTO' child log dir, default $TEMP

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
[include]
files = /etc/supervisord.d/*.ini
EOF

#配置目录
mkdir -p /data/supervisor 
mkdir -p /etc/supervisord.d

四、Systemd配置

cat <<EOF> /lib/systemd/system/supervisord.service 
[Unit]
Description=Process Monitoring and Control Daemon
After=rc-local.service nss-user-lookup.target
[Service]
LimitNPROC=65535
LimitNOFILE=65535
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord.conf
[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl start supervisord
# 开机启动
systemctl enable supervisord
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值