We\'re planning on migrating our environment from Java 8 to OpenJDK 10. Doing this on my local machine, I\'ve found that Cassandra will no longer start for me, giving the fo
Released versions of Cassandra support only Java 8 - support for higher versions will be in the Cassandra 4.0 that isn't released yet. You can track progress in the CASSANDRA-9608
With Cassandra 3.11.4 we have been able to execute the Cassandra engine with Java 11, but there has been some gotchas:
jvm.options
file.ThreadPriorityPolicy
as it was deprecated with Java 9jvm.options
. Some of those parameters are:
nodetool
still requires Java 8 to be able to execute.
For a cluster that was using offheap_buffers
for memtable_allocation_type
(it is defined in cassandra.yaml
), we had to change it to use offheap_objects
As of now, Cassandra 3.x will only work with java 8. Cassandra 4.0 supports Java 8 and Java 11 but it is not released yet at the time of writing this answer.
If you want to run Cassandra in your local system(not recommended for production) with java 11. Then you can follow these steps:
Prerequisite: Java 11, Apache Ant, Python
Download Cassandra trunk branch code : https://github.com/apache/cassandra
Unzip the file and open folder in terminal/command prompt .
ajit-soman@ajitsoman-X542BA:~/Downloads/cassandra-trunk$ ant -Duse.jdk11=true
Buildfile: /home/ajit-soman/Downloads/cassandra-trunk/build.xml
[script] Warning: Nashorn engine is planned to be removed from a future JDK release
...
...
jar:
[mkdir] Created dir: /home/ajit-soman/Downloads/cassandra-trunk/build/classes/stress/META-INF
[mkdir] Created dir: /home/ajit-soman/Downloads/cassandra-trunk/build/tools/lib
[jar] Building jar: /home/ajit-soman/Downloads/cassandra-trunk/build/tools/lib/stress.jar
[mkdir] Created dir: /home/ajit-soman/Downloads/cassandra-trunk/build/classes/fqltool/META-INF
[jar] Building jar: /home/ajit-soman/Downloads/cassandra-trunk/build/tools/lib/fqltool.jar
BUILD SUCCESSFUL
Total time: 7 minutes 38 seconds
ajit-soman@ajitsoman-X542BA:~/Downloads/cassandra-trunk/bin$ ./cassandra
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
CompileCommand: dontinline
ajit-soman@ajitsoman-X542BA:~/Downloads/cassandra-trunk/bin$ ./nodetool status
Datacenter: datacenter1
=======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 127.0.0.1 5.79 KiB 256 100.0% 68687cfd-a80b-45db-93cd-7bc2d212a64b rack1
ajit-soman@ajitsoman-X542BA:~/Downloads/cassandra-trunk/bin$ ./cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 4.0-alpha2-SNAPSHOT | CQL spec 3.4.5 | Native protocol v4]
Use HELP for help.
cqlsh>
Cassandra 4.0 has explicit support for both Java 8 and Java 11. In fact, they even split-up the configuration files as such:
$ pwd
/Users/aaron/local/apache-cassandra-4.0-SNAPSHOT/conf
$ ls -a jvm*
jvm-clients.options jvm11-clients.options jvm8-clients.options
jvm-server.options jvm11-server.options jvm8-server.options
The reason for support of these specific versions is two-fold. First of all, Java 8 has been the de-facto standard for Cassandra for a few years now. Users expect that it will still work on Java 8 in the future.
Given the new 6 month release cycle of Java, Java 9 and Java 10 will no longer be "current" when Apache Cassandra 4.0 comes out. Plus, the tests which run during the build have shown to be picky about which version of Java they work with. Therefore, the decision was made to go support Java 8 and 11 for 4.0, as work on Java 9 and 10 seemed to be lower-priority.
That's not to say that Cassandra 4.0 won't run on Java 9 or 10. In fact, CASSANDRA-9608 even has a patch submitted which should cover it. But the fact remains that Java 8 is included due to its longstanding use in the Cassandra user base. Java 11 will be the current JDK/JRE at the time 4.0 releases. If you want to be sure that your cluster will run well, I'd pick one of those two.
But until 4.0, the most recent patch of Java 8 is really the only option.