Tuesday, October 5, 2010

Setting up multiple nodes in cassandra :

To set two different machines as node's we need to alter these three properties in
/opt/cassandra/conf/storage-conf.xml

<seed>Ip of the machine which needs to be the seed</seed>

Lets assume you want have two machines setup with cassandra

192.168.1.3 & 192.168.1.4

we want 192.168.1.3 to be the seed

So set
i. <seed>192.168.1.3</seed>
in both the machines

ii. <ListenAddress>{Respective Ip's}</ListenAddress>
<ListenAddress>192.168.1.3</ListenAddress>
<ListenAddress>192.168.1.4</ListenAddress>

iii. <ThriftAddress>{Respective Ip's}</ThriftAddress>

You are done with the configuration, Now create Keyspaces in both the machine's

</Keyspace>
<Keyspace Name="Prototype">
<ColumnFamily Name="master" CompareWith="UTF8Type" />
<ColumnFamily ColumnType="Super" CompareWith="UTF8Type" Name="Supermaster" />
<ReplicaPlacementStrategy>org.apache.cassandra.locator.RackUnawareStrategy</ReplicaPlacementStrategy>

<ReplicationFactor>1</ReplicationFactor>

<EndPointSnitch>org.apache.cassandra.locator.EndPointSnitch</EndPointSnitch>
</Keyspace>


You're done. You will see the data inserted in one of the machine gets replicated in the other machine

No comments:

Post a Comment