【问题标题】:How to delete tombstones of cassandra table?如何删除卡桑德拉表的墓碑?
【发布时间】:2017-04-09 08:47:29
【问题描述】:

我的 OpsCenter 在 Tombstone 计数性能服务上给了我“失败”的结果。我看了this paper,发现可能是NULL的插入值是随便的。

所以我尝试使用以下程序解决此问题:

  1. 将表channelsarticlesNULL 列设置为''。并且出于检查原因,这两个表中没有任何插入。

  2. 使用以下命令将gc_grace_seconds 设置为0 alter table channels with gc_grace_seconds = 0 alter table articles with gc_grace_seconds = 0

  3. OpsCenter 键空间中截断bestpractice_results 表。

  4. 使用以下命令重新启动代理和 OpsCenter: service datastax-agent restart service opscenterd restart

但是,当 OpsCenter 运行例行性能检查(每 1 分钟)时,再次出现以下“失败”信息。并且墓碑数量不变(即23552和1374)

我有一个问题:

  1. 在两个表上没有任何插入操作时如何删除这些墓碑? 我需要repair 集群吗?

OpsCenter 版本:6.0.3 Cassandra 版本:2.1.15.1423 DataStax Enterprise 版本:4.8.10

【问题讨论】:

  • 您还必须触发压缩,以便从数据文件中删除墓碑。
  • 谢谢。我已经使用命令nodetool -p portNumber compact keyspace channels 触发了压缩,但是墓碑的数量仍然没有改变。我应该rebootdatastax 吗?
  • 当然不需要重新启动。你在每个节点上运行压缩?
  • 我按照link 运行compact for table channels,我认为compact 是table 的概念。如何为每个节点运行 compact ?
  • 您需要对每个节点重复 nodetool 命令。使用-h 指定运行节点的主机。

标签: cassandra opscenter


【解决方案1】:

对于 Cassandra 3.10+,使用

nodetool garbagecollect keyspace_name table_name

查看https://docs.datastax.com/en/dse/5.1/dse-admin/datastax_enterprise/tools/nodetool/toolsGarbageCollect.html

【讨论】:

  • 非常感谢!它有助于回收磁盘空间。
【解决方案2】:

请通过以下链接获取有关删除和墓碑的完整信息。它可能对您有所帮助。 http://thelastpickle.com/blog/2016/07/27/about-deletes-and-tombstones.html

【讨论】:

  • 谢谢。我不确定这句话Remember that all the nodes are supposed to have been repaired within gc_grace_seconds to ensure a correct distribution of the tombstones and prevent deleted data from reappearing as mentioned above. repair 是什么意思?这意味着reboot集群?
  • 检查documentation进行维修:./nodetool help repair
猜你喜欢
  • 2018-09-06
  • 2019-06-24
  • 2019-06-18
  • 2013-01-14
  • 2021-10-27
  • 2019-07-10
  • 2018-04-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多