Friday, January 24, 2014

Manual Installation and Configuration of a Single Node Cassandra on Amazon Linux AMI EC2

Before you start you need to be careful that you launch amazon ami instance, personally experienced it does not work for other instances like redhat for unknown reason. Port 9160 which is the thrift port for connecting to cassandra remain closed in the redhat after launching it.

Requirements:

  • jdk currently 1.7
  • Cassandra tar file currently version 2.0
Steps:
  • Install Java


  1. Downlaod and install jdk
  2. Install jdk
    • move to the folder contains jdk
    • rpm -Uvh jdk-7u51-linux-i586.rpm
    • Set Java_home : export JAVA_HOME=/usr/java/jdk1.7.0_4  

  • Install and Configure Cassandra
  1. download cassandra from Apache Cassandra  or run : 
  2. Create the casssandra necessary folders
      • sudo mkdir /var/lib/cassandra sudo mkdir /var/log/cassandra sudo mkdir /var/lib/cassandra/data sudo mkdir /var/lib/cassandra/saved_caches sudo mkdir /var/lib/cassandra/commitlog
      • set the permissions
        sudo chown -R ec2-user:ec2-user /var/log/cassandra/
        sudo chown -R ec2-user:ec2-user /var/lib/cassandra/
    • cd apache-cassandra-2.0.4/conf
    • vi cassandra.yaml or nano cassandra.yaml
    • change listen_address and rpc_address to your private address
    • change seed and broadcast_address to your public ip address(don't forget to remove the # from the begining of the broadcast_address line)
    • change the snitch to EC2Snitch
    • exit from the file
    • run cassandra: bin/cassandra -f 

No comments:

Post a Comment