使用 Windows Subsystem For Linux 运行的 Kafka 的连接超时 [英] Connection timeout with a Kafka running with Windows Subsystem For Linux

查看:24
本文介绍了使用 Windows Subsystem For Linux 运行的 Kafka 的连接超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 Windows 10 笔记本电脑上的 Windows SubSystem for Linux 下安装了 Kafka 1.1.0 和 Zookeeper 3.4.12.我可以在 ubuntu 中生成和使用消息,但是当我想从 Windows 生成消息(使用 java 程序或工具 kafka-console-producer.bat)时,出现以下错误:

[2018-05-11 15:31:01,449] ERROR 向主题测试发送消息时出错,key: null, value: 15 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback)org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for test-0: 1534 ms 自批处理创建加上延迟时间过去了

有什么想法吗?

解决方案

我有一个类似的问题,我解决了它从控制台测试 kafka 像这样:

  1. 创建主题:bin/kafka-topics.sh --zookeeper zooker-domain:2181 --create --topic test --replication-factor 1 --partitions 1

  2. 插入消息:bin/kafka-console-producer.sh --broker-list kafka-domain:9092 --topic 测试

  3. 消费消息:(旧API)bin/kafka-console-consumer.sh --zookeeper zookeeper-domain:2181 --topic test --from-beginning
    (或使用新的api)bin/kafka-console-consumer.sh --new-consumer --topic test --from-beginning --bootstrap-server kafka-domain:9092 --partition 0

(您可以直接使用 IP 代替域).

我使用 kafka 0.11.0.1 对其进行了测试,并且可以正常工作.

如果仍有问题,请尝试:https://stackoverflow.com/a/51071306/2493852>

I have installed Kafka 1.1.0 with Zookeeper 3.4.12 under Windows SubSystem for Linux on my Windows 10 laptop. I'm able to procude and consume messages while I stay in ubuntu but when I want to produce a message from windows (with a java program or with the tool kafka-console-producer.bat) I have the following error :

[2018-05-11 15:31:01,449] ERROR Error when sending message to topic test with key: null, value: 15 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback) org.apache.kafka.common.errors.TimeoutException: Expiring 1 record(s) for test-0: 1534 ms has passed since batch creation plus linger time

Any idea ?

解决方案

I had a similar issue and I solved it testing kafka from console like this:

  1. Creating a topic: bin/kafka-topics.sh --zookeeper zooker-domain:2181 --create --topic test --replication-factor 1 --partitions 1

  2. Inserting a message: bin/kafka-console-producer.sh --broker-list kafka-domain:9092 --topic test

  3. Consuming messages: (old api) bin/kafka-console-consumer.sh --zookeeper zookeeper-domain:2181 --topic test --from-beginning
    (or with new api) bin/kafka-console-consumer.sh --new-consumer --topic test --from-beginning --bootstrap-server kafka-domain:9092 --partition 0

(Instead of domains you can use directly IPs).

I tested it with kafka 0.11.0.1 and it works.

If you still have problems try with: https://stackoverflow.com/a/51071306/2493852

这篇关于使用 Windows Subsystem For Linux 运行的 Kafka 的连接超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆