Hi All, These days we hear a lot of buzz in and around the IT industry regarding the BigData and NoSql. Here in this post i wanted to show you how to setup multi node cluster on single machine(Windows).
In Windows machine please navigate to “C:\Windows\System32\drivers\etc” and edit the “hosts.etc” file and add the following content as below.
#cassandra cluster nodes 127.0.0.1 127.0.0.2 127.0.0.1 127.0.0.3 127.0.0.1 127.0.0.4 127.0.0.1 127.0.0.5 127.0.0.1 127.0.0.6
once we add the cassandra nodes to hosts.etc file, please download the latest version of Apache Cassandra from the following sitedownload cassandra once downloaded please extract that to one of the folders as “appache-cassandra-2.1.6-node1″(similarly, extract 3 different copies of the same zip file to 3 different folders).
once you are ready with Cassandra folders now its time to modify the cassandra config file located in /conf/cassandra.yaml file.
please edit the following values in the config file
Provide the seed nodes for each cassandra.yaml file as 127.0.0.1 and 127.0.0.2 etc.;
seed_provider: # Addresses of hosts that are deemed contact points. # Cassandra nodes use this list of hosts to find each other and learn # the topology of the ring. You must change this if you are running # multiple nodes! - class_name: org.apache.cassandra.locator.SimpleSeedProvider parameters: # seeds is actually a comma-delimited list of addresses. # Ex: "<ip1>,<ip2>,<ip3>" - seeds: "127.0.0.1,127.0.0.2"
Note: You need to ensure that the following values are changed for each node
directories where Cassandra should store data on disk
data_file_directories: - /training/node1/var/lib/cassandra/data # commit log commitlog_directory: /training/node1/var/lib/cassandra/commitlog # saved caches saved_caches_directory: /training/node1/var/lib/cassandra/saved_caches
make sure you also change the follwing listen address and rpc address for every node of cassandra.
listen_address: 127.0.0.1 rpc_address: 127.0.0.1
finally your configuration should look as
Node 1 = 127.0.0.1
Node 2 = 127.0.0.2
Node 3 = 127.0.0.3
Node 4 = 127.0.0.4
Node 5 = 127.0.0.5
Thats it, we have configured the multi node cassandra cluster and its ready to run.
Please post me if you face any problem in the configuration and setup related issues.
Happy Configuring Cassandra. 🙂