Created
February 22, 2012 17:28
-
-
Save hcoyote/1886191 to your computer and use it in GitHub Desktop.
Run hadoop fsck and determine if our HDFS is corrupt in some way. This is very basic and could be extended further to tell you what the corruption really is.
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/sh | |
if [ -x /usr/bin/hadoop ] ; then | |
chk_hdfs=`/usr/bin/hadoop fsck / | grep 'filesystem under path'` | |
case $chk_hdfs in | |
*HEALTHY*) | |
echo "OK - HDFS is healthy" | |
exit 0 | |
;; | |
*) | |
echo "CRITICAL - HDFS is corrupt!" | |
exit 2 | |
;; | |
esac | |
else | |
echo "UNKNOWN - can't execute /usr/bin/hadoop" | |
exit 3 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment