Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

ranjeet_ranjee avatar image
ranjeet_ranjee asked ·

Is there a chance of data loss if I remove a non-existent DC from replication?

I have a keyspace with the following replication:

cassandra@cqlsh> describe database
CREATE KEYSPACE adserv WITH replication = {'class': 'NetworkTopologyStrategy', 'singapore': '2', 'singaporedo': '2'}  AND durable_writes = true;

The servers in singapore do not exist.

[root@cassandra-7 ~]# dsetool status
Warning: Not able to read Analytics Master data, SparkMaster data may not be correctDC: singaporedo     Workload: Cassandra       Graph: no     
======================================================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--   Address   Load       Owns   Token                    Rack   Health [0,1] 
                                  1051212759506365289
UN   Node-1   379.53 GiB     ?      -9962553594005710   rack-1   0.90         
UN   Node-12  407.37 GiB     ?      10212759506365289   rack-1   0.90

what can you do to change this? If I edit this will it modify anything? Is there any chance to lose data?

If I execute the below command to remove 'singapore', will it be fine.

ALTER KEYSPACE adserv WITH replication = {'class': 'NetworkTopologyStrategy', 'singaporedo': '2'}  AND durable_writes = true;
cassandrareplication
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

@ranjeet_ranjee It's fine to remove the DC which doesn't exist from replication. You won't lose any data because the nodes don't exist anyway meaning there are no replicas (copies of the data) kept in a data centre which does not have any nodes in it.

As a side note, if this is for production you really need to have a minimum of 3 replicas per DC which is our recommendation so keep that in mind. For more information, see Data replication. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.