Kafka Monitoring

Hi All,

Can I setup monitoring jmx exporter for kafka confluent community license in aws ec2 instance?
I have try for a few days but still failed in setup jmx exporter.

hey @chiee

yes you should be have a look at

did a small readme regarding prometheus (wip at the moment :wink: )

best,
michael

1 Like

Hi @mmuehlbeyer ,

Thanks for answer my question,

I have look and follow that topic. but still getting error when start the kafka using
EXTRA_ARGS.
should I’m install the kafka using TAR?
because i have install kafka using YUM repositories.

best,
chiee

Hi @chiee

should be working with yum installation as well.
could you share some details?

how you’ve started the stack config and so on.

best,
michael

Hi @mmuehlbeyer

I follow this article https://mac-blog.org.ua/kafka-prometheus

this command i used to started kafka.
EXTRA_ARGS=-javaagent:/root/kafka-jmx/jmx_prometheus_javaagent-0.16.1.jar=9102:/root/kafka-jmx/kafka_broker.yml /bin/kafka-server-start /etc/kafka/server.properties

and get error this.
ERROR [KafkaServer id=1001] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
org.apache.kafka.common.KafkaException: Failed to acquire lock on file .lock in /var/lib/kafka2. A Kafka instance in another process or thread is using this directory.
at kafka.log.LogManager.$anonfun$lockLogDirs$1(LogManager.scala:242)
at scala.collection.StrictOptimizedIterableOps.flatMap(StrictOptimizedIterableOps.scala:118)
at scala.collection.StrictOptimizedIterableOps.flatMap$(StrictOptimizedIterableOps.scala:105)
at scala.collection.mutable.ArraySeq.flatMap(ArraySeq.scala:37)
at kafka.log.LogManager.lockLogDirs(LogManager.scala:237)
at kafka.log.LogManager.(LogManager.scala:113)
at kafka.log.LogManager$.apply(LogManager.scala:1319)
at kafka.server.KafkaServer.startup(KafkaServer.scala:267)
at kafka.Kafka$.main(Kafka.scala:109)
at kafka.Kafka.main(Kafka.scala)

ERROR Exiting Kafka. (kafka.Kafka$)
[2022-09-07 06:28:27,794] INFO [KafkaServer id=1001] shutting down (kafka.server.KafkaServer)

best,
Chiee

hey @chiee

would you please check if there is another kafka process running
according to your output

seems there is still something running

best
michael

1 Like

Hi @mmuehlbeyer,

yes, kafka has been running because it’s not fresh installation.
so, i need stop kafka service first? or i need fresh installation to enable jmx exporter?

best,
Chiee

Hi @chiee

you need to stop kafka and zookeeper first and then start both services again.

best,
michael

1 Like

Hi, @mmuehlbeyer

amazing, it’s running now.
Thank you for the advice michael.

best,
Chiee

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.