Many commitlog files with Cassandra
Asked Answered
C

1

7

I've got a mostly idle (till now) 4 node cassandra cluster that's hooked up with opscenter. There's a table that's had very little writes in the last week or so (test cluster). It's running 2.1.0. Happened to ssh in, and out of curiosity, ran du -sh * on the data directory. Here's what I get:

4.2G    commitlog
851M    data
188K    saved_caches

There's 136 files in the commit log directory. I flushed, and then drained cassandra, stopped and started the service. Those files are still there. What's the best way to get rid of these? Most of the stuff is opscenter related, and I'm inclined to just blow them away as I don't need the test data. Wondering what to do in case this pops up again. Appreciate any tips.

Charr answered 31/10, 2014 at 18:42 Comment(1)
Closely related to, but not a duplicate of How to prevent Cassandra commit logs filling up disk space.Reform
V
2

The files in the commit log directory have a fixed size determined by your settings in the cassandra.yaml. All files have a pre-allocated size, so you cannot change it by making flush, drain or other operations on the cluster.

You have to change the configuration if you want to reduce their size.

Look at the configuration settings "commitlog_total_space_in_mb" and "commitlog_segment_size_in_mb" to configure the size of each file and the total space occupied by all of them.

Vivyan answered 10/12, 2014 at 19:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.