Search code examples
cassandradatastax-enterprisenodetool

Cassandra Commitlog taking more space on disk


The commitlog in Cassandra is taking more space.

Can we clear it using nodetool flush?


Solution

  • You can certainly attempt to force memtables to be flushed to disk but I doubt it will work.

    When certain thresholds are reached, Cassandra does the flushing automatically but I suspect there's something wrong on the node so the commitlog just keeps getting bigger.

    One common cause for flushes to not work is when the file permissions are wrong. For example, if you accidentally start Cassandra as the root user, new files are owned by root so the default Cassandra user no longer has the ability to do operations as memtable flushes and compaction.

    Check the permissions and ownership on both (a) the files in the commitlog/ directory, AND (b) the parent directories to make sure that the Cassandra user has access. Cheers!