Search code examples
apache-kafkadebianapache-zookeeper

Check if zookeeper is up and running


I have deployed a click-to-deploy Kafka 3.4 on GCP VM Debian OS. I'm running into different issues when creating the topic. Hence wanted to check if the zookeeper is up and running.

When I run the command "sudo systemctl status zookeeper", see active (exited). Does this mean zookeeper is down? I also tried to stop and start zookeeper using zookeeper-server-stop.sh and zookeeper-server-start.sh, but still seeing same status active (exited)

user@kafka-vm-1-kafka-vm-0:/opt/kafka$ sudo systemctl status zookeeper
  zookeeper.service - LSB: centralized coordination service
     Loaded: loaded (/etc/init.d/zookeeper; generated)
     Active: active (exited) since Thu 2023-07-27 03:48:22 UTC; 9min ago
       Docs: man:systemd-sysv-generator(8)
    Process: 25155 ExecStart=/etc/init.d/zookeeper start (code=exited, status=0/SUCCESS)
        CPU: 912ms

Jul 27 03:48:22 kafka-vm-1-kafka-vm-0 systemd[1]: Stopping LSB: centralized coordination service...
Jul 27 03:48:22 kafka-vm-1-kafka-vm-0 systemd[1]: zookeeper.service: Succeeded.
Jul 27 03:48:22 kafka-vm-1-kafka-vm-0 systemd[1]: Stopped LSB: centralized coordination service.
Jul 27 03:48:22 kafka-vm-1-kafka-vm-0 systemd[1]: Starting LSB: centralized coordination service...
Jul 27 03:48:22 kafka-vm-1-kafka-vm-0 systemd[1]: Started LSB: centralized coordination service.

Question:

  1. How do we check if zookeeper is up and running on Linux?
  2. How do we check if Kafka broker (all nodes or each node) is up and running on Linux?

Solution

  • Use jps to check running Java processes. You should see lines for Kafka and Zookeeper