How to reclaim storage from a column family in Cassandra

空扰寡人 提交于 2020-01-06 18:02:32

问题


I am using Datastax 2.1 community version in EC2. I dropped a big table (column family) in a keyspace and ran "nodetool compact " but from OpsCenter UI, I don't see any increase in storage capacity.

I ran "nodetool compactionstats " to see whether compaction is on-going but there is nothing: $ nodetool compactionstats pending tasks: 0 Active compaction remaining time : n/a

Is there some other process I need to follow?


回答1:


Cassandra, in its default configuration, keeps a snapshot of every column family that is dropped. This is by design so you don't lose the data of a cf if you accidentally delete a cf.

You can disable the snapshot creation in cassandra.yaml. From the docs (see: http://www.datastax.com/documentation/cassandra/2.1/cassandra/configuration/configCassandra_yaml_r.html ):

auto_snapshot (Default: true) Enable or disable whether a snapshot is taken of the data before keyspace truncation or dropping of tables. To prevent data loss, using the default setting is strongly advised. If you set to false, you will lose data on truncation or drop.

If you don't disable auto snapshots you can remove the generated snapshot via nodetool clearsnapshot. See: http://www.datastax.com/documentation/cassandra/2.0/cassandra/tools/toolsClearSnapShot.html



来源:https://stackoverflow.com/questions/26200440/how-to-reclaim-storage-from-a-column-family-in-cassandra

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!