Dropping a an entire keyspace using the cassandra-cli is exceptionally simple.
First, access your cluster using the cli. I have an alias in my .bash_profile so I only need to type ‘cass’ to access the clid. In an attempt to be helpful though, I shall show the full command syntax for my environment. Your host and port may vary.
alias cass='cassandra-cli -h 10.1.0.26'
In this example, I am going to drop the keyspace I was loading with test data in previous posts, ks33.
hpcass: ~$ cass Connected to: "Test1" on 10.1.0.23/9160 Welcome to Cassandra CLI version 1.0.8 Type 'help;' or '?' for help. Type 'quit;' or 'exit;' to quit. DROP keyspace ks33; 07ad5e00-7120-11e1-0000-13393ec611bd Waiting for schema agreement... ... schemas agree across the cluster [default@unknown]
That’s all there was to it. Keyspace destroyed.
Previous Cassandra related articles
- Apache Cassandra Project – processing “Big Data” – blog
- Cassandra and Big Data – building a single-node “cluster” – blog
- Cassandra – Getting a 3 node cluster built – apps
- Java build env to prepare for Cassandra development – apps
- Re-Configuring an Empty Cassandra Cluster – blog
- Cassandra – Running some simple tests, including a multi-get strategy. – blog
- Creating a simple Utils class – apps
- Cassandra DB Connetor in Java, using Thrift API – apps
- Java multi-get demonstrator for Cassandra NoSQL db – apps