kafka启动成功,删除主题报错
Exception in thread “main” org.I0Itec.zkclient.exception.ZkException: Unable to connect to master:2181
at org.I0Itec.zkclient.ZkConnection.connect(ZkConnection.java:71)
at org.I0Itec.zkclient.ZkClient.connect(ZkClient.java:1227)
at org.I0Itec.zkclient.ZkClient.(ZkClient.java:156)
at org.I0Itec.zkclient.ZkClient.(ZkClient.java:130)
at kafka.utils.ZkUtils
.
c
r
e
a
t
e
Z
k
C
l
i
e
n
t
A
n
d
C
o
n
n
e
c
t
i
o
n
(
Z
k
U
t
i
l
s
.
s
c
a
l
a
:
75
)
a
t
k
a
f
k
a
.
u
t
i
l
s
.
Z
k
U
t
i
l
s
.createZkClientAndConnection(ZkUtils.scala:75) at kafka.utils.ZkUtils
.createZkClientAndConnection(ZkUtils.scala:75)atkafka.utils.ZkUtils.apply(ZkUtils.scala:57)
at kafka.admin.TopicCommand$.main(TopicCommand.scala:54)
at kafka.admin.TopicCommand.main(TopicCommand.scala)
Caused by: java.net.UnknownHostException: master: 未知的名称或服务
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
at java.net.InetAddress.getAllByName(InetAddress.java:1192)
at java.net.InetAddress.getAllByName(InetAddress.java:1126)
at org.apache.zookeeper.client.StaticHostProvider.(StaticHostProvider.java:61)
at org.apache.zookeeper.ZooKeeper.(ZooKeeper.java:445)
at org.apache.zookeeper.ZooKeeper.(ZooKeeper.java:380)
at org.I0Itec.zkclient.ZkConnection.connect(ZkConnection.java:69)
… 7 more
原因:
删除命令bin/kafka-topics.sh --list --zookeeper master:2181
解决:
给出完整的zk集群信息:bin/kafka-topics.sh --list --zookeeper 192.168.150.200:2181,slave1:2181,slave2:2181
kafka
最新推荐文章于 2022-06-16 14:33:46 发布