使用kafka遇到的问题

问题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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值