Cassandra无法创建Java虚拟机 [英] Cassandra could not create Java Virtual Machine

查看:527
本文介绍了Cassandra无法创建Java虚拟机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Mac OS上,运行 cassandra -f 并立即发生这种情况:

I am on a Mac OS and I run cassandra -f and immediately this happens:

[0.002s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:/usr/local/apache-cassandra-3.0.10/logs/gc.log instead.
Unrecognized VM option 'UseParNewGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.```

我不知道为什么会这样。我做了正确的

I have no idea why this is happening. I did the proper

export CASSANDRA_HOME=/usr/local/apache-cassandra-3.0.10
export PATH=$PATH:$CASSANDRA_HOME/bin

但是它仍然不能正常工作。

But still it isnt working properly.

我的Java版本有问题吗?我该如何完整安装Cassandra干净/使其工作?

Is it something with my Java version? How can I do a complete clean install of Cassandra/get this to work?

推荐答案

在该版本的Cassandra中, UseParNewGC 设置在 jvm.options 文件中定义。这是CMS GC JVM设置中的第一个设置。

In that version of Cassandra, the UseParNewGC setting is defined in the jvm.options file. It is the first setting in the block of CMS GC JVM settings.

#################
#  GC SETTINGS  #
#################

### CMS Settings

-XX:+UseParNewGC
-XX:+UseConcMarkSweepGC
-XX:+CMSParallelRemarkEnabled

我怀疑正在发生以下两种情况之一。

I suspect one of two things are going on.


  1. - XX:+ UseParNewGC 设置不正确。

  2. 更可能的情况是,对jmv.options文件上方的先前错误编辑是:我上面显示的块导致了问题。由于 -XX:+ UseParNewGC 行是该块的第一行,因此错误出现在此处。上面的部分是设置堆大小参数的位置,因此我将检查是否未对注释进行注释,或者是否未正确关闭引号。

  3. 使用<$检查Java版本c $ c> java -version 。较新版本的Java(例如10或11及更高版本)不支持并行垃圾收集器。另外, Cassandra 3.x仅在Java 8上运行,因此您确实没有理由使用最新的JVM。

  1. It's possible that the -XX:+UseParNewGC setting is not appropriately specified. Double check this in your jvm.options file.
  2. The more-likely scenario, is that a previous, erroneous edit made to the jmv.options file above the block I have shown above, is causing the issue. As the -XX:+UseParNewGC line is the first line in this block, the error appears to be here. The section above is where the heap sizing parameters are set, so I would check to see if something was uncommented or perhaps a quote was not properly closed.
  3. Check your Java version with a java -version. Newer versions of Java (like 10 or 11 and higher) do not support the parallel garbage collector. Also, Cassandra 3.x only runs on Java 8, so you really don't have a reason to be on a recent JVM like that.

这篇关于Cassandra无法创建Java虚拟机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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