问题1
-
错误
org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
-
原因1
producer client的Jar包版本与kafka集群版本,不兼容! -
原因2
kafka中指定了PlainText协议后,producer设置kafka配置时一定要保持一致
问题2
- 错误
kafka启动时报以下错误
java.lang.ExceptionInInitializerError
at kafka.network.RequestChannel$Request.<init>(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$.<init>(RequestChannel.scala:39)
at kafka.network.RequestChannel$.<clinit>(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.<init>(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)
- 原因
zookeeper未指定host时,默认设置成了localhost或者主机名(hosts中设置了主机名,见下面配置,默认为webserver-no.03.novalocal),kafka的配置中配置zookeeper信息时要保持一致
172.31.223.174 webserver-no.03.novalocal