vmware-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/conf/kafka_jaas.conf"
    
  • And execute:

    $ kafka-topics.sh --describe --zookeeper ZOOKEEPER_PRIMARY_NODE:2181
    

    The output should be similar to this:

    Topic: 9ckbm157djyhyh2r9lwg0hpvi    PartitionCount:1    ReplicationFactor:1 Configs:
    Topic: 9ckbm157djyhyh2r9lwg0hpvi    Partition: 0    Leader: 1002    Replicas: 1002  Isr: 1002
    Topic: test0910551  PartitionCount:2    ReplicationFactor:2 Configs:
    Topic: test0910551  Partition: 0    Leader: 1002    Replicas: 1001,1002 Isr: 1002
    Topic: test0910551  Partition: 1    Leader: 1002    Replicas: 1002,1001 Isr: 1002
    
Last modification September 5, 2018