Fix Under-replicated blocks in HDFS manually

Short Description:##

Quick instruction to fix under-replicated Blocks in HDFS manually

Article##

To Fix under-replicated blocks in HDFS, below is quick instruction to use:

Fix under-replicated blocks###

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

posted @ 2019-06-18 13:46  火火火火四火  阅读(196)  评论(0)    收藏  举报