Sunday, February 26, 2012

Setting up a Cassandra cluster using wso2 carbon


If you want to use WSO2 security model with Cassandra cluster here I'll show you, how you can setup a cassandra cluster using wso2 carbon.

First you need to download wso2 carbon (I am using version 3.2.2)

Then install cassandra feature by using the p2 repository from http://dist.wso2.org/p2/carbon/releases/3.2.2/ to wso2 carbon server.

This will install Cassandra 0.7 version to your carbon server.











Adding p2 repository (http://dist.wso2.org/p2/carbon/releases/3.2.2/)












Installing Cassandra 3.2.2 feature


After finishing the installation restart the carbon server. Now carbon server will work as your Cassandra server.


setup few more cassandra nodes using wso2 carbon as above according to your requirement.
You can follow the instruction given by this site for setting up the cassandra cluster.
The cassandra.yaml configuration file is located in $wso2carbon_home/repository/conf/advanced/ directory.


Add following configuration file (cassandra-auth.xml) $wso2carbon_home/repository/conf/advanced/ in order to view keyspaces using Cassandra Keyspaces ui (change the username and password accordingly).


<Cassandra>
   <EPR>https://localhost:9443/services/CassandraSharedKeyPublisher</EPR>
   <User>USERNAME</User>
   <Password>PASSWD</Password>
</Cassandra>

cassandra-auth.xml










Cassandra Keyspaces ui


Once you finish the configuration. You can check the status of the cluster by using Cassandra cluster ui or else You can use nodetool comes with Apache Cassandra to monitor the cluster.









Cassandra cluster monitor ui 


nodetool 

$./nodetool -h 192.168.0.100 -p 9999 ring -u admin -pw admin

Address         Status State   Load            Owns    Token                                    
                                                       113427455640312821154458202477256070485  
192.168.0.100   Up     Normal  20.36 MB        33.33%  0                                        
192.168.0.101   Up     Normal  251.64 MB       33.33% 56713727820156410577229101238628035242    
192.168.0.102   Up     Normal  20.95 MB        33.33%  113427455640312821154458202477256070485

note: remote jmx agent port number in carbon server is 9999 + offset (default offset in carbon.xml is 0)


1 comment:

Shirley said...

Hi Kasun, I've downloaded your version of WSO2Carbon for Cassandra. But I'm having trouble trying to connect and external cassandra cluster. I can't find the file cassandra-component.xml to modify. What should this xml file look like? Thanks, Shirley