[英]Consuming message from a kafka topic in fastapi app and sending it specific client
[英]Error message with Kafka basic setup creating topic and sending messages
我正在嘗試設置我的Kafka,但遇到一些關鍵問題。 我什至無法創建主題或發送消息。 我的Kafka版本號是:0.9.0.1感謝您的幫助。
下面請找到我的錯誤消息:
[2016-04-21 04:41:19,306] producer ERROR LEADER_NOT_AVAILABLE
Traceback (most recent call last):
File "", line 38, in <module>
producer.send_messages('abc.incoming_urls', json.dumps({'appid': 'channels', 'crawlid': 'category-%s' % (category), 'spiderid': 'abc', 'url': url, 'useragent': 'News/5.1.1 (iPhone; iOS 9.2; Scale/3.00)', 'attrs': {'id': category, '_': datetime.utcnow().isoformat()}}))
File "C:\Python27\lib\site-packages\kafka\producer\simple.py", line 52, in send_messages
partition = self._next_partition(topic)
File "C:\Python27\lib\site-packages\kafka\producer\simple.py", line 36, in _next_partition
self.client.load_metadata_for_topics(topic)
File "C:\Python27\lib\site-packages\kafka\client.py", line 505, in load_metadata_for_topics
kafka.common.check_error(topic_metadata)
File "C:\Python27\lib\site-packages\kafka\common.py", line 255, in check_error
raise error_class(response)
LeaderNotAvailableError: TopicMetadata(topic='abc.incoming_urls', error=5, partitions=[])
請注意server.properties中的advertised.host.name參數,該參數可能會在zookeeper中注冊錯誤的主機名並阻止傳入的連接。
< #advertised.host.name=<hostname routable by clients>
---
> advertised.host.name=xxx
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.