Tejas 07
Tejas 07

Reputation: 79

Importance of broker.id in kafka?

We have broker.id property in kafka properties file.

What is the importance of broker.id and what if we assign same integer number to broker.id on all the kafka instance running on different vm.

Upvotes: 2

Views: 2945

Answers (1)

codejitsu
codejitsu

Reputation: 3182

From the Apache Kafka documentation:

The broker.id property is the unique and permanent name of each node in the cluster.

Broker id must be unique because this value is used in core Kafka algorithms (leader/followers).

On the flip side, each Kafka broker registers itself by Zookeeper using that broker.id value. This is an another reason why this value has to be unique: otherwise you'll get something like

java.lang.RuntimeException: A broker is already registered on the path /brokers/ids/0. This probably indicates that you either have configured a brokerid that is already in use, or else you have shutdown this broker and restarted it faster than the zookeeper timeout so it appears to be re-registering.

Upvotes: 5

Related Questions