Thursday, July 29, 2010

A very simple 2 node cassandra cluster on windows XP

Today I’ve been setting up a tiny Cassandra cluster in our teaching lab. I’m (for my sins) running this on a couple of Windows XP boxes. This means that for now Cassandra need to be run from the command prompt and the machine left running. Setting up on windows is fine, just make sure your JAVA_HOME is set correctly before running. To get more than one machine talking to each other do the following.

Open the storage-conf.xml file and look for ListenAddress. Change this to be the IP address of the the machine you’re working on:

<ListenAddress>xxx.yyy.36.151</ListenAddress>
<!-- internal communications port -->
<StoragePort>7000</StoragePort>

Do this on both machines. Now look for the Seeds config entry. Change this so it lists both the IP’s of each machine.

<Seeds>
<Seed>xxx.yyy.36.151</Seed>
<Seed>xxx.yyy.36.150</Seed>
</Seeds>
I also changed the Number of replicas of the data to the number of machines and to be frank I’m not quite sure if I needed to.

<ReplicationFactor>2</ReplicationFactor>

One other thing, before you are tempted to start either machine change the ClusterName. I’ve found trying to change the cluster name after starting Cassandra can cause problems.

No comments:

Post a Comment