一致性为LOCAL_ONE的读取查询期间,Cassandra失败(需要1个响应,但仅响应0个副本,其中1个失败) [英] Cassandra failure during read query at consistency LOCAL_ONE (1 responses were required but only 0 replica responded, 1 failed)
问题描述
下面是我的脚本
CREATE TABLE alrashed.tbl_alerts_details (
alert_id int,
action_required int,
alert_agent_id int,
alert_agent_type_id int,
alert_agent_type_name text,
alert_definer_desc text,
alert_definer_name text,
alert_source text,
alert_state text,
col_1 text,
col_2 text,
col_3 text,
col_4 text,
col_5 text,
current_escalation_level text,
date_part date,
device_id text,
driver map<text, text>,
is_processed int,
is_real_time int,
location map<text, text>,
seq_no int,
severity text,
time_stamp timestamp,
transporter map<text, text>,
transporter_name text,
trip_id int,
updated_on timestamp,
vehicle map<text, text>,
vehicle_type_name text,
PRIMARY KEY (alert_id)
) WITH read_repair_chance = 0.0
AND dclocal_read_repair_chance = 0.1
AND gc_grace_seconds = 864000
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 default_time_to_live = 0
AND speculative_retry = '99PERCENTILE'
AND min_index_interval = 128
AND max_index_interval = 2048
AND crc_check_chance = 1.0;
在运行此查询时,我会得到
when I'm running this query I'm getting
在读查询期间,Cassandra失败,一致性为LOCAL_ONE(需要1个响应,但仅响应0个副本,失败1个)错误
Cassandra failure during read query at consistency LOCAL_ONE (1 responses were required but only 0 replica responded, 1 failed) error
这是我在Java中的Cassandra查询:
Here is my cassandra query in Java:
select
count( * )
from
tbl_alerts_details
where
alert_state = 'ACKNOWLEDGE'
and date_part >= '2017-10-01'
and date_part <= '2017-10-31'
and is_real_time = 1
and alert_agent_type_name = 'VEHICLE' ALLOW FILTERING
推荐答案
此错误使我们意识到了空间问题,将图像存储在Base64的每一行中很快使墓碑
问题出现。
This error had made us realise a space issue for us, storing images in Base64 in every row had quickly made the Tombstone
problem arise.
根据此帖子,
Cassandra不只是扫描h这些行,但在准备响应时,也必须
将它们存储在内存中。如果事情太远,这可能会导致
在节点上发生内存不足错误,如果多个节点正在处理请求,这可能会导致
甚至会导致
多个故障导致停机整个集群。为了防止
发生这种情况,如果服务检测到危险的
墓碑,该服务将中止查询。
Cassandra doesn't just scan through the rows, but also has to accumulate them in memory while it prepares the response. This can cause an out-of-memory error on the node if things go too far out, and if multiple nodes are servicing the request, it may even cause a multiple failure bringing down the whole cluster. To prevent this from happening, the service aborts the query if it detects a dangerous number of tombstones.
这篇关于一致性为LOCAL_ONE的读取查询期间,Cassandra失败(需要1个响应,但仅响应0个副本,其中1个失败)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!