Last active
November 10, 2015 11:20
-
-
Save itayadler/8cb766c419dabac44982 to your computer and use it in GitHub Desktop.
Prints out big partitions found during cassandra's compaction procedure
This file contains 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
#!/bin/bash | |
set -e | |
#NOTE: Tested on cassandra 2.1 only, please leave a comment if this breaks on other versions. | |
#This script prints to stdout the big partitions cassandra is warning about during compaction. | |
#It goes over all the cassandra logs (all of the ones found on the server), and prints in ascending | |
#order the big partitions that were found during compaction. | |
#Usage example: | |
#ssh user@server.hostname 'bash -s' < big-partitions.sh | |
zgrep -e 'Compacting large partition' /var/log/cassandra/system* | awk '{print $10 $11}' | awk -F ":" '{print $1,$2}' | awk -F "(" '{print $1,$2}' | awk -F " " '{print $1,$2,$3/1048576 "MB"}' | sort -k 3 -n -r | awk -F " " '!seen[$2]++' | sort -k 3 -n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment