kafka启动报错Caused by: java.net.UnknownHostException: Cent65: Cent65: Name or service not known【原创】
故障描述:
上周云服务器重启了,上面的kafka再启动时就报错“Caused by: java.net.UnknownHostException: Cent65: Cent: Name or service not known”
而且看kafka-monitor,也不再群集里。
解决办法:在本机hosts解析添加主机名解析,再启动时恢复了。
事后分析原因:
查看kafka日志,发现报错是[2023-08-04 ] INFO Client environment:host.name=<NA> (org.apache.zookeeper.ZooKeeper
host.name是NA,怀疑当时启动时没有看环境变量,会不会当时主机名没有呢?因为系统上线部署时开发都没添加hosts主机名解析,后来咨询云平台主机名可以同网段自己解析,所以没添加。
补充:在3台服务器都添加本地hosts解析,以免出现此种情况
参考
kafka启动报错ERROR Processor got uncaught exception以及彻底删除topic - Frank-hui - 博客园
https://www.cnblogs.com/frank-hui/p/13522981.html
Kafka启动日志报错 WARN Found a corrupted index file due to requirement failed: Corrupt index found 【已解决】_北九二七的博客-CSDN博客
https://blog.csdn.net/m0_62866192/article/details/121578220
java.net.UnknownHostException:Name or Service not known_unknownhostexception name or service not known_没有名字的程序猿的博客-CSDN博客
https://blog.csdn.net/riverJiant/article/details/81485911
kafka启动报错:java.net.UnknownHostException|unknown error at java.net.Inet6AddressImpl.lookupAllHost 很详细_血煞长虹的博客-CSDN博客
https://blog.csdn.net/succing/article/details/127217791