How do I set the Java options for Kafka?

后端 未结 6 1634
轮回少年
轮回少年 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:35

    Modifying a script in the bin directory is highly unrecommended. When upgrading Kafka to the next version, extracting the new binaries would override the changes made in the script.

    The preferred way should be to set the environment variable KAFKA_HEAP_OPTS outside the script.

    export KAFKA_HEAP_OPTS="-Xmx1G -Xms1G"

    If the var is set before starting Kafka via the script it will use the var instead of the default values defined in /bin/kafka-server-start.sh

提交回复
热议问题