Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将cassandra密钥空间导出到.cql文件_Cassandra - Fatal编程技术网

将cassandra密钥空间导出到.cql文件

将cassandra密钥空间导出到.cql文件,cassandra,Cassandra,我需要将密钥空间导出到.cql文件。我已经尝试了cqlsh-e“DESC keyspace demo”>dump.cql命令,但这不起作用,我还需要插入脚本 我也尝试了COPY命令,但它不符合我的目的。我还希望能够从cql文件导入 您可以使用sstable2json和json2stable cassandra工具 同样的,也可以查看数据税 用法:sstable2json[-f输出文件][-k键[-k键[…]] 用法:json2stable-K键空间-c列_族 Desc键空间将仅导出键空间架构。

我需要将密钥空间导出到.cql文件。我已经尝试了cqlsh-e“DESC keyspace demo”>dump.cql命令,但这不起作用,我还需要插入脚本


我也尝试了COPY命令,但它不符合我的目的。我还希望能够从cql文件导入

您可以使用sstable2json和json2stable cassandra工具

同样的,也可以查看数据税

用法:sstable2json[-f输出文件][-k键[-k键[…]]
用法:json2stable-K键空间-c列_族
Desc键空间将仅导出键空间架构。
如果您还想导出数据,则必须使用以下实用程序。

以下内容适用于我在3.0安装中的工作:

cqlsh -e 'DESCRIBE keyspace demo' > dump.cql    - gets the create syntax
cqlsh < dump.cql    - creates the keyspace on a new cluster
cqlsh-e'descripe keyspace demo'>dump.cql-获取创建语法
cqlsh
我对此不确定,但在我的cassandra bin目录中没有名为JSON2STABLE或JSON2STABLE的执行。你从哪里运行这个?你使用的是哪个版本的cassandra?我使用的是3.0版本。我在2.1中也检查了同样的版本。它在tools/bin cassandra 2.1中不可用
cqlsh -e 'DESCRIBE keyspace demo' > dump.cql    - gets the create syntax
cqlsh < dump.cql    - creates the keyspace on a new cluster