- Download Cassandra from http://cassandra.apache.org/
- Cassandra is build with java, so it needs java to be installed.
- Setup environment variables;
- JAVA_HOME : C:\Program Files\Java\jdk1.7.0_11
- CASSANDRA_HOME : C:\cassandra\apache-cassandra-1.2.0
- CLASSPATH : %JAVA_HOME%\jre\lib; %CASSANDRA_HOME%
- Check in CMD whether environment variables are set;
- echo %JAVA_HOME%
- Copy the downloaded Cassandra files to C:\cassandra\apache-cassandra-1.2.0
- Create commitlog, data, saved_caches folders inside C:\cassandra\storage
- Open cassandra.yml file in C:\cassandra\apache-cassandra-1.2.0\conf
- Change the following;
- data_file_directories:
- commitlog_directory: C:\cassandra\storage\commitlog
- saved_caches_directory: C:\cassandra\storage\saved_caches
- Open CMD and go to C:\cassandra\apache-cassandra-1.2.0\bin, to start the server;
- C:\cassandra\apache-cassandra-1.2.0> cassandra -f
- Open another CMD and go to C:\cassandra\apache-cassandra-1.2.0\bin, to start the client;
- C:\cassandra\apache-cassandra-1.2.0> cassandra-cli.bat
- If the client is running properly following output will come;
Starting Cassandra Client
Connected to: "Test Cluster" on 127.0.0.1/9160
Welcome to Cassandra CLI version 1.2.0
Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit.
[default@unknown]
First command on client !
[default@unknown] show cluster name;
Test Cluster
If you forget the semicolon (;) it will not communicate with the server
[default@unknown] show cluster name
...