Вопрос

I am trying to load schema to Cassandra server from a file. As suggested by some one, i tried sstable2json and json2sstable but i guess that imports and exports data files while i am trying to load the schema of the database only.Any suggestion on possible ways to do it ?
I am using Cassandra 1.2.

Это было полезно?

Решение

To get schema file go to directory where Cassandra resides ..not in bin directory within it

echo -e "use your_keyspace;\r\n show schema;\n" | bin/cassandra-cli -h your_listen_address(e.g.localhost) > mySchema.cdl

To load that file

bin/cassandra-cli -h localhost -f mySchema.cdl
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top