How to setup/connect distributed Kafka brokers, pr

2019-02-27 12:55发布

I have setup Apache Kafka and confirmed that producers and consumers work on the localhost.

How to set up Kafka so that:

  1. multiple producers feed messages into a broker on a network computer
  2. many consumers on the network can consume the messages from the broker

I noticed the following line: zookeeper.connect=localhost:2181 in server.properties which is used to start the kafka server. If this is the setting, is the setting for what addresses it listens to or is it specifying the server's address/port is on the network?

2条回答
地球回转人心会变
2楼-- · 2019-02-27 13:34

The zookeeper is used internally by Kafka to coordinate the cluster (leader election). In versions of Kafka before 0.8, ZK was the exclusive store for consumer offsets (what is consumed so far), but from 0.8.1, I think, you can choose whether to store offsets in ZK or in a special Kafka topic called __consumer_offsets.

What you're interested in is advertised.host.name and advertised.port settings that Kafka exposes to clients (or "what addresses it listens to", as you put it).

查看更多
再贱就再见
3楼-- · 2019-02-27 13:38

It is the name of the zookeeper server that Kafka connects to. The documentation for the Broker configuration can be found here http://kafka.apache.org/documentation.html#brokerconfigs

查看更多
登录 后发表回答