Kafka错误记录

Posted ZeroTeam_麒麟

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Kafka错误记录相关的知识,希望对你有一定的参考价值。

java.net.UnknownHostException: master.i2ceo.cn: master.i2ceo.cn: Name or service not known
        at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
        at kafka.server.KafkaHealthcheck$$anonfun$1.apply(KafkaHealthcheck.scala:61)
        at kafka.server.KafkaHealthcheck$$anonfun$1.apply(KafkaHealthcheck.scala:59)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
        at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
        at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
        at scala.collection.TraversableLike$class.map(TraversableLike.scala:244)
        at scala.collection.AbstractTraversable.map(Traversable.scala:105)
        at kafka.server.KafkaHealthcheck.register(KafkaHealthcheck.scala:59)
        at kafka.server.KafkaHealthcheck.startup(KafkaHealthcheck.scala:51)
        at kafka.server.KafkaServer.startup(KafkaServer.scala:269)
        at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:39)
        at kafka.Kafka$.main(Kafka.scala:67)
        at kafka.Kafka.main(Kafka.scala)
Caused by: java.net.UnknownHostException: master.i2ceo.cn: Name or service not known
        at java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
        at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
        at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
        at java.net.InetAddress.getLocalHost(InetAddress.java:1500)

        ... 14 more


解决方法:

提示的是Host找不到,在/etc/Hosts中映射的ip名称和主机名一致就可以了


以上是关于Kafka错误记录的主要内容,如果未能解决你的问题,请参考以下文章

微服务如何记录kafka节点异常

kafka 部分问题处理记录

带有Spring Cloud Stream的Kafka Streams进程中的Serd错误

批处理模式下 Spring Boot kafka 中的错误处理

Kafka Producer 无法验证没有 PK 的记录并返回 InvalidRecordException

Kafka升级v1.1的错误以及性能总结