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

前端 未结 8 2185
孤独总比滥情好
孤独总比滥情好 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: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= -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
    

提交回复
热议问题