【发布时间】:2020-02-04 19:16:50
【问题描述】:
我们创建了具有以下架构的表:
创建表 test_table(col_1 text, col_2 text, col_3 text, col_4 text, col_5 text, col_6 text, col_7 text, PRIMARY KEY (col_1, col_2, col_3, col_4, col_5));
此表包含近十亿条记录。(大量记录)
并尝试如下查询,
select * from test_table where col_1='value' and col_2='value'; --> 得到结果
但是当我们像下面这样尝试时,
select * from test_table where col_1='value' and col_3='value' 允许过滤; --> 没有得到结果
select * from test_table where col_1='value' and col_4='value' 允许过滤; --> 没有得到结果
我们遇到以下错误:
"ReadTimeout: 来自服务器的错误:code=1200 [协调节点超时等待副本节点的响应] message="操作超时 - 仅收到 0 个响应。" info={'received_responses': 0, 'required_responses': 1, '一致性': 'ONE'}"
出现上述错误后,我在 cassandra.yaml 配置文件中将超时参数从 5 秒延长到 60 分钟。
然后结果来了,但是执行时间很长,需要 50 分钟。
谁能建议我在不扩展配置的情况下解决“ReadTimeout:”问题?
【问题讨论】:
-
当您简单地选择 where col1 = 'XXXXX' 时会发生什么?是超时还是结束?我的想法是,您正在做的事情与我刚刚要求您运行的事情相似,并且预计它会超时。我最初的预感是你可能有一个非常大的分区?如果您对该表执行“nodetool tablehistograms”或对该表执行“nodetool tablestats”会发生什么?
-
当我在 col1 上运行查询时,我会在几秒钟内获得数据。没有超时。