Ameya Pawar
Ameya Pawar

Reputation: 21

Is Java driver v3.6 compatible with Cassandra 4.x?

I am writing to check the check the compatibility of Datastax cassandra-driver-core 3.6 for working with Cassandra Version 4. Could you please suggest. below is the dependency currently being used, Checking if same dependency will work for Cassandra version 4.0

            <groupId>com.datastax.cassandra</groupId>
            <artifactId>cassandra-driver-core</artifactId>
            <version>3.6.0</version>

I did refer this post, which says it is compatible. However, it dint work out for me. If you may comment for the support part to check further

Apache Cassandra 4.x java driver compatibility

Upvotes: 1

Views: 853

Answers (2)

Erick Ramirez
Erick Ramirez

Reputation: 16313

Version 3.6 of the Java driver is compatible with Apache Cassandra 4.0 but there are additional steps required to make it work.

Cassandra 4.0 operates with native protocol v5 (CASSANDRA-9362, CASSANDRA-14973) but Java driver v3.6 supports up to native protocol v3 only (C* 2.2, 3.x). In order to connect to a C* 4.0 cluster, you will need to configure Java driver v3.6 to explicitly use protocol v3. For example:

Cluster cluster = Cluster.builder()
    .addContactPoint(contactpoint)
    .withProtocolVersion(ProtocolVersion.V3)
    .build();

As a side note, v3.6 of the driver was released in 2018 and is very old. We recommend that you upgrade to the latest v3.x version of the Java driver which at the time of writing is v3.11. Since it is just an upgrade to the latest patch release, it is binary compatible with v3.6 and does not require a refactor of your application. Cheers!

Upvotes: 1

Ameya Pawar
Ameya Pawar

Reputation: 21

I managed to install cassandra 4x using the same cassandra 3.11 driver Below steps to make it work:

  1. Download and Install cassandra-4.0.5-1.noarch.rpm from https://downloads.apache.org/cassandra/redhat/40x/
  2. Configure cassandra.yaml file per the existing cluster cassandra.yaml file.
  3. Below parameters, if exists, need to be removed/commented from Cassandra.yaml as its not supported by cassandra4.X version a. start_rpc b. rpc_server_type c. rpc_port d. thrift_framed_transport_size_in_mb e. request_scheduler f. thrift_prepared_statements_cache_size_mb

Note: If using rhel and cassandra-4.0.5-1.noarch.rpm is failing with yum command, try using cassandra-4.0.4-1.noarch.rpm which works fine.

Upvotes: 1

Related Questions