Question-: You have created the Cassandra cluster using the “GossipPropertyFileSnitch�. This is a node cluster. Now you have found that the one of the node in the cluster is placed in the wrong rack. What would you do fix that? A. Decommission node and re-add it to the correct rack and datacenter B. Update the node’s topology and start the node. C. Update the Cassandra.yaml file and restart the node D. Bring down the cluster and then place the node in correct rack
Answer: A,B
Explanation: If you have placed the node in a wrong rack, then you can use the following method to place the node in correct rack. 1. The preferred method is to decommission the node and re-add it to the correct rack and datacenter : But using this method takes longer than the alternative method (mentioned below) because data is first removed from the decommissioned node and then the node gets the new data during the bootstrapping. But the method below do this concurrently. 2. Another approach would be updating the node’s topology and restart the node. Once the node is up, run a full repair on the cluster. However, this method is risky because until the repair is completed, the node may blindly handle requests or data the node does not yet have. To mitigate this problem with the request handling, start the node with -Dcassandra.join_ring=false after repairing once, then fully join the node to the cluster using the JMX method org.apache.cassandra.db.StorageService.joinRing(). The node will be less likely to be out of sync with other nodes before it saves any requests. After joining the node to the cluster, repair the node again, so that any writes missed during the first repair will be captured.
Question-: You have your Cassandra cluster is setup in datacenters, and you want to remove one of the datacenters from the cluster. Which of the following steps at least you have to do to remove the Datacenter from the cluster? A. No client should write on the nodes in the datacenter which is going to be removed. B. We need to run the “nodetool repair –full� C. Update the keyspace so that they no longer point to datacenter which is going to be removed. D. Shutdown all the nodes from the datacenter which is being removed. E. Run “nodetool assassinate� command on every node in the datacenter being removed. F. Restart the all the nodes in remaining two datacenter
Answer: A,B,C,D,E
Explanation: When we need to remove an entire datacenter then it involves more steps then removing a single node. Hence, we have to be careful while doing that. And if your design has data only in one datacenter (which is absolutely wrong design). Then even you should be more careful. To remove a datacenter you have to accomplish at least following option mention in the option. A. No client should write on the nodes in the datacenter which is going to be removed. B. We need to run the “nodetool repair –full� C. Update the keyspace so that they no longer point to datacenter which is going to be removed. D. Shutdown all the nodes from the datacenter which is being removed. E. Run “nodetool assassinate� command on every node in the datacenter being removed.
There should not be any need for restarting the entire cluster. If that is the case, then availability would be affected. And Cassandra is not designed with considering any downtime. If you have to do, it means something wrong with the architecture or your cluster design.
Question-: Which of the following statement is true with regards to the “nodetool drain� command? A. It flushes all the SSTables to the disk B. It flushes all the memtables to SSTables on disk. C. It replays data from commit log D. Cassandra will stops listening for connections from the client and other nodes. E. You should use this command before upgrading a node to a newer version of Cassandra
Answer: B, D, E Exp: “nodetool drain� command flushes all the memtables from the node to SSTables on disk. And Cassandra stop listening for connections from the client and other nodes. You need to restart the Cassandra on this node after this command. This command is usually helpful for upgrading a node to a new version of the Cassandra.