Does a kafka consumer machine need to run zookeeper?

无人久伴 提交于 2020-02-05 04:23:05

问题


So my question is this: If i have a server running Kafka (And zookeeper), and another machine only consuming messages, does the consumer machine need to run zookeeper too? Or does the server take care of all?


回答1:


No.

Role of Zookeeper in Kafka is:

  • Broker registration: (cluster membership) with heartbeats mechanism to keep the list current
  • Storing topic configuration: which topics exist, how many partitions each has, where are the replicas, who is the preferred leader, list of ISR for partitions
  • Electing controller: The controller is one of the brokers and is responsible for maintaining the leader/follower relationship for all the partitions.

So Zookeeper is required only for kafka broker. There is no need to have Zookeper on the producer or consumer side.




回答2:


The consumer does not need zookeeper




回答3:


You have not mentioned which version of Kafka or the clients you're using.

Kafka consumers using 0.8 store their offsets in Zookeeper, so it is required for them. However, no, you would not run Zookeeper and consumers on the same server

From 0.9 and later, clients are separate from needing it (unless you want to manage external connections to Zookeeper on your own for storing data)



来源:https://stackoverflow.com/questions/59771559/does-a-kafka-consumer-machine-need-to-run-zookeeper

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!