简体   繁体   English

元数据响应-代理主机名错误

[英]MetaData Response - Broker hostname is wrong

I use python-kafka's SimpleConsumer to listen to a topic in kafka broker. 我使用python-kafka的SimpleConsumer来收听kafka代理中的主题。 Kafka broker is running on a machine with its hostname as BROKER_HOST. Kafka代理正在其主机名为BROKER_HOST的计算机上运行。 Now, SimpleConsumer requests for topic metadata from the broker BROKER_HOST for a topic TOPIC & gets a tuple 现在,SimpleConsumer向代理BROKER_HOST请求主题元数据以获取主题TOPIC,并获取一个元组

   (Broker metadata, Topic metadata)

Broker metadata comes as, 经纪人中继资料的来源如下:

 {0: BrokerMetadata(nodeId=0, host='localhost', port=9092)}

and ideally, host value must be BROKER_HOST( hostname shell cmd confirms it) but it is localhost... 理想情况下,主机值必须为BROKER_HOST( hostname shell cmd确认),但它为localhost ...

``How does the broker metadata for a topic get into kafka system? ``主题的经纪人元数据如何进入kafka系统? And obviously, this breaks the system since my consumer tries to connect to 9092 on its localhost. 显然,这破坏了系统,因为我的使用者尝试连接到其本地主机上的9092。

This looks like your broker advertises itself incorrectly. 看来您的经纪人自己做错了广告。

There's a line in your broker's server.properties : 经纪人的server.properties有一行:

#advertised.host.name=<hostname routable by clients>

You should uncomment it and set the value routable by your consumer and restart your broker. 您应该取消注释它,并设置消费者可路由的值,然后重新启动经纪人。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 卡夫卡经纪人是否存储元数据? - Does Kafka broker store metadata? Kafka生产者无法从代理中获取元数据 - Kafka producer fails fetching metadata from broker Kafka 集群:为什么我们要为一个集群使用多个代理主机名 - Kafka Cluster : Why should we use several broker hostname for a cluster Kafka生产者使用url配置metadata.broker.list - Kafka producer config metadata.broker.list with url 代理长时间重新启动后,加载偏移量和元数据块KafkaConsumer - Loading offsets and metadata blocks KafkaConsumer after broker restart for a long time KafkaConsumer 连接到错误的代理,因此无法消费 - KafkaConsumer connects to the wrong broker, and therefore cannot consume Kafka 代理正常关闭,错误的元数据被传递到 Kafka 连接客户端 - A Kafka broker is gracefully shutdown, and incorrect metadata was passed to the Kafka connect client 卡夫卡新生产者无法在其中一个代理关闭后更新元数据 - kafka new producer is not able to update metadata after one of the broker is down 无法使用Sarama Golang软件包创建Kafka生产者客户端-“客户端/元数据在获取元数据时从代理处出错:EOF” - Unable to create Kafka producer client with Sarama Golang package-“client/metadata got error from broker while fetching metadata: EOF” 主题测试(PartCnt 0)的元数据回复错误:代理:未知主题或分区&#39;}使用node-rdkafka - Error in metadata reply for topic test (PartCnt 0): Broker: Unknown topic or partition' } using node-rdkafka
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM