kafka超时连接到macos/mojave上的节点

cwxwcias  于 2021-06-05  发布在  Kafka
关注(0)|答案(1)|浏览(480)

在这里使用快速入门

https://kafka.apache.org/quickstart

我遵循步骤,但当我执行

bin/kafka-topics.sh --list --bootstrap-server localhost:9092

我得到:

Caused by: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.

我将list命令改为
bin/kafka-topics.sh—列表—zookeeperlocalhost:2181
很好用。
我试着检测这些样本

https://github.com/spring-projects/spring-kafka/tree/master/samples

不工作,我得到:

org.springframework.kafka.KafkaException: Timed out waiting to get existing topics; nested exception is java.util.concurrent.TimeoutException

这种情况发生在公司的笔记本电脑上
我在我的私人macos(sierra)上使用

bin/kafka-topics.sh --list --bootstrap-server localhost:9092

它工作得很好,所有的Spring样品也工作得很好
在不工作的机器上:
我试着使用Kafka列出的ip地址

[2020-02-28 14:12:31,202] WARN [Controller id=0, targetBrokerId=0] Connection to node 0 (/92.242.132.25:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)

这样地 --bootstrap-server 92.242.132.25:9092 那没用
顺便说一句,ip地址(92.242.132.25)与我从ifconfig获得的地址不同,它是:

192.168.1.35

我两个都试过了,都没用。
然而 telnet localhost 9092 没有连接。
知道发生了什么吗?为什么? --bootstrap-server localhost:9092 不起作用吗?
为什么ip地址(来自kafka启动输出和ifconfig)不同?
公司的mac操作系统是否有可能导致这种情况的限制(防火墙等)?他们说不。

1wnzp6jl

1wnzp6jl1#

如果您只需要在本地运行kafka进行开发,docker上的confluent平台更易于启动和运行,请参阅https://docs.confluent.io/current/quickstart/ce-docker-quickstart.html

相关问题