【问题标题】:"java.nio.channels.UnresolvedAddressException" while starting kafka server启动 kafka 服务器时出现“java.nio.channels.UnresolvedAddressException”
【发布时间】:2021-10-24 21:50:37
【问题描述】:

我在运行“kafka-server-start.bat mypath\server.properties”命令后启动了zookeeper。

在 kafka 服务器窗口中出现以下错误。

 INFO Opening socket connection to server localhost/<unresolved>:2181. Will not attempt to authenticate using SASL (unknown error) (org.apache.zookeeper.ClientCnxn)
 WARN Session 0x0 for server localhost/<unresolved>:2181, unexpected error, closing socket connection and attempting reconnect (org.apache.zookeeper.ClientCnxn)
 java.nio.channels.UnresolvedAddressException
  at java.base/sun.nio.ch.Net.checkAddress(Net.java:149)
  at java.base/sun.nio.ch.Net.checkAddress(Net.java:157)
  at java.base/sun.nio.ch.SocketChannelImpl.checkRemote(SocketChannelImpl.java:815)
  at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:837)
  at org.apache.zookeeper.ClientCnxnSocketNIO.registerAndConnect(ClientCnxnSocketNIO.java:277)
  at org.apache.zookeeper.ClientCnxnSocketNIO.connect(ClientCnxnSocketNIO.java:287)
  at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:1021)
  at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1064)

以下是 server.properties 中的属性

num.network.threads=3
num.io.threads=8
socket.send.buffer.bytes=102400
socket.receive.buffer.bytes=102400
socket.request.max.bytes=104857600
log.dirs=C:\KafkaLog
num.partitions=1
num.recovery.threads.per.data.dir=1
offsets.topic.replication.factor=1
transaction.state.log.replication.factor=1
transaction.state.log.min.isr=1
log.retention.hours=168
log.segment.bytes=1073741824
log.retention.check.interval.ms=300000
zookeeper.connect=localhost:2181
zookeeper.connection.timeout.ms=6000
confluent.support.metrics.enable=true
confluent.support.customer.id=anonymous
group.initial.rebalance.delay.ms=0

Zookeeper 属性是

dataDir=C:\ZookeeperLog
clientPort=2181
maxClientCnxns=0

【问题讨论】:

  • 能否把mypath\server.propertieszookeeper的配置文件的内容包含进去。
  • @SaravanakrishnanPk ,使用服务器和 Zookeeper 配置文件属性编辑问题
  • @OneCricketeer,是的,我在 Windows 上运行
  • 你确定 Zookeeper 真的启动了吗?具体来说,/tmp 在 Windows 上不存在,所以配置文件不正确

标签: windows apache-kafka apache-zookeeper


【解决方案1】:

我们尝试检查以下事项以解决它们。

  1. 更新了配置文件中的 dataDirlog.dirs 属性(用于匹配 windows 平台)
  2. 使用netstat -aon | findstr '2181' 命令验证zookeeper 启动
  3. zookeeper.connect 网址更新为127.0.0.1:2181
  4. hosts 文件中添加了以下Missing 环回条目并重新启动系统。

127.0.0.1 localhost

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-30
    相关资源
    最近更新 更多