Skip to content

Instantly share code, notes, and snippets.

@ad1kus
ad1kus / gist:582e9746c71cb11c432a132881f1dd2e
Created February 15, 2018 10:56
Fix Under-replicated blocks in HDFS manually
su - <$hdfs_user>
bash-4.1$ hdfs fsck / | grep 'Under replicated' | awk -F':' '{print $1}' >> /tmp/under_replicated_files
-bash-4.1$ for hdfsfile in `cat /tmp/under_replicated_files`; do echo "Fixing $hdfsfile :" ; hadoop fs -setrep 3 $hdfsfile; done