Adding nodes to Cassandra Cluster
Asked Answered
G

1

7

I have a 1 node - 1 cluster Cassandra running on my local machine. I want to see how Cassandra scales up, when I simply add the second node to the same cluster. The second node that I am adding will also run from my local machine.

I have been trying to lookup a lot of approaches to do this, but can't find any. Any simple way through which I can add second instance of Cassandra to my cluster?

Gujral answered 4/11, 2015 at 1:21 Comment(1)
Maybe the easiest (slow, though) would be to have a VPS that has a shared IP address so you can connect to/from it. I have done that to test with many nodes, but the hard drives are just really slow when you have too many in this way.Decarbonize
O
8

The act of adding a second node is known as bootstrapping. The procedure is straightforward:

  • Make sure the cluster names match in cassandra.yaml

  • Point the new (joining) node to the cluster using the seeds setting in the yaml

  • Start cassandra, it will join.

This is described in detail online, but one of the easiest ways to see it in action is using ccm , which is a tool many cassandra developers use to setup fake clusters on their local computers.

Currently (all versions up to 3.9), Cassandra's unique ID is an IP - you can only have one instance per IP. If you need more than one cassandra instance per computer, you need to use multiple IPs.

Otalgia answered 4/11, 2015 at 3:0 Comment(3)
It is "straightforward" when you use one computer per node.Decarbonize
so, there´s nothing that I´ve to do in the old node?Allot
You should run "nodetool cleanup" on the old node after the new node has finished joining (shows UP/NORMAL in the ring). That will remove the data that was previously owned, but is no longer owned by that instance.Otalgia

© 2022 - 2024 — McMap. All rights reserved.