how to load schema file into Cassandra with cqlsh

瘦欲@ 提交于 2020-01-01 03:23:07

问题


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

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?


回答1:


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

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



来源:https://stackoverflow.com/questions/15750264/how-to-load-schema-file-into-cassandra-with-cqlsh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!