Wednesday, October 14, 2015

Recovering Deleted files/dir from Hadoop Trash

Command
hadoop fs -ls hdfs://ABCDE/user/test/.Trash/Current

where
ABCDE - is the hdfs name or url (<ABCDE> or <127.0.0.1:9000>)
test - is the username


This is possible if the TRASH feature is enabled in hadoop in core-site.xml
<property>
<name>fs.trash.interval</name>
<value>120</value> 
</property>

<property>
<name>fs.trash.checkpoint.interval</name>
<value>45</value> 
</property>