Understanding the kafka-run-class Bash Script
Almost all the provided Kafka tools eventually call the
script. This script is generally not called directly. However, if you are proficient with bash
and want to understand certain features available in all Kafka scripts as well as some
potential debugging scenarios, familiarity with the
can prove highly beneficial.
For example, there are some useful environment variables that affect all the command line scripts:
KAFKA_DEBUGallows a Java debugger to attach to the JVM launched by the particular script. Setting KAFKA_DEBUG also allows some further debugging customization:
JAVA_DEBUG_PORTsets the JVM debugging port.
JAVA_DEBUG_OPTScan be used to override the default debugging arguments being passed to the JVM.
KAFKA_HEAP_OPTScan be used to pass memory setting arguments to the JVM.
KAFKA_JVM_PERFORMANCE_OPTScan be used to pass garbage collection flags to the JVM.