简体   繁体   English

Cassandra - 无法达到一致性级别 QUORUM ISSUE

[英]Cassandra - Cannot achieve consistency level QUORUM ISSUE

I am using Cassandra DB for a few purposes in the project.我在项目中出于几个目的使用 Cassandra DB。 I am trying to update the count of votes_up column in the comments table.我正在尝试更新评论表中的 votes_up 列的计数。 But I am getting this error.但我收到此错误。

enter image description here在此处输入图片说明

My comments table structure is.我的评论表结构是。

CREATE TABLE opspot.comments (
    entity_guid varint,
    parent_guid_l1 varint,
    parent_guid_l2 varint,
    parent_guid_l3 varint,
    guid varint,
    access_id varint,
    attachments map<text, text>,
    body text,
    container_guid varint,
    flags map<text, boolean>,
    has_children boolean,
    owner_guid varint,
    owner_obj text,
    replies_count varint,
    score varint,
    time_created timestamp,
    time_updated timestamp,
    votes_down set<varint>,
    votes_up set<varint>,
    PRIMARY KEY (entity_guid, parent_guid_l1, parent_guid_l2, parent_guid_l3, guid)
) WITH CLUSTERING ORDER BY (parent_guid_l1 ASC, parent_guid_l2 ASC, parent_guid_l3 ASC, guid DESC)
    AND bloom_filter_fp_chance = 0.01
    AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
    AND comment = ''
    AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
    AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
    AND crc_check_chance = 1.0
    AND dclocal_read_repair_chance = 0.1
    AND default_time_to_live = 0
    AND gc_grace_seconds = 864000
    AND max_index_interval = 2048
    AND memtable_flush_period_in_ms = 0
    AND min_index_interval = 128
    AND read_repair_chance = 0.0
    AND speculative_retry = '99PERCENTILE';

Cassandra is using one data center that is datacenter1. Cassandra 正在使用一个数据中心,即 datacenter1。 The image is given below.图像如下。

enter image description here在此处输入图片说明

The current consistency level is one.当前的一致性级别为 1。 with 1 node.有 1 个节点。

Can anyone tell me why I am getting this quorum error?谁能告诉我为什么会出现此仲裁错误? As per my research, to achieve a stable quorum state more than one node is required.根据我的研究,要实现稳定的仲裁状态需要多个节点。 I am getting this error while updating a record.更新记录时出现此错误。 How could I handle this situation for one node as no copies are getting created?由于没有创建副本,我该如何处理一个节点的这种情况?

QUORUM & LOCAL_QUORUM are calculated from the replication factor, not from the number of nodes in the cluster, so the QUORUM on the one node cluster is perfectly fine. QUORUM & LOCAL_QUORUM是根据复制因子计算的,而不是根据集群中的节点数计算的,因此单节点集群上的 QUORUM 完全没问题。

Most probably in your case is that your node is not answering on time, for example, because of garbage collection, or something else, and in this case, it doesn't achieve necessary consistency level.在您的情况下,最有可能的是您的节点没有按时响应,例如,由于垃圾收集或其他原因,在这种情况下,它没有达到必要的一致性级别。 The same problem could exist even with ONE .即使使用ONE也可能存在同样的问题。

I'm not expert in use of PHP driver, but in other driver you can usually force retries, usually should work with default retry policy - you just need to mark statement as idempotent (see documentation on retry policy in Java driver ).我不是使用 PHP 驱动程序的专家,但在其他驱动程序中,您通常可以强制重试,通常应该使用默认的重试策略 - 您只需要将语句标记为幂等(请参阅有关Java 驱动程序中重试策略的文档)。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM