Link to home
Start Free TrialLog in
Avatar of Sathish David  Kumar N
Sathish David Kumar NFlag for India

asked on

How to check kafka server up and running via java pgm .

Hi All ,

How to check kafka server up and running  via java pgm .

is there any utility available ?
Avatar of David Favor
David Favor
Flag of United States of America image

You'll do this the same, independent of what language you use.

One easy way is to just do a ps auxww | grep -i kafka or whatever process name kafka runs under.

And this won't really do you any good by itself.

My guess is what you're really asking is how to ensure kafka stays running, so if it dies, it auto restarts.

Generally when a process like kafka dies, there's a reason which requires manual intervention to fix.

Likely what you'll do is just check to see if kafka is running + if it's dead, then email/SMS a notification list of people required to fix the related problem.

Since this is a trivial task, I'm unsure what you mean by a "utility available" to do this.

Just set a CRON job to run every minute to test if kafka is running + email/SMS people when it dies.
ASKER CERTIFIED SOLUTION
Avatar of Sathish David  Kumar N
Sathish David Kumar N
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
kafkaadminclient will fail if the this program... loses track of the socket or pid file it's checking.

When you run into trouble using kafkaadminclient, you can always fallback to the ps approach.