gpt4 book ai didi

apache-kafka - 为什么服务器启动时会失败并显示 "java.net.SocketException: invalid argument"?

转载 作者:行者123 更新时间:2023-12-01 16:11:31 25 4
gpt4 key购买 nike

卡夫卡0.8

我按照快速入门指南进行操作,当我进入第 2 步运行 bin/kafka-server-start.sh config/server.properties 时,我遇到了异常:

[2013-08-06 09:55:14,603] INFO 0 successfully elected as leader (kafka.server.ZookeeperLeaderElector)
[2013-08-06 09:55:14,657] ERROR Error while electing or becoming leader on broker 0 (kafka.server.ZookeeperLeaderElector)
java.net.SocketException: invalid argument
at sun.nio.ch.Net.connect0(Native Method)
at sun.nio.ch.Net.connect(Net.java:465)
at sun.nio.ch.Net.connect(Net.java:457)
at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:639)
at kafka.network.BlockingChannel.connect(BlockingChannel.scala:57)
at kafka.controller.ControllerChannelManager.kafka$controller$ControllerChannelManager$$addNewBroker(ControllerChannelManager.scala:84)
at kafka.controller.ControllerChannelManager$$anonfun$1.apply(ControllerChannelManager.scala:35)
at kafka.controller.ControllerChannelManager$$anonfun$1.apply(ControllerChannelManager.scala:35)
at scala.collection.immutable.Set$Set1.foreach(Set.scala:81)
at kafka.controller.ControllerChannelManager.<init>(ControllerChannelManager.scala:35)
at kafka.controller.KafkaController.startChannelManager(KafkaController.scala:503)
at kafka.controller.KafkaController.initializeControllerContext(KafkaController.scala:467)
at kafka.controller.KafkaController.onControllerFailover(KafkaController.scala:215)
at kafka.controller.KafkaController$$anonfun$1.apply$mcV$sp(KafkaController.scala:89)
at kafka.server.ZookeeperLeaderElector.elect(ZookeeperLeaderElector.scala:53)
at kafka.server.ZookeeperLeaderElector$LeaderChangeListener.handleDataDeleted(ZookeeperLeaderElector.scala:106)
at org.I0Itec.zkclient.ZkClient$6.run(ZkClient.java:549)
at org.I0Itec.zkclient.ZkEventThread.run(ZkEventThread.java:71)

我可能做错了什么?请指教。

最佳答案

这可能是名称解析问题,或者是 0.7 版本的剩余设置问题。

如果您要从 0.7 迁移,请参阅 migration guide .

如果您是新手,请确保/etc/hosts 中有一个准确的主机名条目。

例如给定一个 /etc/hostname 文件,其中包含

yourhostname

和一个接口(interface) (/sbin/ifconfig),使用 10.181.11.14 示例 IP 进行监听

/etc/hosts 应正确将该名称映射到监听接口(interface):

10.181.11.14    yourhostname.yourdomain.com       yourhostname   someotheralias

您可以通过telnet到kafka端口并确保没有超时来测试它:

telnet yourhostname.yourdomain.com 9092
Trying 10.181.11.14...
Connected to yourhostname.yourdomain.com.
Escape character is '^]'.

关于apache-kafka - 为什么服务器启动时会失败并显示 "java.net.SocketException: invalid argument"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18099122/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com