[英]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.