Cassandra is a distributed open source (Apache Licensed) stable DBMS which is widely used by many big organizations like Google. I like Cassandra because it fits my organizational needs and has a very flexible storage structure.
Configuring a single node for testing purpose is very easy and a good tutorial is available at http://wiki.apache.org.cassandra/GettingStarted. In said tutorial you’ll find Linux-style paths but there’s no need to worry. You can specify Windows-style paths as well. It works fine so and really easy to understand so I am not going to discuss those basics here again. However I would suggest you to first go through the above link and test a single node on your machine then move on.
In this tutorial I am going to make a cluster of two nodes for simplicity. One node is hosted on Machine-A (having IP address 192.168.0.2) and other on Machine-B (having IP address 192.168.0.4). However following these steps you may add as many nodes as you want.
The game of making cluster revolves all around Cassandra.yaml configuration file which you may find under Cassandra Installation directory\conf\Cassandra.yaml.
Let’s start from Machine-A. Open Cassandra.yaml file and start editing. You need to edit cluster_name, listen_address, rpc_address and seeds values as following:
cluster_name: ‘MyCluster’ listen_address: 192.168.0.2 # IP of Machine-A rpc_address: 192.168.0.2 seeds: 192.168.0.2
Start this node using cassandra –f command. Hopefully it will start successfully.
Now come to Machine-B. Open Cassandra.yaml and make sure that cluster_name is same as of cluster_name on Machine-A. Write IP address of Machine-B in listen_address and rpc_address while write IP address of Machine-A against seeds i.e. your configuration file will have following lines.
cluster_name: ‘MyCluster’ listen_address: 192.168.0.4 # IP of Machine-B rpc_address: 192.168.0.4 seeds: 192.168.0.2 # IP of Machine-A.
Start this node and it should also start successfully. Once started open command prompt, navigate to Cassandra bin directory and write the following command to test that you’ve two nodes in your cluster:
nodetool – host 192.168.0.2 –p 7199 ring
The above said link states that you should set initial_token value in Cassandra.yaml. But its optional and setting this value falls in advance configuration so we’re not going to discuss it here.
There’s a good open source administration tool for Cassandra clusters: http://www.datastax.com/products/opscenter. You may find it usefull.
For further reading or troubleshooting you can visit http://wiki.apache.org/cassandra/.
Best of luck with Cassandra!