Pages

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 http://cassandra.apache.org. 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 http://ant.apache.org website
  
5.      Extract the zip file as below.

#unzip apache-ant-1.8.3-bin.zip

  
6.      Download the Ivy plugin software from the http://ant.apache.org/ivy/download.cgi website.

7.       Extract the zip file.

#unzip apache-ivy-2.2.0-bin-with-deps.zip

               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 https://svn.apache.org/repos/asf/ant/ivy/core/trunk 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.

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



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

    #cd apache-cassandra-1.0.8-src/
    #bin/cassandra

                  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/127.0.0.1 : 9160
     INFO 14:38:02,254 Listening for thrift clients...


Now the cassandra is up and running

12.   Start the cassandra client.
#bin/cassandra-cli
   
     o/p:
Welcome to Cassandra CLI version 1.0.8-SNAPSHOT

Type 'help;' or '?' for help.  Type 'quit;' or 'exit;' to quit.
 [default@unknown]



    

    


1 comment:

  1. related with Cassandra Database, you can download this article here http://repository.gunadarma.ac.id/bitstream/123456789/2989/1/PERBAN~1.PDF

    ReplyDelete