mac
mac

Reputation: 647

Cassandra: Who creates/distributes virtual Nodes among nodes - Leader?

In Cassandra, virtual nodes are created and distributed among nodes as given in http://www.datastax.com/dev/blog/virtual-nodes-in-cassandra-1-2. But who does that process ? Creating the virtual nodes, distributing among peers. Is it some sort of leader ? How does it work ?

Also in case a node joins, virtual nodes are re-distributed. Lot more similar actions are present. Who does all those ?

Edit: Is it like when a node joins, it takes up some part of virtual nodes from existing cluster thus eliminating the need of leader ?

Upvotes: 1

Views: 114

Answers (1)

nevsv
nevsv

Reputation: 2466

New node retrieves data about the cluster using seed nodes.

The new node will take his part of the cluster, based of num_tokens parameter (by default it will be distributed evenly between all nodes existing nodes), and will bootstrap it's part of data. The rest of the cluster will be aware about the changes by "gossiping" - using gossip protocol.

Except the seed nodes part, there's no need for any "master" in the process.

Old nodes will not delete partitions automatically, you need to run nodetool cleanup on the old nodes after adding a new node.

Here's good article about it:

http://cassandra.apache.org/doc/latest/operating/topo_changes.html

Upvotes: 0

Related Questions