Question-151: What do you mean by bootstrapping?

Answer: bootstrapping is a process of adding new nodes in the Cassandra cluster. If you define a parameter called “num_tokens” how many virtual nodes would be on that particular node. And this node is responsible for these many number of tokens. However, you can use token allocation algorithm to automatically assign the token for new node.

Question-152: How does token allocation works?

Answer: If default' token allocation algorithm is used then new node will pick “num_tokens” parameter value as random tokens to become responsible for. Since this token distributions are random, load distribution improves with a higher amount of virtual node, but it also increases token management overhead. As per the documentation default 256 virtual node should provide a reasonable load balance with SSTable overhead. 

Question-153: How do you define token allocation algorithm?

Answer: An allocation algorithm allocate the tokens based on the load of existing virtual nodes for a particular given keyspace, and for this approach, the new node must be started with the JVM option “-Dcassandra.allocate_tokens_for_keyspace=”HadoopExam”, Where Hadoopexam is the name of the keyspace , and algorithm can find the load information on the cluster to optimize token assignment for this keyspace. 

Question-154: How can you define token manually? 

Answer: To specify the token manually, you may specify a comma-separated list of tokens manually with the “initial_token” properties in cassandra.yaml file. If the value is set for this parameter, then Cassandra will skip the token allocation process. This approach is good when you are using an external tool for token assignment or restoring a node with previous tokens. 

Question-155: How do you handle if node bootstrap process fails?

Answer: If bootstrap process fails, it is possible to resume bootstrap from the previous saved state by calling “nodetool bootstrap resume” command. If this does not work then you can simply restart the node, and if you want to start from scratch then there is a property you need to set as part of JVM argument, which is “-Dcassandra.reset_bootstrap_progress=true”.