How to enable remote JMX on Kafka brokers (for JmxTool)?

前端 未结 8 2166
孤独总比滥情好
孤独总比滥情好 2020-12-05 02:51

I enabled JMX on Kafka brokers by adding

KAFKA_JMX_OPTS=\"-Dcom.sun.management.jmxremote=true
                -Dcom.sun.management.jmxremote.authenticate=fa         


        
相关标签:
8条回答
  • 2020-12-05 03:30

    Kafka has provided all you need. When your start your server, activate the KAFKA_JMX_OPTS arg by using these command:

    $KAFKA_JMX_OPTS JMX_PORT=[your_port_number] ./kafka-server-start.sh -daemon ../config/server.properties

    Using those command, you activated JMX Remote and related port. Then you can connect your JConsole or another monitoring tools.

    0 讨论(0)
  • 2020-12-05 03:32
    vim kafka_2.11-0.10.1.1/bin/kafka-run-class.sh
    

    and then add the first two lines and comment as I have done for other lines, (Note : after doing this Kafka scripts cannot be used for client operations for listing topics.. for your client operations you need to use a separate scripts , download again in different locations and use)

    export JMX_PORT=9096
    KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.rmi.server.hostname=<ipaddress> -Dcom.sun.management.jmxremote.port=$JMX_PORT -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT"
    
    
    
    # JMX settings
    #if [ -z "$KAFKA_JMX_OPTS" ]; then
    # KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false  -Dcom.sun.management.jmxremote.ssl=false "
    
    #fi
    
    # JMX port to use
    #if [  $JMX_PORT ]; then
    #  KAFKA_JMX_OPTS="$KAFKA_JMX_OPTS -Dcom.sun.management.jmxremote.port=$JMX_PORT "
    #fi
    
    0 讨论(0)
提交回复
热议问题