Kafka Cluster 和 Kafka Broker 有什么区别?

What is the difference between Kafka Cluster and Kafka Broker?

Kafka clusterKafka broker的意思一样吗?

我知道集群有多个代理(这是错误的吗?)。

但是当我编写代码来生成消息时,我觉得很尴尬option

props.put("bootstrap.servers", "kafka001:9092, kafka002:9092, kafka003:9092");

这个是broker地址还是集群地址?如果这是经纪人地址,我认为这不好,因为当经纪人计数发生变化时,我们必须修改上面的地址。
(不过好像是broker address..)

另外,我在amazon的MSK看到,我们可以给每个AZ添加broker。
这意味着,我们不能有很多经纪人。 (最多三四个?)

他们指导我们应该将此代理地址写入 bootstrap.serveroption as a,` 分隔列表。

为什么他们不指导我们使用集群地址或ARN

一个Kafka cluster是一组Kafka brokers.

使用生产者 API 时,不需要在 bootstrap.servers 属性中提及集群中的所有代理。 bootstrap.servers 上的生产者配置文档提供了完整的详细信息:

A list of host/port pairs to use for establishing the initial connection to the Kafka cluster. The client will make use of all servers irrespective of which servers are specified here for bootstrapping—this list only impacts the initial hosts used to discover the full set of servers. This list should be in the form host1:port1,host2:port2,.... Since these servers are just used for the initial connection to discover the full cluster membership (which may change dynamically), this list need not contain the full set of servers (you may want more than one, though, in case a server is down).

集群中的所有代理共享同一集群中其他代理的元信息。因此,在 bootstrap-servers 属性中仅提及一个经纪人就足够了。但是,您仍然应该提及多个,以防某个经纪人因任何原因无法使用。