gpt4 book ai didi

amazon-web-services - Cassandra 集群,想要跨一些数据中心进行复制,但不是全部

转载 作者:行者123 更新时间:2023-12-05 04:10:38 26 4
gpt4 key购买 nike

我正在查看文档,但找不到如何执行我需要的操作。我需要为以下场景设置 Apache Cassandra(不是 datastax,目前我只有一个测试集群):

我需要 1 个集群跨越 4 个数据中心(有些可能是位于不同地理位置的物理数据中心,有些可能是 AWS)。

在这个集群中,我需要 3 个键空间。一个键空间复制到所有数据中心,其余键空间只需要复制到1个数据中心。

+---------------------------------------------------+
| DC 1 | DC 2 | DC 3 | DC 4 |
+---------------------------------------------------+
| Keyspace A | Keyspace A | Keyspace A | Keyspace A |
+---------------------------------------------------+
| | | Keyspace B | Keyspace B |
+---------------------------------------------------+
| Keyspace C | Keyspace C | | |
+---------------------------------------------------+

原因是KeyspaceB和KeyspaceC中的数据按照法律义务必须保存在不同的区域。我可以用一个集群配置复制因子 0 或其他东西来填补上表中的空白区域,还是我需要 3 个不同的集群?

加油,文斯。

最佳答案

其实,我发现了。

http://docs.datastax.com/en/cassandra/3.0/cassandra/operations/opsChangeKSStrategy.html

It is possible to restrict the replication of a keyspace to selected datacenters, or a single datacenter. To do this, use the NetworkTopologyStrategy and set the replication factors of the excluded datacenters to 0 (zero), as in the following example:

cqlsh> ALTER KEYSPACE cycling WITH REPLICATION = {'class' : 'NetworkTopologyStrategy', 'DC1' : 0, 'DC2' : 3, 'DC3' : 0 };

关于amazon-web-services - Cassandra 集群,想要跨一些数据中心进行复制,但不是全部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44145043/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com