2
votes

In Cassandra , to add new Datacenter with higher replication factor in the same cluster throws an error says some range with replication factor 1 is not found in any source Datacenter.

I have Datacenter with (X- RF = 2), and (Y -RF = 1) . I want to add Datacenter (Z - RF = 3).

I have added a nodes in Datacenter Z . But on

nodetool rebuild -- X

It Fails with an error

java.lang.IllegalStateException: unable to find sufficient sources for streaming range (-3685074324747697686,-3680615207285604279] in keyspace with replication factor 1

Basic Details of all Column family :

AND bloom_filter_fp_chance = 0.01

AND caching = '{"keys":"ALL", "rows_per_partition":"NONE"}'

AND comment = ''

AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy'}

AND compression = {'sstable_compression': 'org.apache.cassandra.io.compress.LZ4Compressor'}

AND dclocal_read_repair_chance = 0.1

AND default_time_to_live = 0

AND gc_grace_seconds = 864000

AND max_index_interval = 2048

AND memtable_flush_period_in_ms = 0

AND min_index_interval = 128

AND read_repair_chance = 0.0

AND speculative_retry = '99.0PERCENTILE';
3
Can u post the keyspace? Try 'describe keyspace' incqlshFuzzyAmi
Keyspace have more than 100+ column family . What exactly you want to see . Below I have shared some common details please have a look :sachin
Actually i want the keyspace statement itself. Create keyspace etc.FuzzyAmi
I have used very basic query to create keyspace : CREATE KEYSPACE keyspace_name WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 1 };sachin

3 Answers

0
votes

Your current configuration, as shown in your keyspace definition, is for a single DC. You need to ALTER KEYSPACE it - to include another DC into it. This would start the replication process: keys that will be read/written would be replicated to the new DC. To fully copy all the data, you would need (in addition) to use the nodetool rebuild -- DC2 command

0
votes

What you need to do is ALTER KEYSPACE and then nodetool rebuild. Copy the text that you get from DESCRIBE KEYSPACE keyspace_name but without CREATE in the beginning. Add the new datacenter in the replication.

ALTER KEYSPACE keyspace_name WITH REPLICATION = { 'class' : 'NetworkTopologyStrategy', 'datacenter1' : 1, 'datacenter2' : 3 };

Then do:

nodetool rebuild -- datacenter1
0
votes

Based on your comments - "I have alter my keyspaces but for the default keyspace like (system_distributed) it throws error"

Other than user specific keyspaces, make sure that default system keyspaces like "system_distributed" are on "NetworkTopologyStrategy" (No keyspaces on SimpleStratergy for multi-DC, except local strategy ) Reference: Point-2 https://docs.datastax.com/en/cassandra/3.0/cassandra/operations/opsAddDCToCluster.html