To avoid a single point of failure, Cassandra server can be run on each server machine (AMS and AGS), thereby Cassandra servers acting as a cluster.
To set up the Cassandra cluster, perform the following actions:
- Open Cassandra.yaml file and specify the below:
cluster_name: Give a name for the cluster.
seeds: Mention the IP address of each node in the cluster, separated by commas.
listen_address: This is the IP address that other nodes in the cluster will use to connect. By default, the value will be "localhost" which canneeds to be changed to the IP address of the node.
rpc_address: This is the IP address for remote procedure calls. The default value is "localhost". If the server's hostname is properly configured, leave this as is. It can be replaced with the server's IP address or the loopback address (127.0.0.1).
endpoint_snitch: Set the value to "GossipingPropertyFileSnitch".
Open the cassandra-rackdc.properties file and specify the Data Center and Rack names:
Open the cassandra-topology.properties file.
Under the Cassandra Node IP address, specify the IP address of the node to the respective Rack and Data center.Start the Cassandra server on every node in the cluster using the command below:
Set Replication Factor using the command below:
If Cassandra servers are running on the same Data CenterIf Cassandra servers are running on a different Data CenterAfter Replication factor is set, run the nodetool repair command below in every node in the cluster:
By this, the cluster setup must be ready. To check the status of a particular node, run the nodetool status command below: