Cassandra复制KeySpace-如何? [英] Cassandra Copy KeySpace - How To?

查看:181
本文介绍了Cassandra复制KeySpace-如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在从旧版DB迁移到Cassandra。



在旧数据库中,每当新项目或分析开始时,我们都会克隆现有数据库并为项目/分析创建一个新数据库。



我们也想对Cassandra做同样的事情。 Cassandra文章建议复制密钥空间作为对此的最佳解决方案。



复制密钥空间的最佳方法是什么?



我们还希望复制键空间是为了避免从旧键空间中卸载而避免将加载到新键空间中,因为我们正处于Wiki-ing过程中,而我们将在不久的将来击中键空间中的数百万条记录。



当前,我们执行的步骤如下:


  1. 创建键空间的快照

  2. 创建新的键空间($ {NEW_KEYSPACE})和表

  3. 将SNAPSHOT / *。db文件复制到$ CASSANDRA_HOME / data / data / $ {NEW_KEYSPACE}
  4. 中的相应表文件夹中
  5. 修复键空间

  6. 刷新键空间和表

让我们知道,这是正确的方法还是我们有更好的方法?

解决方案

正如Simon Fontana Oscarsson所提到的,过程步骤中唯一的变化是刷新键空间,然后修复。



因此,我们执行的总体步骤是:



  • 创建键空间的快照

  • 创建新的键空间($ {NEW_KEYSPACE})和表

  • 复制将SNAPSHOT / *。db文件保存到$ CASSANDRA_HOME / data / data / $ {NEW_KEYSPACE}
  • 中的对应表文件夹中
  • 刷新键空间和表

  • 修复KeySpace


  • 谢谢大家的反馈。


    We are migrating to Cassandra from legacy DB.

    In legacy DB, whenever new project or analysis starts we clone existing DB and create a new one for the project/analysis.

    We wanted to do same with Cassandra also. The Cassandra article suggests to copy the keyspaces as the best solution for this.

    What is the best way to copy keyspace?

    We also prefer copy keyspace is to avoid "unloading" from old keyspace and "loading" into new keyspace as we are in the process of wiki-ing the process and we are going to hit millions of records in the keyspaces in near future.

    Currently, the steps we did are as follows:

    1. Create SNAPSHOT of the keyspace
    2. Create new KeySpace (${NEW_KEYSPACE}) and the tables
    3. Copy the SNAPSHOT/*.db files to corresponding tables folder in $CASSANDRA_HOME/data/data/${NEW_KEYSPACE}
    4. Repair the KeySpace
    5. Refresh the KeySpace and the tables

    Let us know, is this the correct way or do we have better ways of doing it.

    解决方案

    As Simon Fontana Oscarsson mentioned, the only change in the process steps is "refresh the keyspace" and then "repair".

    So the overall steps we did are:

    1. Create SNAPSHOT of the keyspace
    2. Create new KeySpace (${NEW_KEYSPACE}) and the tables
    3. Copy the SNAPSHOT/*.db files to corresponding tables folder in $CASSANDRA_HOME/data/data/${NEW_KEYSPACE}
    4. Refresh the KeySpace and the tables
    5. Repair the KeySpace

    Thank you all for the feedback.

    这篇关于Cassandra复制KeySpace-如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆