Each broker is assigned an ID. When there are multiple brokers in a cluster (best practice), one is selected as the Controller
. The Controller will be responsible for electing the leader of the partition.
Term | Path |
---|---|
Broker Config | kafka/config/server.properties |
Server Logs | kafka/logs/server.log |
Messages Logs | kafka/data/kafka |
View Nodes in Zookeeper Shell | kafka/bin/zookeeper-shell.sh zookeeper1:2181/kafka && ls get /controller |
Replicas
provide guarantees for the availability of the data. The replicator factor
provides a way for the Kafka administrator to control the availability of that data in the event of failure. For example, if the replication factor is set to 3, you will have 3 copies of each partition spread across the brokers.
What are the goals for placement of replicas?
Producer or consumer sends request to the Broker and the Broker handles the request in the following way:
Within a broker, a topic can be broken down into multiple partitions (with n-1 partitions being replicas).
server.properties
file (log.dirs).