How do I set the Java options for Kafka?

后端 未结 6 1664
轮回少年
轮回少年 2020-12-13 06:12

I\'ve been experimenting with Kafka and saw from the documentation on the main site that you\'re able to set different options for the jvm like heap size and the garbage col

6条回答
  •  眼角桃花
    2020-12-13 06:47

    Looking at kafka-run-classh.sh - kafka uses the following variables:

    • $KAFKA_HEAP_OPTS
    • $KAFKA_JVM_PERFORMANCE_OPTS
    • $KAFKA_GC_LOG_OPTS
    • $KAFKA_JMX_OPTS
    • $KAFKA_LOG4J_OPTS

    You can run it via:

    export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G" 
    export KAFKA_JMX_OPTS="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12346 -Dcom.sun.management.jmxremote.rmi.port=12346 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" 
    bin/kafka-server-start.sh -daemon config/server.properties
    

提交回复
热议问题