Skip to main content

Posts

Showing posts from September, 2019

How to run Kafka from source code - Kafka Source Code

Get source code of Kafka, the version is 2.3  git clone -b 2.3 https://github.com/apache/kafka.git Generate Jar File ./gradlew jar Start the zookeeper bin/zookeeper-server-start.sh config/zookeeper.properties Since we are mainly focus on Kafka source code, we won't spend some time to dig into how the zookeeper start by using jars directly. Start the Kafka Server Option 1: start with script bin /kafka-server-start .sh config /server .properties Option 2: If we inspect the real command from kafka-run-class.sh which is called by kafka-start-server.sh, here is the final command to run: exec /Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/bin/java -Xmx1G -Xms1G -server -XX:+UseG1GC -XX:MaxGCPauseMillis=20 -XX:InitiatingHeapOccupancyPercent=35 -XX:+ExplicitGCInvokesConcurrent -Djava.awt.headless=true -Xlog:gc*:file=/Users/leizheng/vcs/github/kafka/kafka-2.3/bin/../logs/kafkaServer-gc.log:time,tags:filecount=10,files