Configuring Clusters in Cassandra

25 Jul, 2020
Prerequisite – Monitoring cluster in CassandraIn this article, we will discuss how we can configure clusters setting in cassandra.yaml file. Also, we will cover some basic parts of cassandra.yaml file in which we can change the by default setting as per our requirements.
Cluster :In Cassandra, a cluster is a collection of a node. In a cluster, all nodes can communicate through gossip protocol and all nodes have a similar capability in a cluster. A node in the cluster contains keyspaces, tables, schema information, etc.
Cluster Configuration :
In Cassandra, cassandra.yaml is the main configuration file in which we can change the default setting as per requirements and after any changes in cassandra.yaml file you must remember to restart the node to take effect.
The installation location of the cassandra.yaml file is<install_location>/resources/cassandra/conf.
<install_location>/resources/cassandra/conf.
Common properties for Cluster Configuration :The table below contains the common configurations like cluster name, listen_address, seeds, native transport address, etc.
cluster_name :In this configuration, you can change the name of the cluster in cassandra.yaml file. To change the configuration setting follow steps –
open cassandra.yaml file.
use the command ctrl+f to search in a file.
search for cluster_name.
You will see the following property in a file cluster_name: ‘Test Cluster’. It is default setting for the cluster node.
You can change the cluster name as per your requirements and then press ctrl+s to save the file.
listen_address :It is the IP address that is used by other nodes in a cluster to find out this node. To change the configuration setting follow steps –
open cassandra.yaml file.
use the command ctrl+f to search in a file.
Search for listen_address.
You will see the following property in a file listen_address: localhost. It is default setting for the cluster node.
You can change the IP listen_address as per your requirements and then press ctrl+s to save the file.
native_transport_address :It is an IP address that is used by the client to connect with the node or the cluster. To change the configuration setting follow steps –
open cassandra.yaml file.
use the command ctrl+f to search in a file.
Search for native_transport.
You will see the following property in a file native_transport_address: localhost. It is default setting for the cluster node.
You can change the IP native_transport as per your requirements and then press ctrl+s to save the file.
seed address or seed addresses :It is used when a new node joined the cluster. In general, all nodes in a cluster have the same seed list. To change the configuration setting follow steps –
open cassandra.yaml file.
use the command ctrl+f to search in a file.
Search for seeds.
You will see the following property in file seeds: “127.0.0.1”. It is default setting for the cluster node.
You can change the seeds IP address as per your requirements and then press ctrl+s to save the file.
Output –
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.
# Example - "<ip1>, <ip2>, <ip3>"

seeds : "127.0.0.1"
Example of Cluster Configuration :
Apache
DBMS
DBMS
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Types of Functional dependencies in DBMS
MySQL | Regular expressions (Regexp)
OLAP Guidelines (Codd's Rule)
Difference between OLAP and OLTP in DBMS
What is Temporary Table in SQL?
Difference between Where and Having Clause in SQL
SQL | DDL, DML, TCL and DCL
Introduction of Relational Algebra in DBMS
Relational Model in DBMS
KDD Process in Data Mining