Mathijs Homminga wrote:
You saved the day again.
The FSEditLogTool worked like a charm, without modifications
(https://issues.apache.org/jira/browse/HADOOP-915).
That's great, I was afraid it was out of sync with your version of Hadoop.
Here is what I did to perform an undelete of the root directory on my
HDFS (hadoop 0.12.2.)
- first, I ran a few tests on another dfs to make sure the FSEditLogTool
worked (and I understood what is was doing). Then on the affected dfs:
- kill the namenode (already did that asap, and to be sure, I stopped
all other hadoop daemons)
- run FSEditLogTool -dump ${dfs.name.dir}/edits edits.txt
- remove the last line from edits.txt which contains the DELETE entry.
- run FSEditLogTool -restore edits.txt ${dfs.name.dir}/edits
- start the namenode and datanodes again
- I had to turn off save-mode manually:
$ bin/hadoop dfsadmin -safemode leave
Just for the record - this procedure should be your absolutely last
resort, because it's tricky and error prone. You can easily corrupt your
filesystem beyond any hope.
--
Best regards,
Andrzej Bialecki <><
___. ___ ___ ___ _ _ __________________________________
[__ || __|__/|__||\/| Information Retrieval, Semantic Web
___|||__|| \| || | Embedded Unix, System Integration
http://www.sigram.com Contact: info at sigram dot com