Reputation: 253
I am new to Cassandra and trying to setup a Cassandra 2.0 cluster using 4 nodes, 2 each in 2 different racks. All are in same data centre. This is what I see in the documentation:
To use racks correctly:
- Use the same number of nodes in each rack.
- Use one rack and place the nodes in different racks in an alternating pattern. This allows you to still get the benefits of Cassandra's rack feature, and allows for quick and fully functional expansions. Once the cluster is stable, you can swap nodes and make the appropriate moves to ensure that nodes are placed in the ring in an alternating fashion with respect to the racks.
What I have understood is, in cassandra-rackdc.properties
, I need to use single rack name even though I have 2 racks and then place the nodes in such an order that they are placed in an alternating fashion - RAC1-NODE1
, RAC2-NODE1
, RAC1-NODE2
, RAC2-NODE2
.
Just wanted to know if this is correct. If yes, how do I enforce this order while adding nodes.
Thanks.
Upvotes: 1
Views: 3268
Reputation: 103
The rack related information applies only to the single-token architecture and not applicable to virtual nodes. In case you are using vNodes then you need not worry about it.
Upvotes: 0
Reputation: 1931
This writing seems to me a little unclear, but this may be due to me not being a native English speaker. The first statement though is clear - you should definitely have an equal amount of nodes in each rack. Regarding the second statement - that is where I am uncertain what it means. I suspect that this piece of the documentation was carried from a long time ago, and needs some revisiting. My understanding is that if you use PropertyFileSnitch, then you should use appropriate rack names for your nodes, you just need to place them in an alternating order into the ring. Ordering is done via an explicit token assignment, or, if you use virtual nodes in the datacenter, then it is done automatically for you.
Upvotes: 1