java.net.UnknownHostException: 不知道这样的主机。 (5c0c3c629db9)
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[na:na]
at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:933) ~[na:na]
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1543) ~[na:na]
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:852) ~[na:na]
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1532) ~[na:na]
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1384) ~[na:na]
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1305) ~[na:na]
at org.apache.kafka.clients.DefaultHostResolver.resolve(DefaultHostResolver.java:27) ~[kafka-clients-3.3.2.jar:na]
at org.apache.kafka.clients.ClientUtils.resolve(ClientUtils.java:110) ~[kafka-clients-3.3.2.jar:na]
at org.apache.kafka.clients.ClusterConnectionStates$NodeConnectionState.currentAddress(ClusterConnectionStates.java:510) ~[kafka-clients-3.3.2.jar:na]
at org.apache.kafka.clients.ClusterConnectionStates$NodeConnectionState.access$200(ClusterConnectionStates.java:467) ~[kafka-clients-3.3.2.jar:na]
at org.apache.kafka.clients.ClusterConnectionStates.currentAddress(ClusterConnectionStates.java:173) ~[kafka-clients-3.3.2.jar:na]
at org.apache.kafka.clients.NetworkClient.initiateConnect(NetworkClient.java:990) ~[kafka-clients-3.3.2.jar:na]
at org.apache.kafka.clients.NetworkClient.ready(NetworkClient.java:301) ~[kafka-clients-3.3.2.jar:na]
at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.sendEligibleCalls(KafkaAdminClient.java:1143) ~[kafka-clients-3.3.2.jar:na]
at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.processRequests(KafkaAdminClient.java:1403) ~[kafka-clients-3.3.2.jar:na]
at org.apache.kafka.clients.admin.KafkaAdminClient$AdminClientRunnable.run(KafkaAdminClient.java:1346) ~[kafka-clients-3.3.2.jar:na]
at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
解决方式:
将kafka的主机名和服务所在的ip地址配置到C:\Windows\System32\drivers\etc目录下的hosts文件中,并重启服务
例如:文章来源:https://www.toymoban.com/news/detail-626266.html
46.93.165.23 5c0c3c629db9
查看kafka的主机名的方式
文章来源地址https://www.toymoban.com/news/detail-626266.html
到了这里,关于踩坑(5)整合kafka 报错 java.net.UnknownHostException: 不知道这样的主机的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!