I have two DC's:
我有两个DC:
DC1:
- Node1 : RAC1
- Node2 : RAC1
节点1:RAC1
Node2:RAC1
DC2:
- Node3 : RAC1
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:
我正在使用GossipingPropertyFileSnitch,我已经删除了文件cassandra-topology.properties,并且只对每个节点使用cassandra-rackdc.properties和以下配置:
dc=DC1
rack=RAC1
prefer_local=true
On creating a keyspace as below on DC2:
在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.
我假设这个密钥空间不应该被复制(我理解为甚至没有看到)到DC1:Node1和Node2。
But, I can see the keyspaces in DC1's each node. Also, I can see any table created on DC2 replicated to DC1.
但是,我可以在DC1的每个节点中看到键空间。此外,我可以看到在DC2上创建的任何表复制到DC1。
Can someone please explain why this happened ? Or have I missed something completely !!!
有人可以解释为什么会这样吗?或者我完全错过了什么!
1 个解决方案
#1
2
Its only the metadata about the keyspace and table definition that gets created on both datacenters of the Cassandra ring.
它只有在Cassandra环的两个数据中心上创建的关键空间和表定义的元数据。
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.
它不是到处复制的实际数据。这可以通过登录到各个节点并检查数据目录来确认。实际上文件夹可能已经创建,但是你不应该在keypace / table /目录中看到任何sstable文件。
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.
实际上,您可以从任何数据中心读取/写入该表。当您从DC1读取/写入时,它实际上从DC2提供数据。
#1
2
Its only the metadata about the keyspace and table definition that gets created on both datacenters of the Cassandra ring.
它只有在Cassandra环的两个数据中心上创建的关键空间和表定义的元数据。
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.
它不是到处复制的实际数据。这可以通过登录到各个节点并检查数据目录来确认。实际上文件夹可能已经创建,但是你不应该在keypace / table /目录中看到任何sstable文件。
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.
实际上,您可以从任何数据中心读取/写入该表。当您从DC1读取/写入时,它实际上从DC2提供数据。