参考: 有空研究下原理
廖雪峰简单讲解:
https://www.liaoxuefeng.com/article/895919885120064
源码解析:
https://cloud.tencent.com/developer/article/1414914
安装supervisor:
yum install -y epel-release
yum install -y supervisor
vim /etc/supervisord.conf
例子: kafka启动管理
cd /etc/supervisord.d
vim jps.ini
[program:kafka]
directory=/data/kafka_2.11-2.3.1/
command=/data/kafka_2.11-2.3.1/bin/kafka-server-start.sh /data/kafka_2.11-2.3.1/config/server.properties
autostart=true
autorestart=true
startsecs=10
stderr_logfile=/tmp/super_kafka_stderr.log
stdout_logfile=/tmp/super_kafka_stdout.log
user=root
redirect_stderr=true
stdout_logfile_backups=2
#启动
supervisord -c /etc/supervisord.conf
supervisorctl status
#停止supervisor
pkill supervisord