Your server comes pre-installed with Apache Kafka and Apache Zookeeper. Kafka is a distributed streaming platform, and Zookeeper acts as the coordination service required for Kafka to function.

1. Verifying Service Status

Apache Kafka and Zookeeper run as system services. To verify that both are active and running correctly, use the following commands via your terminal:

Check Zookeeper:

 
systemctl status zookeeper

Check Kafka:

 
systemctl status kafka

Look for the text Active: active (running) in the output.


2. Port Verification

Kafka and Zookeeper rely on specific network ports to communicate. If you cannot connect to your instance, ensure these ports are open and listening.

  • Zookeeper (Port 2181): Manages the cluster configuration.

  • Kafka (Port 9092): The primary port for producing and consuming messages.

Verify Ports:

 
# Check if ports are listening
ss -tlnp | grep -E '2181|9092'

You should see output similar to LISTEN 0 50 *:2181 and *:9092.


3. The "One-Click" Health Check

To verify your entire setup in seconds, copy and paste this command into your terminal. It will check the status of both services, confirm the ports are listening, and provide a confirmation message:

 
systemctl is-active zookeeper && \
systemctl is-active kafka && \
ss -tlnp | grep 2181 && \
ss -tlnp | grep 9092 && \
echo "✅ Kafka and Zookeeper are healthy"

4. Service Management

If you need to restart, stop, or start your services, use the standard systemctl commands:

Action Command
Restart Services systemctl restart zookeeper kafka
Stop Services systemctl stop zookeeper kafka
Start Services systemctl start zookeeper kafka

Pro-Tip: Your Kafka installation is located at /opt/kafka. All logs for troubleshooting can be found in /opt/kafka/logs/.


Need Help?

If the health check fails or your services won't start, please do not hesitate to reach out to our support team.

Open a Support Ticket at HostGraber | View Server Status

Was this answer helpful? 0 Users Found This Useful (0 Votes)