如何从 Cassandra 集群导出数据并导入另一个集群
我想从 cassandra 集群中的键空间导出所有数据并将其导入另一个具有相同架构但键空间名称不同的集群。
我研究了 sstable2json /json2sstable 实用程序。但是,我不想去每个节点并处理每个单独的 sstable。
I want to export all data from a keyspace in a cassandra cluster and import it into another cluster, that has the same schema but the keyspace is differently named.
I've looked into the sstable2json /json2sstable utility. However, I don't want to go to each node and deal with each individual sstable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
更简单:在每个节点上拍摄快照,然后使用批量加载器对它们进行流式传输进入新集群。
Simpler: take a snapshot on each node, then use the bulk loader to stream them into the new cluster.
如果您不想逐个节点导出数据,那么您可能需要使用普通的 Thrift 客户端接口系统地从源集群读取数据块并将其写入目标,遍历所有列族及其行。但这可能相对较慢。
If you don't want to export the data node by node, then you probably need to use the normal Thrift client interface to systematically read chunks of data from the source cluster and write them to the destination, working through all columnfamilies and their rows. This may be relatively slow though.