Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # user >> Manage Kafka using supervisor, failed to restart

Copy link to this message
Re: Manage Kafka using supervisor, failed to restart
Yes, that is likely the case - if the kafka-server-start.sh you're using
is the 'out of the box' version, then you're getting a shell running the
java process, and supervisor is likely only seeing the shell.  One way
to work around this is to change the last line to be:

exec $(dirname $0)/kafka-run-class.sh kafka.Kafka $@

At which the shell process will be replaced with the java process, so
signals from supervisor will end up going direct to the java proc.

What you may end up with at that point is trying to restart too fast -
kafka can take a little bit (generally not more than a few seconds)
depending on the workload it is under at the time.

Dave DeMaagd
[EMAIL PROTECTED] | 818 262 7958

([EMAIL PROTECTED] - Mon, Oct 22, 2012 at 10:17:30AM -0700)
> Using start scripts with supervisor usually doesn't work. Java is probably
> a grandchild of supervisor and therefore not getting the term signal and
> not exiting. Sure the start script exits, but there's probably a java
> process hanging out; check ps.
> please excuse my brevity on this mobile device
> On Oct 22, 2012 9:06 AM, "howard chen" <[EMAIL PROTECTED]> wrote:
> > I am using supervisor to manage Kafka, with the config:
> >
> > [program:kafka]
> > command=/opt/kafka/bin/kafka-server-start.sh
> > /opt/kafka/config/server.properties
> > directory=/opt/kafka
> > user=kafka
> > autostart=true
> > autorestart=true
> > startretries=10
> > stdout_logfile=/opt/kafka/logs/kafka.log
> >
> > I was able to start Kafka, but not able to stop Kafka completely, as
> > when I start Kafka after the stop, it said the port is being used.
> >
> > So definitely the previous shutdown was not complete, anyone got an
> > idea what is the issue?
> >
> > Thanks.
> >