本文介绍了kafka 中的引导服务器与动物园管理员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么不推荐在 kafka-consumer 中使用 zookeeper,为什么建议使用引导服务器?引导服务器的优势是什么?

Why the use of zookeeper in kafka-consumer is deprecated and why it's recommended to use the bootstrap server instead ?what are the advantages of the bootstrap-server?

推荐答案

Kafka 消费者需要将偏移量提交给 kafka 并从 kafka 中获取偏移量.由于kafka将offset存储从zookeeper转移到kafka brokers,kafka消费者不需要直接和zookeeper通信,所以新的kafka消费者不需要配置zookeeper.

Kafka consumer need to commit the offset to kafka and fetch the offset from kafka. Since kafka moved the offset storage from zookeeper to kafka brokers, a kafka consumer does not need to directly communicate with zookeeper, so the new kafka consumer does not need to config the zookeeper.

但是,kafka 消费者总是需要连接到 kafka brokers(集群)才能将请求发送到服务器,bootstrap-server 只是这个集群的一些 broker,使用它,消费者可以找到所有的 broker.

However, a kafka consumer always needs to connect to kafka brokers (cluster) to send the request to server, the bootstrap-server is just some brokers of this cluster, and using this, consumer could find all the brokers.

这篇关于kafka 中的引导服务器与动物园管理员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 04:32
查看更多