Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login
3 REPLIES 3

avatar
hide-solution

This problem has been solved!

Want to get a detailed solution you have to login/registered on the community

Register/Login

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.