【发布时间】:2015-11-26 10:55:16
【问题描述】:
我正在对具有 500000 行的表进行读取和更新查询,并且在处理大约 300000 行后有时会低于错误,即使没有节点关闭。
一致性 ONE 读取查询期间 Cassandra 超时(需要 1 个响应,但只有 0 个副本响应)
基础设施详情:
有 5 个 Cassandra 节点、5 个 spark 和 3 个 Hadoop 节点,每个节点有 8 个内核和 28 GB 内存,Cassandra 复制因子为 3。
卡桑德拉 2.1.8.621 | DSE 4.7.1 |火花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.
我也尝试过同样的工作,将 read_request_timeout_in_ms (ms) 增加到 20,000,但没有帮助。
我正在对两个表进行查询。以下是其中一张表的创建语句:
创建表:
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';
查询:
1) SELECT encounter_uuid, encounter_start_date FROM section_ks.encounters WHERE patient_id = '1234' AND encounter_start_date >= '" + formatted_documentation_date + "' ALLOW FILTERING;
2) UPDATE section_ks.encounters SET testproblem_uuid_set = testproblem_uuid_set + {'1256'} WHERE encounter_uuid = 'abcd345';
【问题讨论】:
-
你可以发布你的创建表
-
...和您的查询,我也会尝试
TRACING ON来分析问题。 -
@phact 我已经添加了创建表。感谢您的回复。
-
@uri2x 也添加了查询。
-
不要在生产 oltp 查询中使用允许过滤。它会很慢。相反,您应该设计表的主键(分区和集群),以便可以使用常规 CQL 查询。
标签: hadoop cassandra apache-spark datastax datastax-java-driver