Support Questions
Find answers, ask questions, and share your expertise

How to fix corrupt blocks

Explorer

I make a cluster used ambari included 1 namenode and 4 datanode on vmware. A datanode was broken ,so I deleted this one and created a new datanode .But cluster created CORRUPT blocks .I try to "hdfs fsck -delete / " to fix it, but lost lots of data. how to fix corrupt blocks ?


捕获.jpg
1 ACCEPTED SOLUTION

@Mon key

Please refer to below link that explains how to find corrupted blocks and fix them.

http://stackoverflow.com/questions/19205057/how-to-fix-corrupt-hadoop-hdfs

Hope this helps.

Thanks and Regards,

Sindhu

View solution in original post

3 REPLIES 3

@Mon key

Please refer to below link that explains how to find corrupted blocks and fix them.

http://stackoverflow.com/questions/19205057/how-to-fix-corrupt-hadoop-hdfs

Hope this helps.

Thanks and Regards,

Sindhu

Rising Star

What is the replication factor defined, as 1 datanode down should not cause the corruption. Were other datanodes also down at the same time?

@Mon key

The best way is to find which are corrupted blocks using below command -

 hdfs fsck /path/to/corrupt/file -locations -blocks -files

And then try to manually remove this using "hadoop rm -r </path>" to avoid dataloss.

But still fsck does not remove good copied of data blocks.

; ;