我有麻烦连接从我的主机(Windows)到客户(Linux),我安装了卡夫卡。连接到卡夫卡VirtualBox
我已经设置了一个VM(带有VirtualBox),我安装了Confluent工具。在此VM中,我运行以下命令:
confluent start schema-registry
它启动zookeeper,kafka和模式注册表。
在这个虚拟机,我可以运行
kafka-console-producer --broker-list localhost:9092 --topic test
和
kafka-console-consumer --bootstrap-server localhost:9092 --topic test
,一切工作正常,我可以产生和接收消息。
我的目标然而,能够生产从我的主机消耗的消息,所以我建立这个端口转发规则:
从我的窗户,我期待这个命令工作:
bin\windows\kafka-console-producer.bat --broker-list 127.0.0.1:9092 --topic test
但我得到的是这样的:
ERROR Error when sending message to topic test with key: null, value: 3 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)
org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for test-0: 1529 ms has passed since batch creation plus linger time
我已经尝试了很多不同的东西,但仍然无法找到解决办法的....你的想法?
非常感谢你的帮助,我真的感觉在这里丢失。 Linux Guest的主机名是kafka-VirtualBox。在advertised.listeners,我现在有这样的: advertised.listeners = PLAINTEXT://卡夫卡的VirtualBox:9092 和Windows主机,我加入这行到主机文件: 127.0.0.1卡夫卡-VirtualBox 我仍然有同样的错误虽然.... – Florian
嗯...... 然后,它需要解决一步一步来。 首先,确认“是否有kafka命令可以访问kafka-VirtualBox?”由kafka-topics.bat。 – kimutansk
我张贴在路上。 然后,它需要解决一步一步来。首先,确认“是否允许kafka命令访问kafka-VirtualBox?”由kafka-broker-api-versions.bat。 如果命令不能访问到卡夫卡的VirtualBox,这个问题是虚框的网络设置问题。 如果命令可以访问到卡夫卡的VirtualBox,这个麻烦变得卡夫卡的经纪人或客户端设置问题。 – kimutansk