- Building Data Streaming Applications with Apache Kafka
- Manish Kumar Chanchal Singh
- 304字
- 2022-07-12 10:38:13
Role of Zookeeper
We have already talked a lot about Zookeeper in the previous sections. Zookeeper plays a very important role in Kafka architecture and it is very important for you to understand how it records the Kafka cluster state. Therefore, we are dedicating a separate section to the role of Zookeeper in the Kafka cluster. Kafka cannot work without Zookeeper. Kafka uses Zookeeper for the following functions:
- Choosing a controller: The controller is one of the brokers responsible for partition management with respect to leader election, topic creation, partition creation, and replica management. When a node or server shuts down, Kafka controllers elect partition leaders from followers. Kafka uses Zookeeper's metadata information to elect a controller. Zookeeper ensures that a new controller is elected in case the current controller crashes.
- Brokers metadata: Zookeeper records the state of each of the brokers that are part of the Kafka cluster. It records all relevant metadata about each broker in a cluster. The producer/consumer interacts with Zookeeper to get the broker's state.
- Topic metadata: Zookeeper also records topic metadata such as the number of partitions, specific configuration parameters, and so on.
- Client quota information: With newer versions of Kafka, quota features have been introduced. Quotas enforce byte-rate thresholds on clients to read and write messages to a Kafka topic. All the information and states are maintained by Zookeeper.
- Kafka topic ACLs: Kafka has an in-built authorization module that is defined as Access Control Lists (ACLs). These ACLs determine user roles and what kind of read and write permissions each of these roles has on respective topics. Kafka uses Zookeeper to store all ACLs.
The preceding points summarize how Zookeeper is used in the Kafka cluster and why a Kafka cluster cannot run without Zookeeper. In upcoming chapters, you will understand Zookeeper concepts in more technical depth.
推薦閱讀
- JavaScript前端開發(fā)模塊化教程
- GitLab Cookbook
- Monkey Game Development:Beginner's Guide
- 零基礎學C++程序設計
- MySQL數據庫應用與管理 第2版
- C語言程序設計
- Neo4j Essentials
- 薛定宇教授大講堂(卷Ⅳ):MATLAB最優(yōu)化計算
- Java Web應用開發(fā)技術與案例教程(第2版)
- Learning Apache Mahout Classification
- 區(qū)塊鏈底層設計Java實戰(zhàn)
- C++20高級編程
- Android傳感器開發(fā)與智能設備案例實戰(zhàn)
- Getting Started with Python and Raspberry Pi
- 響應式Web設計:HTML5和CSS3實戰(zhàn)(第2版)