Reputation: 161
I have 5 machines cassandra cluster and 3 nodes belong to ESX1 host and other 2 machine belong to ESX2 host. I have keyspace called profilemanager with replication factor 3. As per my understanding cassandra distribtes the data across multiple nodes based on replication factor.
Question: If keyspace profilemanager having replication factor 3 then there might be a chance that all 3 copies data can be held in ESX1 host. If ESX1 goes down then all the corresponding 3 machines goes down then there will be no High availability. Is there a way to specify the machine to hold the replication for specific machine.
For Example: A,B,C,D,E machine are there. Two copies must be saved in A,B and third copy must be saved in D/E.
Upvotes: 1
Views: 59
Reputation: 57748
You should be able to solve this using Cassandra's feature for specifying logical data centers and racks. If you use the GossipingPropertyFileSnitch
you should be able to specify the following in each ESX1 node's cassandra-rackdc.properties
file:
dc=YourDatacenterName
rack=ESX1
And on each ESX2 node:
dc=YourDatacenterName
rack=ESX2
At write time, Cassandra then ensure that either secondary or tertiary replicas are streamed to nodes in another rack. In this way, all replicas for a partition will not be on the same ESX host.
Upvotes: 2