内容简介:Cassandra Driver 抛异常查看 Cassandra 日志,看到 WARN 日志如下:文档:
异常
问题一
Cassandra Driver 抛异常 Cassandra timeout during read query at consistency ONE (1 responses were required but only 0 replica responded)
查看 Cassandra 日志,看到 WARN 日志如下:
WARN [ReadStage-1] 2018-02-27 09:07:57,545 ReadCommand.java:522 - Read 3925 live rows and 29353 tombstone cells for 此处省略 CQL 语句 (see tombstone_warn_threshold)
tombstone_warn_threshold
是 Cassandra 配置文件 cassandra.yml
的配置项,当查询扫描超过了这个数量的 tombstone,数据库就会发出警告
tombstone_warn_threshold
默认值为 1000
Cassandra 执行删除操作,并不真正删除数据,而是使用 tombstone 标识删除 cell,待 gc_grace_seconds
秒之后,才真正将数据删除
大量的 tombstone 将会降低查询性能
解决该问题的方法,就是修改 Cassandra 表属性 gc_grace_seconds
,将 gc_grace_seconds
默认值 864000(10天)修改为 86400(1天):
alter table <table_name> with gc_grace_seconds = 86400
以上所述就是小编给大家介绍的《学习 Cassandra(五):踩坑》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Algorithm Design
Jon Kleinberg、Éva Tardos / Addison-Wesley / 2005-3-26 / USD 144.20
Algorithm Design introduces algorithms by looking at the real-world problems that motivate them. The book teaches students a range of design and analysis techniques for problems that arise in compu......一起来看看 《Algorithm Design》 这本书的介绍吧!