Cassandra and Java 9 - ThreadPriorityPolicy=42 is outside the allowed range

谁都会走 提交于 2019-11-28 08:14:35

I had exactly the same issue: Can't start Cassandra (Single-Node Cluster on CentOS7)

If it is an option for you, using Java 8, instead of 9, is the simplest way to solve the issue.

Jay Wojick

@Martin Matak Just comment out that line in the conf/jvm.options file:

########################
# GENERAL JVM SETTINGS #
########################



# allows lowering thread priority without being root on linux - probably
# not necessary on Windows but doesn't harm anything.
# see http://tech.stolsvik.com/2010/01/linux-java-thread-priorities-workaround.html
**#-XX:ThreadPriorityPolicy=42**

Setting the following env variables solved the problem in MAC export JAVA8_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home

Solution to your Question

Reason for this exception

  1. Multiple JDK versions running,probably JDK9,JDK 10 is causing this exception.
  2. Set the Path to Point JDK 8 Version only.
  3. Currently cassandra 3.1 is desired to run greater than jdk 8 only.

Change in Cassandra-Conf file (/opt/apache-cassandra-3.11.2/conf/cassandra-env.sh)

4.If you want to use higher JDK Version, update the system path variables based on your OS.

Following from Jay's answer if you're on macOS and installed via Homebrew: the file is located at local/etc/cassandra/jvm.options.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!