要让Kafka运行,您需要在config/server.properties文件中设置一些属性.我不明白有两种设置.
有人可以解释一下监听器和advertised.listeners属性之间的区别吗?
文件说:
listeners:套接字服务器侦听的地址.
和
advertised.listeners:代理将向生产者和消费者做广告的主机名和端口.
我何时必须使用哪种设置?
在kafka中生成消息时,我收到以下错误:
$ bin/kafka-console-producer.sh --broker-list localhost:9092 --topic nil_PF1_P1
hi
hello
[2016-07-19 17:06:34,542] ERROR Error when sending message to topic nil_PF1_P1 with key: null, value: 2 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
[2016-07-19 17:07:34,544] ERROR Error when sending message to topic nil_PF1_P1 with key: null, value: 5 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
$ bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic nil_PF1_P1
Topic:nil_PF1_P1 PartitionCount:1 ReplicationFactor:1 Configs:
Topic: nil_PF1_P1 Partition: 0 Leader: 2 …Run Code Online (Sandbox Code Playgroud)