[FOLLOW UP QUESTION TO #8518]
The approach (using sstableloader to migrate to higher version) should work for source Cassandra C* 2.0.x as well, correct?
The approach (using sstableloader to migrate to higher version) should work for source Cassandra C* 2.0.x as well, correct?
Yes, it is possible for a Cassandra 3.11 sstableloader
to read and load 2.0 SSTables to a 3.11 cluster.
As a general rule, Cassandra can read and open SSTables formats in the current version and the previous major version. In your case, Cassandra major version 3.x can read SSTables from major version 2.x.
I've done a quick test by building a C* 2.0.17 cluster and creating a table with the following schema:
CREATE TABLE community.users ( name text PRIMARY KEY, booleancol boolean, colour text, intcol int )
and populating it with the following test data:
$ cat users.csv name,colour,intcol,booleancol 'alice','red',1,true 'bob','orange',2,false 'cynthia','yellow',3,true 'dan','green',4,false 'echo','blue',5,true 'fox','indigo',6,false 'gabriel','violet',7,true
so I end up with:
[cqlsh 4.1.1 | Cassandra 2.0.17 | CQL spec 3.1.1 | Thrift protocol 19.39.0]
cqlsh> SELECT * FROM community.users ; name | booleancol | colour | intcol -----------+------------+----------+-------- 'gabriel' | True | 'violet' | 7 'bob' | False | 'orange' | 2 'fox' | False | 'indigo' | 6 'echo' | True | 'blue' | 5 'alice' | True | 'red' | 1 'dan' | False | 'green' | 4 'cynthia' | True | 'yellow' | 3
I end up with the following SSTable in the 2.0 -jb-
format:
$ ls -1 community/users/ community-users-jb-1-CompressionInfo.db community-users-jb-1-Data.db community-users-jb-1-Filter.db community-users-jb-1-Index.db community-users-jb-1-Statistics.db community-users-jb-1-Summary.db community-users-jb-1-TOC.txt
I loaded this SSTable to a C* 3.11.9 cluster with:
$ cd apache-cassandra-3.11.9 $ bin/sstableloader -d 10.1.2.3 /path/to/community/users/
Established connection to initial hosts Opening sstables and calculating sections to stream Streaming relevant part of /home/ubuntu/community/users/community-users-jb-1-Data.db to [/10.1.2.3] progress: [/10.1.2.3]0:1/1 100% total: 100% 0.115KiB/s (avg: 0.115KiB/s) progress: [/10.1.2.3]0:1/1 100% total: 100% 0.000KiB/s (avg: 0.113KiB/s) Summary statistics: Connections per host : 1 Total files transferred : 1 Total bytes transferred : 0.373KiB Total duration : 3282 ms Average transfer rate : 0.113KiB/s Peak transfer rate : 0.115KiB/s
I now have the data loaded in the new cluster:
[cqlsh 5.0.1 | Cassandra 3.11.9 | CQL spec 3.4.4 | Native protocol v4]
cqlsh> SELECT * FROM community.users ; name | booleancol | colour | intcol -----------+------------+----------+-------- 'gabriel' | True | 'violet' | 7 'bob' | False | 'orange' | 2 'fox' | False | 'indigo' | 6 'echo' | True | 'blue' | 5 'alice' | True | 'red' | 1 'dan' | False | 'green' | 4 'cynthia' | True | 'yellow' | 3
As always, you need to test exhaustively in your environment since C* 2.0 is no longer supported and loading SSTables from very old version is not part of the normal testing for current releases. Cheers!
5 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2023 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use