0

During single node installation when I am trying to see the nodetool status, this below error message is coming:

ubuntu@ip-172-31-6-128:~/apache-cassandra-3.11.4/bin$ ./cassandra -R
ubuntu@ip-172-31-6-128:~/apache-cassandra-3.11.4/bin$ [0.000s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:./../logs/gc.log instead.
intx ThreadPriorityPolicy=42 is outside the allowed range [ 0 ... 1 ]
Improperly specified VM option 'ThreadPriorityPolicy=42'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Aaron
  • 55,518
  • 11
  • 116
  • 132

1 Answers1

0

This is happening because ThreadPriorityPolicy is not a valid JVM option in whichever version of Java you are using. You can see this by checking the version from the command prompt:

$ java -version
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (IcedTea 3.17.1) (Alpine 8.275.01-r0)
OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)

Note that Cassandra 3.x will only function with Java 8. You are likely seeing this error, because the Java 8 options specified in cassandra-env.sh are not valid with your version of Java. Install the latest Java 8, or run Cassandra with Docker.

Edit:

Based on this: Cassandra start error with ThreadPriorityPolicy=42

Try setting ThreadPriorityPolicy=1.

Aaron
  • 55,518
  • 11
  • 116
  • 132
  • I am using this java version jdk-8u152-linux-x64.tar.gz but still it comes errorImproperly specified VM option 'ThreadPriorityPolicy=42' Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. – Pritish May 05 '21 at 12:51
  • @Pritish Edit made. – Aaron May 05 '21 at 12:59
  • @Pritish Also, that parameter setting (42) should work with JDK 8. I wonder if you have 9+ somewhere on your machine that Cassandra is managing to find? – Aaron May 05 '21 at 13:05
  • The waring about `-Xloggc` being deprecated also suggests that it's not running on Java 8. – Aaron May 05 '21 at 13:08