Adding new node cassandra 3.x - cassandra

We are in the process of adding new nodes to our existing cassandra 3.x cluster. Basically following the steps outlined in this article (https://docs.datastax.com/en/cassandra/2.1/cassandra/operations/ops_add_node_to_cluster_t.html).
Currently, out 3.x cluster does incremental repairs. What I'm not 100 percent sure about is if we need to do anything after we do the node cleanup. Specifically, are our new added nodes setup to do incremental repairs after following the procedure listed above?
Thanks
Marshall

Adding a node involves rebalancing the token distribution among nodes in the cluster and bootstrapping the new node. Repair is a regular maintenance process and it's not necessarily needed in the adding node process.
For the token redistribution part, simplified example is if your have 20 tokens and 4 nodes initially. If random enough, each node would be the primary node for 5 tokens. When add a node and change the configuration, 20 tokens would be distributed to 5 nodes and each node would be the primary node for 4 tokens. When you run bootstrap to add the new node, the new node knows what tokens belongs to it and it will stream missing tokens from other existing nodes. After bootstrapping is done, nodetool cleanup on the existing nodes would remove tokens which don't belong to them anymore. To sum up, bootstrapping new node would redistribute tokens and stream objects to new nodes based on the distribution. you don't need repair in this process to stream data. cleanup would remove objects which the ownership is changed.
However, repair is a regular process to guarantee data consistency and incremental or full options are out of scope in terms of talking about adding node.
Good reference to read under the hood on what happens when you change the topology of a cluster

Related

Cassandra 3.x - Adding 3 nodes to a 6 node cluster

I am looking to add 3 nodes to an existing 6 nodes cassandra cluster, but I'm a bit confused on how best to do this due to the token assignments.
Currently, the existing 6 node cluster is not using vNodes (this can't be changed) and is using RandomPartitioner and so the current tokens were added as per the token generator. The issue is that adding 3 nodes to a 6 node cluster means that the recalculated tokens would put the new node 7 with the same token as the current node 5.
What is the best practice here? Should I do a nodetool move on the existing nodes to add in the recalculated tokens, THEN bootstrap the new nodes with the correct config and tokens. Or do I add the new nodes with no token, and once bootstrapped, then nodetool move across all the nodes adding in the newly calculated tokens, starting from the second node (as first node is always 0 with RandomPartitioner).
I've done a lot of reading, but can't seem to find a scenario that covers this eventuality. And I can't add more than 3 nodes, long story...
Any help greatly received!
You need to recalculate the tokens for you whole cluster and assign the new tokens to the existing nodes. Detailed instructions can be found here. Since you are recalculating for the whole cluster, you should not have the issues that you are talking about.
I think that the best solution would be to add a new DC where you would use vnodes and Murmur3. After the data is replicated and you have moved all your clients to the new DC, you would decommission the old DC.

How does Cassandra balance the load when add a server/node

trying to find articles regarding how Casandra balances the load when add a server/node? that is, after adding a node, how cassandra moves certain partitions from existing nodes to new node, and how quick it could be done?
When you add a node to your existing cluster cassandra automatically will assign token ranges to your new node and stream relevant data to it. While this happens nodetool status will show the node as JOINING.
After streaming completes the node is part of your and will handle requests as any other node also does reducing the load on them. But your data size on the old nodes won't shrink - you need to issue nodetool cleanup to get rid of the now obsolete data.
For how quick this can be done, that depends on your clusters load and data size that must be streamed - but streaming is limited on network bandwidth of course.

How to add a seed node in cassandra 3 clutser?

I was trying to change one of my node to a machine with high specs (more memory and CPU). So I run node decommission wait to leave the ring, terminate the machine and add a new machine. After that I configured the cassandra.yaml with
cluster_name
listend_address
rpc_broadcast_address
-seeds: with the ip's machine
After starting the cassandra service, the seed node joined the ring right way and with a low load. Which for me is really strange, since others node took a lot of time to join the ring.
After 1h the seed node is still with the same load.
What should I do to add the seed node?
Thanks in advance.
Yes, many newer users of Cassandra have this idea that a seed node is some mystical master-node equivalent. It's really not anything special. Essentially, a node needs to know about the cluster topology at start-time, and the seeds property provides a list of nodes that should be there.
In theory, you can have a new node designate any existing node as its seed node. And that node could designate another node as its seed node. And so on, and so on. All it does is use that node to figure out the cluster topology.
After starting the cassandra service, the seed node joined the ring right way and with a low load. Which for me is really strange, since others node took a lot of time to join the ring.
After 1h the seed node is still with the same load.
What should I do to add the seed node?
Seed nodes do not stream data. The extra steps required to get data on to a seed node, are one of the main reasons that it's not a good idea to designate all nodes as seed nodes.
You could just run a nodetool repair or rebuild on the new seed node, and that would stream data to it. The problem with this approach, is that it will still be accepting requests (and probably failing) while it is streaming data.
The other approach, would be to add the new node while specifying other existing node(s) in that node's seeds list.
Once it is up and has streamed data, then you have a couple of options:
Leave everything as-is, and any future nodes can use your new node in its seed list.
If your other existing nodes have a node(s) in their seed list that don't exist anymore, you can update those to point to your new node as a seed.
The nice part about option #2, is that you can change that in the cassandra.yaml and not have to restart them. This is because the only time you'll ever need that change is when a restart happens anyway. The seed node designation don't come into play during normal operations.
Hope that helps!

cassandra 2.2.8: How to add node to cassandra dataCenter /Cluster with minimum impact

I added a new node to Cassandra cluster by making it seed node and than started rebuilding it (nodetool rebuild ) command. Although node joined the cluster quickly, the rebuild process that started streaming from all nodes in selected caused the whole dc nodes to slow down. The impact on application is severe. I'll have to stop rebuild process in order to keep normal operation ON!.
Here, I'm seeking advice if you guys can share ways/tricks so to minimize the impact of (node rebuild ) operation on rest of dc nodes and application.
I'll much appreciate your suggestions - thanks for reading my message and your help in advance.
While adding a new node you shouldn't make it a seed node. The seed node is used to bootstrap other nodes and join them in cluster. Making the new node as a seed node will not allow to join the new node in the cluster. Follow the steps provided in the Cassandra docs provided in the link below.
https://docs.datastax.com/en/archived/cassandra/2.0/cassandra/operations/ops_add_node_to_cluster_t.html
This is the best way to add a new node in the cluster.
Note: Make sure the new node is not listed in the -seeds list. Do not make all nodes seed nodes. Please read Internode communications (gossip).
As I understand, you added a node as a seed node just so it will not bootstrap and join the cluster instantly. While is approach is right for it joins the cluster quickly, the downside is, it will not bootstrap and hence will not copy all the data from other nodes that it is responsible for. When you run a rebuild on that node, data is blindly copied (without doing any validation) from other nodes, which can choke up existing nodes throughput and your network pipeline. This approach is very safe and is recommended when using adding a new DC but not when adding nodes to an existing DC.
When you are adding a node, the simplest way is to add a node using the procedure described here. https://docs.datastax.com/en/archived/cassandra/2.0/cassandra/operations/ops_add_node_to_cluster_t.html
When the node bootstrap, it will copy data needed from other nodes but will not start taking client connections until it fully bootstraps and validates the data. So, add one node at a time and let it bootstrap so all the necessary data is copied and validated. After you are done adding the number of nodes you desire, run a cleanup on all the previously joined nodes to cleanup all the keys for which the old nodes are not responsible.

Adding a new node to existing cluster

Is it possible to add a new node to an existing cluster in cassandra 1.2 without running nodetool cleanup on each individual node once data has been added?
It probably isn't but I need to ask because I'm trying to create an application where each user's machine is a server allowing for endless scaling.
Any advice would be appreciated.
Yes, it is possible. But you should be aware of the side-effects of not doing so.
nodetool cleanup purges keys that are no longer allocated to that node. According to the Apache docs, these keys count against the allocated data for that node, which can cause the auto bootstrap process for the next node to not properly balance the ring. So depending on how you are bringing new user machines into the ring, this may or may not be a problem.
Also keep in mind that nodetool cleanup only needs to be run on nodes that lost keyspace to the new node - i.e. adjacent nodes, not all nodes, in the cluster.

Resources