Could not initialize class kafka.network.RequestChannel

./bin/kafka-server-start.sh -daemon ./config/server.properties & 启动kafka 服务报一下异常信息

[2016-03-29 14:30:42,776] ERROR Processor got uncaught exception. (kafka.network.Processor)
java.lang.NoClassDefFoundError: Could not initialize class kafka.network.RequestChannel$
	at kafka.network.RequestChannel$Request.(RequestChannel.scala:93)
	at kafka.network.Processor$$anonfun$run$11.apply(SocketServer.scala:426)
	at kafka.network.Processor$$anonfun$run$11.apply(SocketServer.scala:421)
	at scala.collection.Iterator$class.foreach(Iterator.scala:742)
	at scala.collection.AbstractIterator.foreach(Iterator.scala:1194)
	at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
	at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
	at kafka.network.Processor.run(SocketServer.scala:421)




解决办法:
杀掉kafka集群其它broker 服务。
继续启动,报下列异常
java.lang.ExceptionInInitializerError
        at kafka.network.RequestChannel$Request.(RequestChannel.scala:93)
        at kafka.network.Processor$$anonfun$run$11.apply(SocketServer.scala:426)
        at kafka.network.Processor$$anonfun$run$11.apply(SocketServer.scala:421)
        at scala.collection.Iterator$class.foreach(Iterator.scala:742)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1194)
        at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
        at kafka.network.Processor.run(SocketServer.scala:421)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.UnknownHostException: bj_server_74: bj_server_74: unknown error
        at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
        at kafka.network.RequestChannel$.(RequestChannel.scala:39)
        at kafka.network.RequestChannel$.(RequestChannel.scala)
        ... 9 more
Caused by: java.net.UnknownHostException: bj_server_74: unknown error
        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.getLocalHost(InetAddress.java:1500)
        ... 11 more
[2016-03-29 14:23:54,586] ERROR Processor got uncaught exception. (kafka.network.Processor)
java.lang.NoClassDefFoundError: Could not initialize class kafka.network.RequestChannel$
        at kafka.network.RequestChannel$Request.(RequestChannel.scala:93)
        at kafka.network.Processor$$anonfun$run$11.apply(SocketServer.scala:426)
        at kafka.network.Processor$$anonfun$run$11.apply(SocketServer.scala:421)
        at scala.collection.Iterator$class.foreach(Iterator.scala:742)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1194)
        at scala.collection.IterableLike$class.foreach(IterableLike.scala:72)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:54)
        at kafka.network.Processor.run(SocketServer.scala:421)
        at java.lang.Thread.run(Thread.java:745)


 
  


修改hosts文件
vim /etc/hosts

192.168.20.74 bj_server_74


保存后,继续启动,无异常信息。

你可能感兴趣的:(KAFKA)