I want to get alert in mail when Apache Kafka and Apache Zookeeper process get stopped and when it get stopped it automatically restart both of them. Neither Apache Kafka and Apache Zookeeper does not create any pid file nor it comes under init script.
My monit control files for Apache Zookeeper and Apache Kafka is defined below
check process zookeeper match "config/zookeeper.properties"
if not exist then exec "/Users/xxxx/kafka_2.10-0.9.0.1/bin/zookeeper-server-start.sh -c -d config/zookeeper.properties" and alert [email protected] with reminder on 500 cycles
check process kafka match "config/server.properties"
if not exist then exec "/Users/xxxx/kafka_2.10-0.9.0.1/bin/kafka-server-start.sh -c -d config/server.properties" and alert [email protected] with reminder on 500 cycles
When I reload and start monit, it gives an error of 'kafka' process is not running and 'zookeeper' process is not running.
Please help me how to restart a Kafka and Zookeeper process and get an alert of mail