Kafka 无法识别的 VM 选项“PrintGCDateStamps" [英] Kafka Unrecognized VM option 'PrintGCDateStamps'

查看:52
本文介绍了Kafka 无法识别的 VM 选项“PrintGCDateStamps"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在远程服务器上安装了 Kafka,当我尝试运行时

I installed Kafka on a remote server, and when I tried to run

~/kafka/bin/zookeeper-server-start.sh ~/kafka/config/zookeeper.properties

我收到一个错误

Unrecognized VM option 'PrintGCDateStamps'

并且kafka服务器启动失败.这不是在虚拟机中运行,而是直接在正确安装 Java 的 Ubuntu Server 16.04 上运行.有什么办法可以简单地纠正这个问题?

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?

推荐答案

实际上,Kafka 与较新版本的 Java 一起工作得很好.我也遇到了同样的问题,在kafka/bin/kafka-run-class.sh脚本中发现错误,Java版本解析错误.

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')

这使得 if [[ "$JAVA_MAJOR_VERSION" -ge "9" ]] 条件无法识别正确的 Java 版本,并添加了一些不受支持的 GC 选项.

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')

我已将此报告为 Kafka 的问题.问题可以在这里找到:https://issues.apache.org/jira/browse/KAFKA-6855

I have reported this as an issue with Kafka. The issue can be found here: https://issues.apache.org/jira/browse/KAFKA-6855

对此有一个已提交的修复:https://github.com/apache/卡夫卡/提交/e9f86c3085fa8b65e77072389e0dd147b744f117

There is a committed fix for this: https://github.com/apache/kafka/commit/e9f86c3085fa8b65e77072389e0dd147b744f117

这篇关于Kafka 无法识别的 VM 选项“PrintGCDateStamps"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆