Last active
December 9, 2016 13:32
-
-
Save carlessanagustin/c041ee71d8457425a58e738863b97c46 to your computer and use it in GitHub Desktop.
HADOOP: Fix HDFS under replicated blocks
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
#!/usr/bin/bash | |
HDFSUSER=hdfs | |
URFILES=/tmp/under_replicated_files | |
sudo -u $HDFSUSER hdfs fsck / | grep 'Under replicated' | awk -F':' '{print $1}' >> $URFILES | |
sudo -u $HDFSUSER for hdfsfile in `cat $URFILES`; do echo "Fixing $hdfsfile :" ; hdfs dfs -setrep 3 $hdfsfile; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment