Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.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数据库转储_Cassandra_Database Dump_Nosql - Fatal编程技术网

如何使用数据获取Cassandra数据库转储

如何使用数据获取Cassandra数据库转储,cassandra,database-dump,nosql,Cassandra,Database Dump,Nosql,我需要从远程Cassandra数据库获取转储(包含数据)。我可以通过以下命令获取数据库模式。如何获取密钥空间中的所有数据 我用的是卡桑德拉1.1.9 echo-e“connect localhost/9260;\r\n使用PWC_键空间;\r\n show schema;\n“| bin/cassandra cli-h localhost-port 9260>dilshan.cdl对于cassandra 1.1.9,我认为您无法使用copy to命令访问cqlsh,因此您将不得不使用两个选项 1

我需要从远程Cassandra数据库获取转储(包含数据)。我可以通过以下命令获取数据库模式。如何获取密钥空间中的所有数据

我用的是卡桑德拉1.1.9


echo-e“connect localhost/9260;\r\n使用PWC_键空间;\r\n show schema;\n“| bin/cassandra cli-h localhost-port 9260>dilshan.cdl

对于cassandra 1.1.9,我认为您无法使用copy to命令访问cqlsh,因此您将不得不使用两个选项

1) 使用sstable2json从磁盘上的数据文件(sstables)导出数据,或 2) 编写一个程序来迭代每一行,并将其复制/序列化为一种您觉得更容易使用的格式

您可以使用较新的cqlsh(例如,从2.0开始,它仍然使用thrift而不是本机接口),并将其指向1.1.9服务器,然后使用“复制到”将每个表导出到csv。但是,cqlsh for 2.0中的COPY命令不使用分页,cassandra 1.1.19不支持分页,因此很有可能会超时并失败