Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
User Defined Compactions
Restart cassandra: sudo service cassandra restart
In another terminal spam: nodetool disableautocompaction storage channel_messages
Keep spamming until node is up. Checked it worked that there is no compactions for channel_messages with nodetool compactionstats
cd /mnt/md0/cassandra/data/storage/channel_messages
Get list of files < 10Mb and 2 days old with: find -type f -iname '*-Data.db' -size -10M -mtime -2 | grep -v 'tmp' | cut -c3- | sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/,/g'
Copy the list into clipboard
java -jar /tmp/jmxterm-1.0-alpha-4-uber.jar
open localhost:7199
bean org.apache.cassandra.db:type=CompactionManager
run forceUserDefinedCompaction <paste list>
In other terminal can track compaction with: nodetool compactionstats
@grom358

This comment has been minimized.

Copy link
Owner Author

commented Feb 24, 2017

Also can reduce log spam with:
nodetool setlogginglevel org.apache.cassandra.db.filter ERROR
nodetool setlogginglevel org.apache.cassandra.thrift ERROR
nodetool setlogginglevel org.apache.cassandra.net ERROR
nodetool setlogginglevel org.apache.cassandra.utils ERROR

@grom358

This comment has been minimized.

Copy link
Owner Author

commented Feb 24, 2017

When finished compacting run:
nodetool enableautocompaction storage channel_messages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.