【问题标题】:What is necessary to backup the schema?备份架构需要什么?
【发布时间】:2016-02-28 00:32:56
【问题描述】:

Datastax documentation 状态

Cassandra 只能在表架构存在时从快照中恢复数据。如果您尚未备份架构,[...]

完整备份架构需要什么?只需备份system 键空间?

【问题讨论】:

    标签: cassandra cassandra-2.0 datastax-enterprise cassandra-2.1


    【解决方案1】:

    在 cqlsh(包含在 Cassandra 中)中,使用 DESC SCHEMA 命令。

        DESCRIBE [FULL] SCHEMA
    
          Output CQL commands that could be used to recreate the entire (non-system) schema.
          Works as though "DESCRIBE KEYSPACE k" was invoked for each non-system keyspace
          k. Use DESCRIBE FULL SCHEMA to include the system keyspaces.
    

    【讨论】:

      【解决方案2】:

      无需备份系统密钥空间,在新节点上安装 DSE 时会重新创建它们。但是,您需要任何用户定义的键空间的架构。

      要备份架构:

      $ cqlsh -e "DESCRIBE SCHEMA;" > schema.out
      

      在新节点上恢复:

      $ cqlsh < schema.out
      

      【讨论】:

        猜你喜欢
        • 2012-08-09
        • 2015-06-07
        • 1970-01-01
        • 1970-01-01
        • 2017-11-23
        • 2011-05-29
        • 2010-09-05
        • 2018-08-07
        • 2019-07-11
        相关资源
        最近更新 更多