Support Questions

Find answers, ask questions, and share your expertise

How to fix corrupt blocks

avatar
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

avatar

@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

avatar

@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

avatar
Expert Contributor

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

avatar
Super Guru

@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.