google-templateskafka

Check cluster status

You can check the cluster status by running the following command:

$ zkCli.sh -server ZOOKEEPER_PRIMARY_NODE:2181 ls /brokers/ids | tail -n1

ZOOKEEPER_PRIMARY_NODE is a placeholder, substitute it with the name of your first ZooKeeper node. For instance, if your deployment is called my-first-deploy, to access your first Zookeeper node replace the placeholder with the following my-first-deploy-zk-0 t.

You will see an output like this:

[1002, 1001]

The number of elements of the array and the number of Kafka nodes of your deployment must be the same.

To check the status of your topics:

  • Export the authentication configuration:

      $ export KAFKA_OPTS="-Djava.security.auth.login.config=/opt/bitnami/kafka/config/kafka_jaas.conf"
    
  • And execute:

      $ kafka-topics.sh --describe --bootstrap-server localhost:9092 --command-config /opt/bitnami/kafka/config/producer.properties --topic test
    

    The output should be similar to this:

      Topic: test  TopicId: bR5ahhRBRIeKSAdEDacVIw  PartitionCount: 1  ReplicationFactor: 1  Configs:
      Topic: test  Partition: 0  Leader: 1001  Replicas: 1001  Isr: 1001
    
Last modification April 18, 2023