在对Kafka in supervisor mode做出回答之后,我试图做同样的事情。事情是,我的卡夫卡(版本0.8.1.1)似乎包装不同的运行脚本。所以,我曾试图去适应并产生了以下supervisord配置:kafka 0.8.1.1在监督下(supervisord)在停止supervisord守护进程时不会被杀死
[program:kafka]
command=pidproxy /var/run/kafka.pid /opt/kafka/bin/kafka-server-start.sh /opt/kafka/config/server.properties
user=kafka
autostart=true
autorestart=true
startsecs=10
startretries=999
log_stdout=true
log_stderr=true
logfile=/var/log/kafka/supervisord-kafka.out
logfile_maxbytes=20MB
logfile_backups=10
我用主管的以下rpm:
[[email protected] yyy]# rpm -qi supervisor
Name : supervisor Relocations: (not relocatable)
Version : 3.0 Vendor: obs://build.opensuse.org/home:presbrey
Release : 13.1 Build Date: Thu 13 Jun 2013 08:35:40 AM IDT
回采的supervisord守护进程不杀死卡夫卡见下图:
[[email protected] yyy]# jps
3236 core
31378 QuorumPeerMain
31408 Jps
2964 Kafka
31293 supervisor
31246 nimbus
[[email protected] yyy]# supervisorctl status
kafka RUNNING pid 2963, uptime 1 day, 5:15:18
storm-nimbus RUNNING pid 31246, uptime 0:02:06
storm-supervisor RUNNING pid 31293, uptime 0:01:44
storm-ui RUNNING pid 3236, uptime 5 days, 22:37:33
storm-zookeeper RUNNING pid 31378, uptime 0:00:47
[[email protected] yyy]# service supervisord stop
Stopping supervisord: Shut down
Waiting roughly 60 seconds for /var/run/supervisord.pid to be removed after child processes exit
Supervisord exited as expected in under 12 seconds
[[email protected] yyy]# supervisorctl status
unix:///var/tmp/supervisor.sock no such file
[[email protected] yyy]# jps
2964 Kafka
31474 Jps
你可以尝试添加'stopasgroup = true'到主管的kafka部分,看看这是否有效? –
非常感谢!你想添加它作为答案,所以我可以upvote和标记? – Yaneeve