新机器,搭建了一台kafka,启动的时候报以下错误,有遇到的么?
java.lang.ExceptionInInitializerError
at kafka.network.RequestChannel$Request.<init>(RequestChannel.scala:110)
at kafka.network.Processor$$anonfun$processCompletedReceives$1.apply(SocketServer.scala:488)
at kafka.network.Processor$$anonfun$processCompletedReceives$1.apply(SocketServer.scala:483)
at scala.collection.Iterator$class.foreach(Iterator.scala:893)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1336)
at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
at kafka.network.Processor.processCompletedReceives(SocketServer.scala:483)
at kafka.network.Processor.run(SocketServer.scala:413)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.UnknownHostException: kafka-61: kafka-61: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1473)
at kafka.network.RequestChannel$.<init>(RequestChannel.scala:38)
at kafka.network.RequestChannel$.<clinit>(RequestChannel.scala)
... 10 more
Caused by: java.net.UnknownHostException: kafka-61: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:901)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1293)
at java.net.InetAddress.getLocalHost(InetAddress.java:1469)
... 12 more
[2016-10-08 11:41:05,242] ERROR Processor got uncaught exception. (kafka.network.Processor)
[2016-10-08 17:22:47,558] WARN Could not initialize class kafka.network.RequestChannel$ (kafka.utils.CoreUtils$)
java.lang.NoClassDefFoundError: Could not initialize class kafka.network.RequestChannel$
at kafka.server.KafkaRequestHandler.shutdown(KafkaRequestHandler.scala:67)
at kafka.server.KafkaRequestHandlerPool$$anonfun$shutdown$2.apply(KafkaRequestHandler.scala:90)
at kafka.server.KafkaRequestHandlerPool$$anonfun$shutdown$2.apply(KafkaRequestHandler.scala:89)
at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
at kafka.server.KafkaRequestHandlerPool.shutdown(KafkaRequestHandler.scala:89)
at kafka.server.KafkaServer$$anonfun$shutdown$3.apply$mcV$sp(KafkaServer.scala:549)
at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:76)
at kafka.utils.Logging$class.swallowWarn(Logging.scala:92)
at kafka.utils.CoreUtils$.swallowWarn(CoreUtils.scala:47)
at kafka.utils.Logging$class.swallow(Logging.scala:94)
at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:47)
at kafka.server.KafkaServer.shutdown(KafkaServer.scala:549)
at kafka.server.KafkaServerStartable.shutdown(KafkaServerStartable.scala:49)
at kafka.Kafka$$anon$1.run(Kafka.scala:63)
配置/etc/hosts,把计算机名kafka-61对应好本机ip,配置好host后,ping kafka-61
感谢~!是因为host没配置,还有这么一大坑!!!
你的答案