1

My Architecture is as follows:

Two data centers DC1 and DC2 in my test cluster named Test Cluster1, DC1 has two spark nodes and DC2 has two transactional(data) nodes, that is i have 4 nodes in my cluster.Then my doubt is that is it possible to set a replication factor of 3 to DC1 or DC2.

Nithin
  • 43
  • 1
  • 8

2 Answers2

2

No, as RF is set per DC, then you can't RF higher than you have nodes in this particular DC - you need to use NetworkTopologyStrategy as this:

{'class':'NetworkTopologyStrategy', 'DC1':2, 'DC2':2 }
Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • I have one more question about electing seeds.Is this also set per DC, if No what will be the benefit. – Nithin Feb 02 '18 at 05:00
  • You need to include nodes from DCs into the seed list - otherwise they won't see each other... (Ref: https://docs.datastax.com/en/cassandra/3.0/cassandra/initialize/initMultipleDS.html) – Alex Ott Feb 02 '18 at 08:43
1

Replication factor should be equal or less with the number of nodes present in a data center.as you have 2-2 nodes in each dc, you can set 2 as RF while altering the Keyspace in below manner

cqlsh>ALTER KEYSPACE WITH replication = {'class': 'NetworkTopologyStrategy' , DC1:2, DC2:2};

Payal
  • 564
  • 3
  • 12