4

I would like to start Cassandra with a very simple single-node cluster, but I can't do it.

I followed the steps described at

https://www.digitalocean.com/community/tutorials/how-to-install-cassandra-and-run-a-single-node-cluster-on-a-ubuntu-vps

Basically,

  1. Built a fresh CentOS 7 virtual machine on VirtualBox.
  2. Installed JDK, put it under /usr/local/, and created pathes.
  3. Installed Apache Cassandra, put it under /root/, made directries for the lib and the log, and gave the writing rights to Cassandra.

At the end, when I ran below as root user,

# sh ~/cassandra/bin/cassandra

The message below appeared.

Running Cassandra as root user or group is not recommended - please start Cassandra using a different system user.
If you really want to force running Cassandra as root, use -R command line option.

So, I ran

# sh ~/cassandra/bin/cassandra -R

Then, I got the message below.

# [0.000s][warning][gc] -Xloggc is deprecated. Will use -Xlog:gc:/root/cassandra/bin/../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.

It seems the issue is related to JVM, but I have no clue regarding its cause and solution.

Please let me know if you have ideas of how to solve this issue.

My environment is as below:

  • Windows 10
  • VirtualBox 5.1.28
  • CentOS-7-x86_64-Minimal-1611
  • jdk-9.0.1
  • apache-cassandra-3.11.1
wiaylise
  • 376
  • 2
  • 8

2 Answers2

5

As undefined_variable commented, Java 8, instead of 9, worked just fine. Thanks everyone for trying to help.

wiaylise
  • 376
  • 2
  • 8
3

This issue is already reported at https://issues.apache.org/jira/browse/CASSANDRA-13107.

To solve the issue you can simple comment out this setting in jvm.options file.

Simon Fontana Oscarsson
  • 2,114
  • 1
  • 17
  • 20
  • 2
    I had tried commenting out line of 'ThreadPriorityPolicy=42' on jvm.options, but it led to an endless series of Errors. Next error message you may receive is "Unrecognized VM option 'PrintGCDateStamps' "; you may comment out all of "-XX:+Print*** " lines at the end of jvm.options. And then you may encounter "Error opening log file '~/cassandra/logs/gc.log': No such file or directory"; even after you mkdir "logs", next issue comes, and so on. It may or may not be possible to solve the original problem by dealing with all continuous issues, but this way is not the easiest. – wiaylise Oct 27 '17 at 07:25
  • 2
    Good that you solved the issue. It seems Java 9 is not supported yet for Cassandra. https://issues.apache.org/jira/browse/CASSANDRA-9608 – Simon Fontana Oscarsson Oct 27 '17 at 08:08