Cassandra's-Gossip Protocol

 Gossip Protocol


Cassandra uses gossip protocol to know the state information of nodes. The gossip protocol is named after the concept of human gossiping. This gossiping runs every second in the Cassandra cluster. We use nodetool command "nodetool gossipinfo". It gives the complete gossip information about all the nodes in the cluster. It gives state information, schema version, DC, Rack, Load etc.

The nodes can gossip with any of their peers. If for some reason one node cannot gossip with it peers, it will directly go to the seed node which is given in the cassandra.yaml (main configuration file in Cassandra) of that particular node and asks the seed node to share the gossip. 

Gossip protocols are also called as epidemic protocols. The main use of gossip protocol in Cassandra is "failure detection".

Once per second, the gossiper chooses a random node in the cluster and initialize a gossip session with it.
Every round of gossip requires three messages.
1. The gossip initiator sends its chosen peer a GossipDigestSyn message.
2. When the peer receives this message, it returns a GossipDigestAck message.
3. When the initiator receives the ack message from the peer, it sends the peer a GossipDigestAck2          message to complete the round of gossip. 

As Cassandra gossip is used for failure detection, the gossiper class maintains a list of nodes that are available and list of nodes that are dead.


Comments

Popular posts from this blog

Cassandra Reaper Configuration

Authorization in Cassandra

Authentication in Cassandra