在cassandra中导入和导出模式 [英] Import and export schema in cassandra
本文介绍了在cassandra中导入和导出模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从Cassandra或Cassandra cqlsh提示符下导入和导出模式?
How to import and export schema from Cassandra or Cassandra cqlsh prompt?
推荐答案
要导出键空间模式:
cqlsh -e "DESC KEYSPACE user" > user_schema.cql
要导出整个数据库模式:
To export entire database schema:
cqlsh -e "DESC SCHEMA" > db_schema.cql
要在'user_schema.cql'('db_schema.cql')导入模式打开终端位置(或您可以指定完整路径)并打开cqlsh shell。然后使用以下命令导入密钥空间架构:
To import schema open terminal at 'user_schema.cql' ('db_schema.cql') location (or you can specify the full path) and open cqlsh shell. Then use the following command to import keyspace schema:
source 'user_schema.cql'
要导入完整的数据库模式:
To import full database schema:
source 'db_schema.cql'
这篇关于在cassandra中导入和导出模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文