如何使用cqlsh将模式文件加载到Cassandra中 [英] how to load schema file into Cassandra with cqlsh

查看:212
本文介绍了如何使用cqlsh将模式文件加载到Cassandra中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Cassandra的模式文件。我使用的是Windows 7机器(Cassandra在这个机器以及 - 1个节点)。我想加载与cqssh的模式。到目前为止我还没有找到如何。我希望能够将文件传递给cqlsh: cqlsh mySchemaFile 。但是,由于我在Windows中运行,要启动cqlsh,我做以下

I have a schema file for Cassandra. I'm using a windows 7 machine (Cassandra on this machien as well - 1 node). I want to load the schema with cqssh. So far I have not been able to find how. I was hoping to be able to pass the file to cqlsh: cqlsh mySchemaFile. However since I run in windows, to start cqlsh I do the following

python "C:\Program Files (x86)\DataStax Community\apache-cassandra\bin\cqlsh" localhost 9160

csqsh在我的路径,当调用这样从python它需要完整的路径。

Even though I have csqsh in my path, when called like this from python it needs the full path.

我试图在那里添加文件名,但没有运气到目前为止。
这是可能吗?

I tried to add in there the file name but no luck so far. Is this even possible?

推荐答案

cqlsh通过 - file 选项,而不是位置参数(如主机和端口),因此正确的格式为:

cqlsh takes a file to execute via the -f or --file option, not as a positional argument (like the host and port), so the correct form would be:

python "C:\Program Files (x86)\DataStax Community\apache-cassandra\bin\cqlsh" localhost 9160 -f mySchemaFile

注意:我不能100%确定是否使用 -f \f

Note: I'm not 100% sure about whether you'd use -f or \f in Windows.

这篇关于如何使用cqlsh将模式文件加载到Cassandra中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆