Kafka Unrecognized VM option 'PrintGCDateStamps'

前端 未结 7 1327
梦毁少年i
梦毁少年i 2021-02-02 12:12

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 r

7条回答
  •  忘了有多久
    2021-02-02 12:45

    Like the other answers -- I got this to work on Java 9. Had to make the following changes:

    1. Edit the file bin/kafka-run-class.sh

    2. Near the end of the file (around line 248) find the following block:

    if [ "x$GC_LOG_ENABLED" = "xtrue" ]; then GC_LOG_FILE_NAME=$DAEMON_NAME$GC_FILE_SUFFIX KAFKA_GC_LOG_OPTS="-Xloggc:$LOG_DIR/$GC_LOG_FILE_NAME -verbose:gc -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps " fi

    1. Remove the 2 flags : -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps and save the file.

    2. Kafka should start okay on Java 9

提交回复
热议问题