cassandra gc宽限期无法配置

时间:2018-05-09 12:03:33

标签: cassandra datastax

引用“https://docs.datastax.com/en/cql/3.1/cql/cql_reference/tabProp.html” 我需要配置gc宽限期作为删除时墓碑的解决方案。

但是我在重新启动时遇到错误。

"com.google.inject.CreationException: Unable to create injector, see the following errors: 1) An exception was caught and reported. Message: Invalid yaml. Please remove properties [gc_grace_seconds] from your cassandra.yaml
  at com.datastax.bdp.DseModule.configure(Unknown Source)
"

cqlsh> show VERSION
[cqlsh 5.0.1 | Cassandra 3.11.0.1855 | DSE 5.1.3 | CQL spec 3.4.4 | Native protocol v4]

2 个答案:

答案 0 :(得分:2)

Anushke,这是在架构级别设置的,而不是在cassandra.yaml中。

答案 1 :(得分:1)

gc_grace_seconds被定义为每个表定义的一部分:

CREATE TABLE testTable (
    testid bigint,
    vendid bigint,
    updatets timestamp,
    PRIMARY KEY (testid, vendid)
) WITH CLUSTERING ORDER BY (vendid ASC)
AND gc_grace_seconds = 864000;

默认设置为864000(十天)。

我必须提醒您调整该设置。请记住,墓碑是卡桑德拉复制“没有”的方式。这在分布式数据库中真的很难,因此是墓碑结构的原因。只要确保你在新值的范围内运行修复,否则你的墓碑可能无法完成任务(不会复制到你的所有节点),你可能会让数据“重影”。