Created
February 24, 2017 06:36
-
-
Save grom358/c5ad8e43021eb9252fa0af05407a62f9 to your computer and use it in GitHub Desktop.
User Defined Compactions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
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
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