How to install Cassandra in Standalone Mode

What is Cassandra?

Apache Cassandra is an open source distributed database management system designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure.

Environment setup:

  • Install CentOS 6.5
  • Install Open JDK 1.7

Check Java Version:

command to check java version

java -version

The output should be:

java

Step 1:

Download the apache cassandra from apache cassandra website. Link for download

Cassandra 2.1.9 download link

Step 2:

Copy the downloaded file to path

/opt/

.

And extract it using command

[/alert-note]tar -zxvf apache-cassandra-2.1.9-bin.tar.gz[/alert-note]

Step 3:

Then go inside extracted folder

cd apache-cassandra-2.1.9/

Step 4:

Now set Cassandra’s variables by running:

export CASSANDRA_HOME=/opt/apache-cassandra-2.1.9
export PATH=$PATH:$CASSANDRA_HOME/bin

Step 5:

Get root access using below command.

su

<enter root password>

Step 6:

No need to change any config file to run in a standalone mode, just keep it default.

Running the cassandra on standalone mode.

./bin/cassandra

While this command starts the cassandra and you should not see any error.

The output of above command will be like shown below.

output

Step 7:

Now you can check cassandra is up and running using the CQL

./bin/cqlsh

This command should show cassandra is connected to “Test Cluster” 127.0.0.1

If you see the above command then you are set to go. :)

Leave a Reply

Your email address will not be published. Required fields are marked *