Database Reference
In-Depth Information
Starting Cassandra Client
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/cassandra/cli/CliMain
This probably means that you started Cassandra directly from within the bindirectory, and it
therefore sets up its Java classpath incorrectly and can't find the CliMainile to start the client.
You can define an environment variable called CASSANDRA_HOME that points to the top-level dir-
ectory where you have placed or built Cassandra, so you don't have to pay as much attention to
where you're starting Cassandra from.
NOTE
For a little reminder on setting environment variables on Windows, see the section On Windows .
To run the command-line interface program on Linux, navigate to the Cassandra home directory
and run the cassandra-cli program in the bindirectory:
>bin/cassandra-cli
The Cassandra client will start:
eben@morpheus$ bin/cassandra-cli
Welcome to cassandra CLI.
Type 'help' or '?' for help. Type 'quit' or 'exit' to quit.
[default@unknown]
You now have an interactive shell at which you can issue commands.
Note, however, that if you're used to Oracle's SQL*Plus or similar command-line database cli-
ents, you may become frustrated. The Cassandra CLI is not intended to be used as a full-blown
client, as it's really for development. That makes it a good way to get started using Cassandra,
because you don't have to write lots of code to test interactions with your database and get used
to the environment.
Basic CLI Commands
Before we get too deep into how Cassandra works, let's get an overview of the client API so that
you can see what kinds of commands you can send to the server. We'll see how to use the basic
environment commands and how to do a round trip of inserting and retrieving some data.
Search WWH ::




Custom Search