问题现象
supervisor进程自己被系统kill掉了,但是它管理的进程服务却没有被终止
2.终止掉相关子进程
3.重新启动supervisor
4.总结
这样可以一次性快速kill掉supervisor管理的所有子服务进程 而不需要一个一个查找相关的子进程
supervisor日志按天打包存储
logrotate配置 logrotate是linux系统默认自带的日志管理工具 无需进行手动安装
综合了supervisor的功能和logrotate的功能,最终实现了将程序输出的日志以天为单位进行保存,并且保存指定天数的日志
tar -zcvf $backdir/applogs_$datestr.tgz.tmp -C $logdir .
mv $backdir/applogs_$datestr.tgz.tmp $backdir/applogs_$datestr.tgz
supervisor控制子进程启动顺序
1.设置子进程的启动优先级并没有实现需要的效果
2.把自动启动设置为手动启动
3.启动service超时
4.设置service启动的超时时间
# taishi enterprise supervisord service for systemd (CentOS 7.0+) [Unit] Description=taishi Enterprise Supervisor daemon After=taishi.service [Service] Type=forking LimitNOFILE=655350 LimitNPROC=655350 ExecStart=/bin/bash /app/taishi/etc/start_taishi.sh ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown ExecReload=/usr/bin/supervisorctl $OPTIONS reload KillMode=process TimeoutSec=1200s [Install] WantedBy=multi-user.target
ping -c 1 -q $hostname > /dev/null 2>&1 if [ $? -ne 0 ]; then echo "127.0.0.1 $hostname" >> /etc/hosts fi if [ -e /app/taishi/jdk ]; then setcap cap_net_bind_service=+epi /app/taishi/jdk/bin/java fi # chmod in order to support license check # chmod u+s `which dmidecode` #elasticsearch memory locking ulimit -l unlimited /usr/bin/supervisord -c /app/taishi/etc/supervisord.conf sleep 5 #控制应用服务的启动顺序 supervisorctl start elasticsearch supervisorctl start zookeeper supervisorctl start kafka supervisorctl start mysql supervisorctl start redis supervisorctl start kibana supervisorctl start flinkcluster supervisorctl start flinktask supervisorctl start flinkhistory sleep 20 supervisorctl start register supervisorctl start gateway supervisorctl start admin supervisorctl start sdccollect supervisorctl start sdces supervisorctl start sdcrule supervisorctl start sdcschedule supervisorctl start sdcweb supervisorctl start Tlog supervisorctl start nginx