189 8069 5689

安装supervisor-创新互联

1、supervisor安装文件,安装命令为:sh supervisor_install.sh

在望江等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供网站建设、成都网站制作 网站设计制作按需定制,公司网站建设,企业网站建设,品牌网站设计,网络营销推广,成都外贸网站建设公司,望江网站建设费用合理。
#!/bin/bash

yum -y install python-setuptools
easy_install 'supervisor==3.3.4'
echo "alias 'supervisorctl'='supervisorctl -c /opt/superctl/etc/supervisor.conf'" >> ~/.bashrc

mkdir -p /opt/superctl/bin/
mkdir -p /opt/superctl/log/
mkdir -p /opt/superctl/etc/

chmod -R 755 /opt/superctl/bin/
chmod  755 /opt/superctl/supervisor.sh

cd /opt/superctl/etc/

cat > supervisor.conf << EOF
[unix_http_server]
file=/opt/superctl/log/supervisord.sock

[inet_http_server]
port=127.0.0.1:9001

[supervisord]
logfile=/opt/superctl/log/supervisord.log
logfile_maxbytes=20MB
logfile_backups=10
loglevel=info
pidfile=/opt/superctl/log/supervisord.pid
nodaemon=false
minfds=60000
minprocs=200
#directory=/opt/superctl/
childlogdir=/opt/superctl/log/

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

[supervisorctl]
serverurl=unix:///opt/superctl/log/supervisord.sock ; use a unix:// URL  for a unix socket

[include]
files = /opt/superctl/etc/*.supervisor
EOF

cat > test.supervisor.temple << EOF
[program:test]
command = /bin/bash /opt/superctl/bin/test_start.sh
autostart = true
autorestart = true
stdout_logfile = /opt/superctl/log/test-stdout.log
stderr_logfile = /opt/superctl/log/test-stderr.log
stdout_logfile_maxbytes = 500MB
stdout_logfile_backups = 50
stdout_capture_maxbytes = 1MB
stdout_events_enabled = false
loglevel = info
priority = 1
stopasgroup = true
EOF

2、在superctl目录下添加supervisor.sh文件

#
# chkconfig: 2345 12 80
# 配置文件:/opt/superctl/etc/supervisor.conf
# 
source ~/.bashrc

PATH=/sbin:/usr/sbin:$PATH

usage ()
{
        echo $"Usage: $0 {start|stop|status|restart}" 1>&2
        RETVAL=2
}

start ()
{
  if [ -e /opt/superctl/etc/supervisor.conf ] ;then
       if [ `ps -ef|grep "/opt/superctl/etc/supervisor.conf"|grep -v grep|wc -l` -ne 0 ];then
                         sleep 1
                   echo "/opt/superctl/etc/supervisor.conf 进程正在运行"
                   ps -ef|grep " /opt/superctl/etc/supervisor.conf"|grep -v grep
                else
                         sleep 1
                    /bin/supervisord -c /opt/superctl/etc/supervisor.conf
        fi
  fi
}

stop ()
{
if [ `ps -ef|grep " /opt/superctl/etc/supervisor.conf"|grep -v grep|wc -l` -eq 1 ];then
         supervisorctl stop all
         sleep 4
         /bin/supervisorctl shutdown
fi
}

status ()
{
/bin/supervisorctl status
}

restart ()
{
        stop
        sleep 3
        start
}

case "$1" in
    stop) stop ;;
    status) status ;;
    restart) restart ;;
    start) start ;;
    *) usage ;;
esac

exit $RETVA

3、启动命令:
sh supervisor.sh start|stop|restart

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


网站标题:安装supervisor-创新互联
网页网址:http://cdxtjz.cn/article/dhdeep.html

其他资讯