我已经设置了3个节点的Kafka集群,一切都很好。
三个经纪人的财产:
#listeners=PLAINTEXT://:9092
zookeeper.connect=109.169.xx.xx:2181,88.150.xxx.xxx:2181,5.152.xxx.xxx:2181
和broker.id
对每一个都是唯一的。我停止并启动了其中一个经纪人:
/opt/kafka/confluent-4.0.0/bin/kafka-server-stop
和
nohup /opt/kafka/confluent-4.0.0/bin/kafka-server-start /opt/kafka/confluent-4.0.0/etc/kafka/server.properties &
现在我想要诅咒:
/opt/kafka/confluent-4.0.0/bin/kafka-console-consumer --bootstrap-server 109.169.xxx.xx:9092 --topic test_set_retention_nwq --from-beginning
出现此错误消息:
[2018-04-16 15:51:40,974] WARN [Consumer clientId=consumer-1, groupId=console-consumer-13964] Error while fetching metadata with correlation id 14 :
{test_set_retention_nwq=UNKNOWN_TOPIC_OR_PARTITION}
(org.apache.kafka.clients.NetworkClient)
[2018-04-16 15:51:41,075] WARN [Consumer clientId=consumer-1, groupId=console-consumer-13964] Error while fetching metadata with correlation id 15 :
{test_set_retention_nwq=UNKNOWN_TOPIC_OR_PARTITION}
(org.apache.kafka.clients.NetworkClient)
[2018-04-16 15:51:41,176] WARN [Consumer clientId=consumer-1, groupId=console-consumer-13964] Error while fetching metadata with correlation id 16 :
{test_set_retention_nwq=UNKNOWN_TOPIC_OR_PARTITION}
(org.apache.kafka.clients.NetworkClient)
[2018-04-16 15:51:41,278] WARN [Consumer clientId=consumer-1, groupId=console-consumer-13964] Error while fetching metadata with correlation id 17 :
{test_set_retention_nwq=UNKNOWN_TOPIC_OR_PARTITION}
(org.apache.kafka.clients.NetworkClient)
答案 0 :(得分:0)
请按照以下步骤操作。
在server.properties(对于3个代理)文件中添加以下行:
listeners=PLAINTEXT://host.name:port
advertised.listeners=PLAINTEXT://host.name:port
其中host.name
是Kafka代理的IP地址或主机名。
重新启动Kafka代理并进行测试。