安装环境
Ubuntu 14.04
Java IBM Java 1.7.0_79
Kakfa 2.10-0.8.2.1
使用bin/kafka-server-start.sh config/server.properties
启动kafka
有如下错误出现
<?xml version="1.0" ?>
<verbosegc xmlns="http://www.ibm.com/j9/verbosegc" version="R27_Java727_SR2_20141017_1632_B217728_CMPRSS">
JVMJ9VM007E Command-line option unrecognised: -Xloggc:/opt/kafka_2.10-0.8.2.1/bin/../logs/kafkaServer-gc.log
</verbosegc>
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
解决方案:
打开bin/kafka-run-class.sh
找到
KAFKA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps "
把-Xloggc替换为-Xverbosegclog如下
KAFKA_GC_LOG_OPTS="-Xverbosegclog:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps"
重新执行
bin/kafka-server-start.sh config/server.properties
启动成功