I installed Kafka on a remote server, and when I tried to run
~/kafka/bin/zookeeper-server-start.sh ~/kafka/config/zookeeper.properties
And I received an error
Unrecognized VM option 'PrintGCDateStamps'
And the kafka server failed to start. This was not being run in a vm, and was being run directly on Ubuntu Server 16.04 with Java properly installed. Any way this can be corrected simply?
Actually, Kafka works fine with newer versions of Java. I had the same problem, and found an error in the kafka/bin/kafka-run-class.sh
script, where the Java version was incorrectly parsed.
This line grabs too much of the version string:
JAVA_MAJOR_VERSION=$($JAVA -version 2>&1 | sed -E -n 's/.* version "([^.-]*).*"/\1/p')
This makes the if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]]
condition fail to identify the correct Java version, and adds some unsupported GC options.
Changing the line above to this solved my problem:
JAVA_MAJOR_VERSION=$($JAVA -version 2>&1 | sed -E -n 's/.* version "([^.-]*).*/\1/p')
I have reported this as an issue with Kafka. The issue can be found here: https://issues.apache.org/jira/browse/KAFKA-6855
EDIT: There is a committed fix for this: https://github.com/apache/kafka/commit/e9f86c3085fa8b65e77072389e0dd147b744f117
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With