HDFS supports the fsck command to check for various inconsistencies. It is designed for reporting problems with various files,
As per the below screenshot of fsck output, there is 1 corrupt block, 1 missing block and 4 under-replicated blocks and status of HDFS is “CORRUPT”. These indicates HDFS health is bad and these should be addressed ASAP to recover our HDFS into HEALTHY.
Corrupt block: block is called corrupt by HDFS if it has at least one corrupt replica along with at least one live replica. As such, a corrupt block does not indicate unavailable data, but they do indicate an increased chance that data may become unavailable.
- Corrupt blocks
- Missing blocks
- Under-replicated blocks
Command: sudo hdfs hdfs fsck / --files --blocks --locations
HDFS: Corrupted/Missing/Under Replicated BlocksAs per the below screenshot of fsck output, there is 1 corrupt block, 1 missing block and 4 under-replicated blocks and status of HDFS is “CORRUPT”. These indicates HDFS health is bad and these should be addressed ASAP to recover our HDFS into HEALTHY.
Corrupt block: block is called corrupt by HDFS if it has at least one corrupt replica along with at least one live replica. As such, a corrupt block does not indicate unavailable data, but they do indicate an increased chance that data may become unavailable.
Missing block: A missing block is a block with no live replicas. All replicas are either missing or corrupt. This may happen because of corruption or because data nodes are offline or being decommissioned.
Under-replicated block: A failure of this health check may indicate a loss of DataNodes (or) wrong replication factor applied to the job from client side. Use the HDFS fsck command to identify which files contain under-replicated blocks.
If the target replica set more than block replication in hdfs-site.xml then reset the replica of the file by using below command,
If the target replica set more than block replication in hdfs-site.xml then reset the replica of the file by using below command,
hdfs dfs -setrep -w 3 HDFS/FILE/LOCATION
Refer the Fix: Under Replicated blocks in HDFS manually to fix the under replicated blocks manually.

Comments
Post a Comment