简体   繁体   English

Cassandra Quorum:一致性级别

[英]Cassandra Quorum : Consistency Level

I have a 3 DC ring in Cassandra with each DC having a 4 node cluster. 我在Cassandra中有3个DC环,每个DC都有4个节点群集。 So its 4 nodes*3(DC) = 12 nodes. 因此它的4个节点* 3(DC)= 12个节点。 I'm testing how Cassandra behaves when some nodes go down when we have Quorum consistency level. 当我们具有Quorum一致性级别时,我正在测试当某些节点出现故障时Cassandra的行为。 We have set a replication factor of 3 on each datacenter. 我们在每个数据中心上将复制因子设置为3。 So our 所以我们

Quorum = Floor(Sum of Replication FActor/2) + 1. RF = 3 quorum= 5.

In theory if I have five nodes in my 12 node cluster, I should be good for read and write. 从理论上讲,如果我的12个节点群集中有五个节点,那么我应该会读写。 So I brought down a full Datacenter DC1, and 3 nodes in another datacenter(Dc2). 因此,我关闭了一个完整的数据中心DC1,并在另一个数据中心(Dc2)中关闭了3个节点。 So I have 1 node up in DC2 and whole of DC3(4 nodes). 所以我在DC2中有1个节点,在DC3中整个(4个节点)。 I have 5 nodes up. 我有5个节点。 By theory, this should be good for my writes to be succesfull in quorum consistency. 从理论上讲,这对于我的写作在仲裁一致性方面取得成功应该是一件好事。 But, when I ran, I get 但是,当我跑步时,我得到了

Cassandra.Unavailable Exception: Not enough replica available for query at consistency ONE (5 required but only 4 alive) . Cassandra.Unavailable Exception: Not enough replica available for query at consistency ONE (5 required but only 4 alive)

But, I do have 5 nodes alive. 但是,我确实有5个节点处于活动状态。 What am I missing here ? 我在这里想念什么?

QUORUM by itself, refers to members of same data-center. QUORUM本身是指同一数据中心的成员。 Which in your case DC3 has of 4. But you asked for QUORUM of 5, which DC3 cannot provide. 在您的情况下,DC3具有4。但是您要求QUORUM为5,而DC3无法提供。 That is why there is concept like ONE and LOCAL_ONE. 这就是为什么存在像ONE和LOCAL_ONE这样的概念的原因。

I am pretty sure you will get same error at QUORUM 5, even if your all DC nodes are up. 我非常确定即使所有DC节点都已启动,在QUORUM 5上您也会遇到相同的错误。

You can refer : http://docs.datastax.com/en/cassandra/2.0/cassandra/dml/dml_config_consistency_c.html 您可以参考: http : //docs.datastax.com/en/cassandra/2.0/cassandra/dml/dml_config_consistency_c.html

From my point of view the operations should and will fail. 从我的角度来看,操作应该并且将会失败。

From the DC that is up you can guarantee at any time 3 replicas, RF 3. 通过启动的DC,您可以随时保证3个副本,即RF 3。

The node up in the other DC has ~60% to nail down another replica. 另一个DC中位于上一个的节点大约有60%可以确定另一个副本。

3 + 1 = 4. 3 +1 = 4。

You`re asking for CL 5. 您要CL 5。

5 > 4 => fail. 5> 4 =>失败。

Quorum is for the entire cluster and Local_Quorum is for a single Data center. Quorum适用于整个群集,而Local_Quorum适用于单个数据中心。 Just some basics to understand, cassandra is distributed systems meaning data is distributed in your cluster with each node owning a primary range and at the same time replicating data of other nodes. 仅需了解一些基础知识,cassandra是分布式系统,这意味着数据在您的群集中分布,每个节点拥有一个主范围,并同时复制其他节点的数据。 This means nodes which are responsible to store a piece of data are the only nodes which are calculated for Consistency. 这意味着负责存储数据的节点是唯一为一致性计算的节点。 In your case 5 nodes are up does not mean Quorum consistency is met for the writes or reads, because the DC with all nodes up will definitely have data in atleast 3 nodes (remember your RF is 3), but the DC with only 1 node will either have or not have data you are querying. 在您的情况下,5个节点处于活动状态并不意味着满足写入或读取的仲裁一致性,因为所有节点处于活动状态的DC肯定会在至少3个节点中保留数据(请记住您的RF为3),但是DC只有1个节点将拥有或没有您要查询的数据。

In your case if you hit the DC with all node up using a Local_quorum you will get correct results. 在您的情况下,如果您使用Local_quorum命中所有节点,则DC将获得正确的结果。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Cassandra:插入失败,一致性级别为“ Quorum” - Cassandra: Insert fails for consistency level “Quorum” Cassandra - 无法达到一致性级别 QUORUM ISSUE - Cassandra - Cannot achieve consistency level QUORUM ISSUE Cassandra QUORUM写一致性级别和多个DC - Cassandra QUORUM write consistency level and multiple DC Cassandra - 无法达到一致性级别 QUORUM - Cassandra - Cannot achieve consistency level QUORUM 尽管QUORUM与复制因子3的一致性水平,Cassandra仍然不一致 - Cassandra is not consistent despite QUORUM consistency level with replication factor 3 Cassandra群集安装错误:UnavailableException:无法达到一致性级别QUORUM - Cassandra Cluster Setup Error : UnavailableException: Cannot achieve consistency level QUORUM Cassandra:无法在特定键空间上达到一致性级别 QUORUM - Cassandra: Cannot achieve consistency level QUORUM on a specific keyspace Cassandra Authenticator出错(无法达到一致性级别QUORUM) - Error with Cassandra Authenticator (Cannot achieve consistency level QUORUM) 如果较低的一致性级别是好的,那么为什么我们需要在Cassandra中具有较高的一致性(QUORUM,ALL)级别? - If lower consistency level is good then why we need to have a higher consistency(QUORUM,ALL) level in Cassandra? Cassandra 身份验证失败:“无法执行身份验证:无法达到一致性级别 QUORUM” - Cassandra Authentication Fail: "Unable to perform authentication: Cannot achieve consistency level QUORUM"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM