Created
July 1, 2015 01:36
-
-
Save xman1980/cf8f2d88d2185176d81d to your computer and use it in GitHub Desktop.
Fix the under replicated blocks
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
#!/bin/bash | |
# | |
# $Author:$ | |
# $Id:$ | |
# | |
# Fix the under replicated blocks by setting the replication factor for all of the | |
# under replicated blocks | |
# | |
# Nikhil Mulley | |
# | |
HADOOP_CMD="/usr/bin/hadoop" | |
HADOOP_REP_FACTOR=3 | |
for hdfsfile in $($HADOOP_CMD fsck / | grep 'Under replicated' | awk -F':' '{print $1}') | |
do | |
echo "Fixing $hdfsfile :" ; | |
${HADOOP_CMD} fs -setrep ${HADOOP_REP_FACTOR} $hdfsfile; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment