Apache Cassandra Clustering

Apache Cassandra Clustering

Apache Cassandra Clustering

This tutorial will help us configure an Apache Cassandra’s ring with 2 nodes. It will not explain what Cassandra is, use Google for that.

There are actually not too many properties that we must update in order to set up the cluster. Note that in this particular example, we will be configuring 2 nodes: 1 seed and 1 client.

Configuration

The Seed

“The seed node designation has no purpose other than bootstrapping the gossip process for new nodes joining the cluster. Seed nodes are not a single point of failure, nor do they have any other special purpose in cluster operations beyond the bootstrapping of nodes.”
Open and edit CASSANDRA_HOME/conf/cassandra.yaml
  • rpc_address – set to the IP address of the node
  • seed_provider / parameters / seeds – set to the ip address of the node
  • listen_address – set to the IP address of the node

Client Node

“All nodes in Cassandra are peers. A client read or write request can go to any node in the cluster. When a client connects to a node and issues a read or write request, that node serves as the coordinator for that particular client operation.
The job of the coordinator is to act as a proxy between the client application and the nodes (or replicas) that own the data being requested. The coordinator determines which nodes in the ring should get the request based on the cluster configured partitioner and replica placement strategy.”
Open and edit CASSANDRA_HOME/conf/cassandra.yaml
  • rpc_address – set to the IP address of the node
  • seed_provider / parameters/seeds – set to the IP address of the seed node
  • listen_address – set to the IP address of the node
As you can see the only difference is the value of the seeds.
Now start the Cassandra instance on the seed node, followed by the client node. You should get the following log in the seed machine:
INFO  [HANDSHAKE-/192.168.0.44] 2018-08-02 10:53:24,412 OutboundTcpConnection.java:560 - Handshaking version with /192.168.0.44
INFO  [GossipStage:1] 2018-08-02 10:53:25,421 Gossiper.java:1053 - Node /192.168.0.44 has restarted, now UP
INFO  [GossipStage:1] 2018-08-02 10:53:25,431 StorageService.java:2292 - Node /192.168.0.44 state jump to NORMAL
INFO  [GossipStage:1] 2018-08-02 10:53:25,441 TokenMetadata.java:479 - Updating topology for /192.168.0.44
INFO  [GossipStage:1] 2018-08-02 10:53:25,442 TokenMetadata.java:479 - Updating topology for /192.168.0.44
INFO  [HANDSHAKE-/192.168.0.44] 2018-08-02 10:53:25,472 OutboundTcpConnection.java:560 - Handshaking version with /192.168.0.44
INFO  [RequestResponseStage-1] 2018-08-02 10:53:26,216 Gossiper.java:1019 - InetAddress /192.168.0.44 is now UP
WARN  [GossipTasks:1] 2018-08-02 10:53:26,414 FailureDetector.java:288 - Not marking nodes down due to local pause of 79566127100 > 5000000000

Can you guess which IP is the seed?

Node:

References

Leave a Reply