当前位置: 首页 > 知识库问答 >
问题:

在一致性为1的读取查询期间Cassandra超时(需要1个响应,但只有0个副本响应)

沈永贞
2023-03-14

基础结构详细信息:
拥有5个Cassandra节点、5个spark和3个Hadoop节点,每个节点有8个内核和28 GB内存,Cassandra复制因子为3。

Cassandra 2.1.8.621 DSE 4.7.1 Spark 1.2.1 Hadoop 2.7.1。

Cassandra配置:

read_request_timeout_in_ms (ms): 10000
range_request_timeout_in_ms (ms): 10000
write_request_timeout_in_ms (ms): 5000
cas_contention_timeout_in_ms (ms): 1000 
truncate_request_timeout_in_ms (ms): 60000
request_timeout_in_ms (ms): 10000.
CREATE TABLE section_ks.testproblem_section (
    problem_uuid text PRIMARY KEY,
    documentation_date timestamp,
    mapped_code_system text,
    mapped_problem_code text,
    mapped_problem_text text,
    mapped_problem_type_code text,
    mapped_problem_type_text text,
    negation_ind text,
    patient_id text,
    practice_uid text,
    problem_category text,
    problem_code text,
    problem_comment text,
    problem_health_status_code text,
    problem_health_status_text text,
    problem_onset_date timestamp,
    problem_resolution_date timestamp,
    problem_status_code text,
    problem_status_text text,
    problem_text text,
    problem_type_code text,
    problem_type_text text,
    target_site_code text,
    target_site_text text
    ) WITH 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'}
    AND compression = {'sstable_compression': 
    'org.apache.cassandra.io.compress.LZ4Compressor'}
    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 = '99.0PERCENTILE';

2)更新section_ks.encounters SET testproblem_uuid_set=testproblem_uuid_set+{'1256'}WHERE encounter_uuid='abcd345';

共有1个答案

强阳曜
2023-03-14

通常,当您出现超时错误时,这意味着您正在尝试做一些在Cassandra中伸缩性不佳的事情。修复通常是修改您的架构。

我建议您在运行查询时监视节点,看看是否能发现问题区域。例如,您可以运行“watch-n1 nodetool tpstats”来查看是否有队列正在备份或删除项。请参见此处的其他监控建议。

在您的配置中,有一件事可能是错误的,您说您有五个Cassandra节点,但只有3个spark worker(或者您是说每个Cassandra节点上有三个spark worker?)您需要在每个Cassandra节点上至少有一个spark worker,以便将数据加载到spark中是在每个节点上本地完成的,而不是通过网络。

 类似资料:
  • 有人知道我做错了什么吗?

  • 我们使用普罗米修斯和eclipse显微轮廓。在我的endpoint上有一个计时器度量,所以我可以在Prometheus中看到以下度量:count、meanRate、oneMinRate、fiveMinRate、fifteenMinRate、min、max、mean、stddev、p50、P**等。 所以我想要得到我的endpoint的平均响应时间,但仅限于最后一分钟。根据我的经验,平均度量是从应用

  • 它在给定时间仅显示一个命令 如果我写或它不会工作,但如果我写它会输出 如果我切换前面的字符,它将变为或不起作用,但是工作和说再见

  • 我需要在JavaFX中执行如下操作: 你能告诉我如何在GridPane布局中只改变一列(中间的一列)的大小吗?这些黑色边框的矩形是VBoxs。基本上,VBoxs的宽度必须保持不变,这个红色标记区域的宽度应该调整。有什么想法或建议吗?

  • 我尝试了上述命令的各种组合,但结果总是上面给出的错误消息。为什么会发生这样的事情--因为我是按照文档所说的去做的?

  • 我试图从特定的Dockerfile构建镜像,并同时标记它;我遵循的在线说明,但我得到以下错误: “docker build”只需要1个参数 这是我运行的命令: 我尝试了上述命令的各种组合,但结果总是上面给出的错误消息。为什么会发生这种情况——因为我在遵循留档所说的?