Cassandra 可调一致性练习
Cassandra tunable consistency exercise
我需要一些帮助来解决学校的练习题。这是关于 Cassandra 中的可调一致性。
给定一个包含 15 个节点的集群,完成以下 table。如果有多种可能性,请给出所有这些可能性。 CL 值为:ANY、ONE、QUORUM、ALL
非常感谢您的帮助!
p.s。我确信我们需要以下规则来解决这个问题:节点读取 + 节点写入 > 复制因子保持一致
此处的文档应概述一致性级别及其运作方式:
https://docs.datastax.com/en/cassandra/3.0/cassandra/dml/dmlConfigConsistency.html
如果 link 将来出现问题
,为了清楚起见,我已经在此处复制了一些内容
Write Consistency Levels
ALL
A write must be written to the commit log and memtable on all replica
nodes in the cluster for that partition.
EACH_QUORUM Strong consistency. A write must be written to the commit log and memtable on a quorum of replica nodes in each
datacenter.
QUORUM
A write must be written to the commit log and memtable on a quorum of
replica nodes across all datacenters.
LOCAL_QUORUM
Strong consistency. A write must be written to the commit log and
memtable on a quorum of replica nodes in the same datacenter as the
coordinator. Avoids latency of inter-datacenter communication.
ONE
A write must be written to the commit log and memtable of at least one
replica node.
TWO A write must be written to the commit log and memtable of at least two replica nodes.
THREE A write must be written to the commit log and memtable
of at least three replica nodes.
LOCAL_ONE
A write must be sent to, and successfully acknowledged by, at least
one replica node in the local datacenter.
ANY
A write must be written to at least one node. If all replica nodes for
the given partition key are down, the write can still succeed after a
hinted handoff has been written. If all replica nodes are down at
write time, an ANY write is not readable until the replica nodes for
that partition have recovered.
Read consistency levels
ALL
Returns the record after all replicas have responded. The read
operation will fail if a replica does not respond. EACH_QUORUM
Not supported for reads.
QUORUM
Returns the record after a quorum of replicas from all datacenters has
responded.
LOCAL_QUORUM
Returns the record after a quorum of replicas in the current
datacenter as the coordinator has reported. Avoids latency of
inter-datacenter communication.
ONE
Returns a response from the closest replica, as determined by the
snitch. By default, a read repair runs in the background to make the
other replicas consistent.
TWO
Returns the most recent data from two of the closest replicas.
THREE
Returns the most recent data from three of the closest replicas.
LOCAL_ONE
Returns a response from the closest replica in the local datacenter.
SERIAL
Allows reading the current (and possibly uncommitted) state of data
without proposing a new addition or update. If a SERIAL read finds an
uncommitted transaction in progress, it will commit the transaction as
part of the read. Similar to QUORUM.
LOCAL_SERIAL
Same as SERIAL, but confined to the datacenter.
我认为这应该是正确答案。如果我错了,请纠正我。忽略table中的荷兰语句子,我认为它不会对英语读者造成任何问题。
我需要一些帮助来解决学校的练习题。这是关于 Cassandra 中的可调一致性。
给定一个包含 15 个节点的集群,完成以下 table。如果有多种可能性,请给出所有这些可能性。 CL 值为:ANY、ONE、QUORUM、ALL
非常感谢您的帮助!
p.s。我确信我们需要以下规则来解决这个问题:节点读取 + 节点写入 > 复制因子保持一致
此处的文档应概述一致性级别及其运作方式:
https://docs.datastax.com/en/cassandra/3.0/cassandra/dml/dmlConfigConsistency.html
如果 link 将来出现问题
,为了清楚起见,我已经在此处复制了一些内容Write Consistency Levels
ALL
A write must be written to the commit log and memtable on all replica nodes in the cluster for that partition.
EACH_QUORUM Strong consistency. A write must be written to the commit log and memtable on a quorum of replica nodes in each datacenter.
QUORUM
A write must be written to the commit log and memtable on a quorum of replica nodes across all datacenters.
LOCAL_QUORUM
Strong consistency. A write must be written to the commit log and memtable on a quorum of replica nodes in the same datacenter as the coordinator. Avoids latency of inter-datacenter communication.
ONE
A write must be written to the commit log and memtable of at least one replica node.
TWO A write must be written to the commit log and memtable of at least two replica nodes.
THREE A write must be written to the commit log and memtable of at least three replica nodes.
LOCAL_ONE
A write must be sent to, and successfully acknowledged by, at least one replica node in the local datacenter.
ANY
A write must be written to at least one node. If all replica nodes for the given partition key are down, the write can still succeed after a hinted handoff has been written. If all replica nodes are down at write time, an ANY write is not readable until the replica nodes for that partition have recovered.
Read consistency levels
ALL
Returns the record after all replicas have responded. The read operation will fail if a replica does not respond. EACH_QUORUM
Not supported for reads.
QUORUM
Returns the record after a quorum of replicas from all datacenters has responded.
LOCAL_QUORUM
Returns the record after a quorum of replicas in the current datacenter as the coordinator has reported. Avoids latency of inter-datacenter communication.
ONE
Returns a response from the closest replica, as determined by the snitch. By default, a read repair runs in the background to make the other replicas consistent.
TWO
Returns the most recent data from two of the closest replicas.
THREE
Returns the most recent data from three of the closest replicas.
LOCAL_ONE
Returns a response from the closest replica in the local datacenter.
SERIAL
Allows reading the current (and possibly uncommitted) state of data without proposing a new addition or update. If a SERIAL read finds an uncommitted transaction in progress, it will commit the transaction as part of the read. Similar to QUORUM.
LOCAL_SERIAL
Same as SERIAL, but confined to the datacenter.
我认为这应该是正确答案。如果我错了,请纠正我。忽略table中的荷兰语句子,我认为它不会对英语读者造成任何问题。