Question

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.

Était-ce utile?

La solution

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
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top