0
votes

I have two DC's:

DC1:

  • Node1 : RAC1
  • Node2 : RAC1

DC2:

  • Node3 : RAC1

I am using GossipingPropertyFileSnitch and I have removed file cassandra-topology.properties and only use cassandra-rackdc.properties with below config for each node:

dc=DC1

rack=RAC1

prefer_local=true

On creating a keyspace as below on DC2:

CREATE KEYSPACE "test_rf"
  WITH REPLICATION = {
   'class' : 'NetworkTopologyStrategy',
   'DC1' : 0
   'DC2' : 1
};

I assumed that this keyspace, should not be replicated (which I understand as not even seen on) to DC1: Node1 and Node2.

But, I can see the keyspaces in DC1's each node. Also, I can see any table created on DC2 replicated to DC1.

Can someone please explain why this happened ? Or have I missed something completely !!!

1
You see them created on disk, or when you're using DESCRIBE?Alex Ott
I could do a SELECT * FROM keyspace.table_name; and get the result !!!Black Diamond

1 Answers

2
votes

Its only the metadata about the keyspace and table definition that gets created on both datacenters of the Cassandra ring.

Its not the actual data that gets replicated everywhere. This can be confirmed by logging on to individual nodes and checking the data directory. In fact the folders might have got created, but you shouldn't see any sstable files inside that keyspace/table/ directory.

In fact you can read/write from that table from any datacenter. While you read/write from DC1 its actually feeding the data from DC2.