Tuesday, 27 March 2012

Insatallation of Cassandra database

Note: To Install the cassandra database, the server should be installed with JDK 1.6 or later version.

1.      Download the cassandra software from the website It will be named as  apache-cassandra-x.x.x-bin.tar.gz, where x.x.x is the release of the product
2.        Unzip and untar the file using the below command.

#tar -zxvf apache-cassandra-1.0.8-src.tar.gz

3.       Create the below directories.

  * cd apache-cassandra-$VERSION
  * sudo mkdir -p /var/log/cassandra
  * sudo chown -R `whoami` /var/log/cassandra
  * sudo mkdir -p /var/lib/cassandra
  * sudo chown -R `whoami` /var/lib/cassandra
4.       Download the Apache ant software to build scripting language and Ivy plugin for dependancy management. The Apache ant software can be downloaded from the website
5.      Extract the zip file as below.


6.      Download the Ivy plugin software from the website.

7.       Extract the zip file.


               Note:There is no need to download the ivy software(6&7 steps) seperately.

8.      Navigate to apache-ant-1.8.3 and fire the below command.

   #cd apache-ant-1.8.3  
   #svn co ivy
The above step is building from the source, here we get the latest sources from the    subversions.
9.       Navigate to the Cassandra source directory (Cassandra home) i.e. /root/apache-cassandra-1.0.8-src in this example and fire the below command:
#cd /root/apache-cassandra-1.0.8-src

run the ant command which in the ant extracted software location-->bin directory from the Cassandra source directory

#/root/apache-ant-1.8.3/bin/ant (in this example)

 Because Ivy takes care of all the dependencies, it’s easy to build Cassandra once you have the source. Just make sure you’re in the root directory of your source download   and execute the ant program, which will look for a file called build.xml in the current directory and execute the default build target. Ant and Ivy take care of the rest. To execute the Ant program and start compiling the source, just type above command:
10.   At last you will see BUILD SUCCESSFUL message appeared on the screen and the location of the new property file which is similar to below.

     [propertyfile] Creating new property file: /root/apache-cassandra-1.0.8-src/build/classes/main/org/apache/cassandra/config/

11.   Now we can start the cassandra database using the below command from the CASSANDRA_HOME.

    #cd apache-cassandra-1.0.8-src/

                  In the end of the process, it is similar to the below message:
     INFO 14:38:02,250 Using synchronous/threadpool thrift server on localhost/ : 9160
     INFO 14:38:02,254 Listening for thrift clients...

Now the cassandra is up and running

12.   Start the cassandra client.
Welcome to Cassandra CLI version 1.0.8-SNAPSHOT

Type 'help;' or '?' for help.  Type 'quit;' or 'exit;' to quit.



1 comment:

  1. related with Cassandra Database, you can download this article here