Cassandra upgrade - can different cassandra versions co-exist in the same cluster?

1,746 views
Skip to first unread message

Freddie The Foreigner

unread,
Jan 15, 2016, 10:58:18 AM1/15/16
to DataStax Java Driver for Apache Cassandra User Mailing List
We are using cassandra 2.1.4 in production. We are trying to upgrade it to cassandra 2.2.4

We got 4 node cluster. I started with one node, drained it and installed 2.2.4 and started it.. (one node with 2.2.4 and all other 3 nodes with 2.1.4)

* initially, we were unable to bring the 2.2.4 node up at all. It was failing saying unable to gossip. Network was fine though.
* finally managed to solve by making the 2.2.4 node as seed node.
* then using cqlsh, we were getting errors like schema version mismatch when we try to create keyspace.

From the application we are using datastax driver 2.1.9 with protocol version v3. We are always getting, "

No schema agreement from live replicas" when we try to execute a statement.


How to upgrade from 2.1.4 version to 2.2.4?

Do we have to stop the cluster and upgrade all the nodes to 2.2.4?


Thanks.

Andrew Tolbert

unread,
Jan 15, 2016, 11:29:06 AM1/15/16
to DataStax Java Driver for Apache Cassandra User Mailing List
Hi Freddie,

This question may be more appropriate for the 'Cassandra Users' mailing list (this guide may be a good starting point), that being said this is supported (live upgrade) and there are some considerations from a drivers perspective:
  • To communicate with a 2.2.X cluster from the java-driver you will need to use a newer version of the java-driver, preferably the latest 3.0 release (3.0.0-rc1 at this time)
  • Cassandra 2.2.4 introduces support for protocol version 4, but it still supports protocol version 3 (introduced in 2.1), 2, and 1.  You cannot connect to a 2.1 cluster using protocol version 4.
  • When the java-driver establishes connection to your Cluster, it uses your contact points to figure out what protocol version to use.   If it connects to a 2.2.X node, it'll see that protocol version 4 is supported and use that for the rest of the cluster.  If this happens, your driver client will not be able to talk to 2.1.X nodes.   To get around this you can explicitly set the protocol version to 3 using Cluster.Builder#withProtocolVersion(ProtocolVersion.V3) when constructing your Cluster instance.  We should document this last bit if it isn't already (don't see anything at the moment), I'll look into it.
With regards to the schema mismatch issues,  I think it probably is not advisable to make schema changes when your cluster has mixed versions (I'm guessing it isn't supported, but i'm not confident).

Thanks,
Andy

Sathyaprakash Dhanabal

unread,
Jan 20, 2016, 8:18:20 AM1/20/16
to java-dri...@lists.datastax.com
Thanks Andy. I found the issue. 

* I made a mistake by doing "nodetool repair" which landed me in trouble during cluster in a partially upgraded state.
* Also, adding a new node(fresh install) with 2.2.4 cassandra into a existing cluster of 2.1.4 caused schema mismatch issues. 

Your suggestions about protocolVersion and schema changes helped me in fixing the live upgrade issue.  We are now able to completely upgrade the nodes one by one in the cluster to 2.2.4. 

~ Thanks again.

--
You received this message because you are subscribed to the Google Groups "DataStax Java Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to java-driver-us...@lists.datastax.com.

Reply all
Reply to author
Forward
0 new messages