Import and export schema in cassandra

前端 未结 4 422
猫巷女王i
猫巷女王i 2020-12-23 17:07

How to import and export schema from Cassandra or Cassandra cqlsh prompt?

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-23 17:14

    If using cassandra-cli, you can use the 'show schema;' command to dump the whole schema. You can restrict to a specific keyspace by running 'use keyspace;' first.

    You can store the output in a file, then import with 'cassandra-cli -f filename'.

    If using cqlsh, you can use the 'describe schema' command. You can restrict to a keyspace with 'describe keyspace keyspace'.

    You can save this to a file then import with 'cqlsh -f filename'.

提交回复
热议问题