1、org.apache.kafka.common.errors.TimeoutException: Batch Expired
解决方法:配置kafka(config/server.properties)参数,把advertised.host.name设置成ip地址
advertised.host.name=
2、执行sbt clean dist 出错(安装kafka Manager)
[error] java.lang.UnsupportedClassVersionError: com/typesafe/config/ConfigException : Unsupported major.minor version 52.0
解决方法:安装java 8 使用以下命令。
PATH=/opt/java/jdk1.8.0_73/bin:$PATH \
JAVA_HOME=/opt/java/jdk1.8.0_73 \
sbt -java-home /opt/java/jdk1.8.0_73 clean dist
附:Java SE 8 = 52 Java SE 7 = 51 Java SE 6.0 = 50
3、执行kafka-manager-1.3.0.4/bin/kafka-manager 出错
Could not find a suitable constructor in controllers.api.KafkaStateCheck. Classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
at controllers.api.KafkaStateCheck.class(KafkaStateCheck.scala:19)
while locating controllers.api.KafkaStateCheck
for parameter 8 at router.Routes.(Routes.scala:63)
while locating router.Routes
while locating play.api.inject.RoutesProvider
while locating play.api.routing.Router
解决方法:
edit file /home/liuyaohua/tools/kafka/kafka-manager/kafka-manager-1.3.0.4/conf/application.ini
and replace path /var/run/${{app_name}}.pid with -Dconfig.file=/home/liuyaohua/tools/kafka/kafka-manager/kafka-manager-1.3.0.4/conf/application.conf -Dhttp.port=8083
4、生产者可正常成产消息,消费者不能获取消息
原因:
1)使用kafka-manager删除主题“__consumer_offsets”类中的所有消息
2)修改了配置文件“server.properties”中broker.id的值
推测:删除主题“__consumer_offsets”,导致无法从zookeeper获取offset
另:不推荐在kafka的配置文件“server.properties”中配置delete.topic.enable=true,默认为false。true意味着允许用户删除指定主题消息,稍有不慎会删除重要数据。
解决方法:
重新部署zookeeper并删除kafka的所有消息
沟通交流请关注公众号。