使用statsd设置Kafka群集的监控系统。我正在使用statsd库here。目前我的代理服务器无法启动。
我很肯定我的问题在于server.properties
文件中的此配置行:metric.reporters=com.airbnb.kafka.kafka08.StatsdMetricsReporter
。
当我评论该线路时,服务器启动。天啊,我甚至得到这样的统计确认:
[2017-06-06 15:19:35,669] INFO Reporter is enabled and starting... (com.airbnb.metrics.StatsDReporter)
[2017-06-06 15:19:35,679] INFO Started Reporter with host=localhost, port=8125, polling_period_secs=10, prefix= (com.airbnb.metrics.StatsDReporter)
但是,我没有报告统计数据(我相信),因为这也是正确的:metric.reporters = []
。因此,导致问题的那一行必须存在于属性文件中,对吗?
当我尝试启动服务器时,它会失败并显示以下消息:
[2017-06-06 15:21:34,712] FATAL [Kafka Server 0], Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
java.lang.ClassCastException: class com.airbnb.kafka.kafka08.StatsdMetricsReporter
at java.lang.Class.asSubclass(Class.java:3404)
at org.apache.kafka.common.utils.Utils.newInstance(Utils.java:356)
at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:243)
at kafka.server.KafkaServer.startup(KafkaServer.scala:198)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:39)
at kafka.Kafka$.main(Kafka.scala:67)
at kafka.Kafka.main(Kafka.scala)
[2017-06-06 15:21:34,713] INFO [Kafka Server 0], shutting down (kafka.server.KafkaServer)
[2017-06-06 15:21:34,714] INFO Terminate ZkClient event thread. (org.I0Itec.zkclient.ZkEventThread)
[2017-06-06 15:21:34,718] INFO Session: 0x15c7ed717e30004 closed (org.apache.zookeeper.ZooKeeper)
[2017-06-06 15:21:34,720] INFO EventThread shut down for session: 0x15c7ed717e30004 (org.apache.zookeeper.ClientCnxn)
[2017-06-06 15:21:34,720] INFO [Kafka Server 0], shut down completed (kafka.server.KafkaServer)
[2017-06-06 15:21:34,720] FATAL Fatal error during KafkaServerStartable startup. Prepare to shutdown (kafka.server.KafkaServerStartable)
java.lang.ClassCastException: class com.airbnb.kafka.kafka08.StatsdMetricsReporter
at java.lang.Class.asSubclass(Class.java:3404)
at org.apache.kafka.common.utils.Utils.newInstance(Utils.java:356)
at org.apache.kafka.common.config.AbstractConfig.getConfiguredInstances(AbstractConfig.java:243)
at kafka.server.KafkaServer.startup(KafkaServer.scala:198)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:39)
at kafka.Kafka$.main(Kafka.scala:67)
at kafka.Kafka.main(Kafka.scala)
[2017-06-06 15:21:34,721] INFO [Kafka Server 0], shutting down (kafka.server.KafkaServer)
记录中,这是我的配置:
kafka:type=com.airbnb.kafka.kafka08.StatsdMetricsReporter
metric.reporters=com.airbnb.kafka.kafka08.StatsdMetricsReporter
kafka.metric.reporters=com.airbnb.kafka.kafka08.StatsdMetricsReporter
external.kafka.statsd.reporter.enabled=true
external.kafka.statsd.host=localhost
external.kafka.statsd.port=8125
external.kafka.statsd.metrics.prefix=
external.kafka.statsd.tag.enabled=true
答案 0 :(得分:0)
我找到了答案。我不得不使用kafka09
而不是kafka08
。