I was looking to setup jmx monitoring for Apache Kafka.
Seems straightforward. Edit the server start and add something like what is below.
if [ “x$KAFKA_JMX_OPTS” = “x” ]; then
export KAFKA_JMX_OPTS=" -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9000 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file=/home/kafka/jmx11_remote/jmxremote.password -Dcom.sun.management.jmxremote.access.file=/home/kafka/jmx11_remote/jmxremote.access"
fi
The issue I have is if I have a systemd file kafka@.service that calls the common server start file for multiple brokers, I will have port collision.
Is there a better way of doing this?