使用sstableloader将cassandra db从cassandra 2.2.8还原到cassandra 3.11

问题描述 投票:0回答:1

我试图将我的cassandra数据从cassandra 2升级到cassandra 3。但在下面遇到了这个问题。

ERROR 16:35:57,775 Cannot open [cassandra_backup_data_dir]/[keyspace]/[table]/lb-86-big; partitioner org.apache.cassandra.dht.RandomPartitioner does not match system partitioner org.apache.cassandra.dht.Murmur3Partitioner.  Note that the default partitioner starting with Cassandra 1.2 is Murmur3Partitioner, so you will need to edit that to match your old partitioner if upgrading.

备份文件由nodetool快照--t [name_snapshot]-[keyspace]制作

其他表正在使用Murmur3Partitioner分区程序,并且使用sstableloader成功。

如何在升级cassandra期间解决此问题

database cassandra cassandra-2.0 cassandra-3.0
1个回答
0
投票

如果分区程序不同,则无法使用sstableloader加载数据。代替使用sstableloader,您需要使用其他工具将数据从旧群集中卸载到CSV或JSON中,然后再将其加载到新群集中。或者,您可以使用Spark Spark Cassandra连接器在群集之间复制数据,例如described in this article

spark.setConf("ClusterOne/spark.cassandra.connection.host", "127.0.0.1")
spark.setConf("ClusterTwo/spark.cassandra.connection.host", "127.0.0.2")
val data = spark.read.cassandraFormat("tbl", "ks").option("cluster", "ClusterOne",).load()
data.write.cassandraFormat("tbl", "ks").option("cluster", "ClusterTwo",).save()
© www.soinside.com 2019 - 2024. All rights reserved.