Technipelago AB

Technipelago Blog Stuff that we learned...


Setup two Ubuntu 10.04 LTS Servers as Cassandra Hosts

Publicerad den 22 Dec 2011

Step-by-step instructions for setting up a Ubuntu server from scratch with Apache Cassandra NoSQL database

Step-by-step instructions for setting up a Ubuntu server from scratch with Apache Cassandra NoSQL database.

Install Ubuntu

Install Ubuntu Server 10.04 without any extra packages.

Install Java

sudo apt-get install python-software-properties

sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"

sudo apt-get update

sudo apt-get install sun-java6-jdk

sudo vi /etc/profile

export JAVA_HOME=/usr/lib/jvm/java-6-sun

Install Apache Cassandra

wget http://apache.mirrors.spacedump.net//cassandra/1.0.6/apache-cassandra-1.0.6-bin.tar.gz

tar xf apache-cassandra-1.0.6-bin.tar.gz

sudo mkdir /var/log/cassandra

sudo mkdir /var/lib/cassandra

sudo chmod 777 /var/log/cassandra

sudo chmod 777 /var/lib/cassandra

Configuring a basic cluster with two hosts

Setup a second Ubuntu server, follow all of the "Install Ubuntu, Java and Cassandra" steps above, then:

On the first Ubuntu server, modify conf/cassandra.yaml:

cluster_name: 'Your Cluster Name'

initial_token: 0

listen_address: <this server's IP address>

rpc_address: <this server's IP address>

seeds: <ip1, ip2>

On the second Ubuntu server, modify conf/cassandra.yaml:

cluster_name: 'Your Cluster Name'

initial_token: 85070591730234615865843651857942052864

listen_address: <this server's IP address>

rpc_address: <this server's IP address>

seeds: <server_1_ip, server_2_ip>

Note: Each Ubuntu server must be able to contact the other via the IP addresses mentioned.

Now start Cassandra on the first Ubuntu server, give it a moment to come up, then start Cassandra on the second Ubuntu server.

Start Cassandra

cd .../apache-cassandra-1.0.6

bin/cassandra -f

Install SSH

Install SSH Server so you can access the node

sudo apt-get install openssh-server

Tags: cassandra bigdata ubuntu setup


« Back