Fix Under-replicated blocks in HDFS manually

Short Description:

Quick instruction to fix under-replicated Blocks in HDFS manually


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

####Fix under-replicated blocks###

  1. su <$hdfs_user>
  2. bash4.1$ hdfs fsck / | grep ‘Under replicated’ | awk F‘:’ ‘{print $1}’ >> /tmp/under_replicated_files
  3. bash4.1$ for hdfsfile in `cat /tmp/under_replicated_files`; do echo “Fixing $hdfsfile :” ; hadoop fs setrep 3 $hdfsfile; done

Hadoop Recovery

Hadoop Recovery

Following Hadoop Recovery topics are covered in this blog. These steps are useful for hadoop admins.