Get the App
SLTechnology News&Howtos  ›  Servers  › 

Example Analysis of kafka-zookeeper

Shulou Source: shulou.com Published: 2022-05-31 20:05:50 10月03日 Update

This article mainly introduces the example analysis of kafka-zookeeper, which is very detailed and has certain reference value. Friends who are interested must finish it!

Kafka usually registers some of its own MetaData with Zookeeper, while zookeeper uses a namespace for node management

1: first, let's start zkCLi.sh

Locate zkCli.sh

In my cluster, zkCli.sh is / usr/lib/zookeeper/bin/zkCli.sh

2: start zkCli.sh

3 here, our zk has been connected to impala0, and the impala0 here is our zookeeper host address

4 once we are connected to the host, we can see that the znode nodes registered with the various services under the zookeeper

5 under the / root directory, we can find some nodes where kafka is registered with zookeeper:

These include:

1: consumers

2: brokers

6 / brokers includes the two most basic nodes

1: topics: child nodes are all topics

2: ids: the number of the broker node

7 under each broker, topic/partition/ specific partition / state is saved / specified

As shown in the figure / brokers/topic/lovelovelove/partitions/1/state

Is the status node with partition 1 under lovelovelove topic

8 in Zookeeper, each znode node of zookeeper corresponds to data

Among them, the JSON string contains the leaders currently owned. In the screenshot above, you can clearly see that the leader is 1.

The above is all the content of this article "sample Analysis of kafka-zookeeper". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Node middle example analysis host content article clear two value interest address guy partner screenshot data more root directory status knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Shulou Technology macOS NVidia Apple