Hadoop 中找回误删的文件

hadoop是目前常用的分布式文件存储系统,如果说是不小心误删了文件如何恢复呢?

在删除的时候通常可以看到如下:

Moved: 'hdfs://xxxxx/stock_1023' to trash at: hdfs://xxxxx/.Trash/Current

然后你转到后面的那个目录中就可看到被删除的文件,然后只需要用hadoop mv命令恢复的指定文件目标位置就可以。

trash 文件夹是定期清理的,具体保存多久可以在core-site.xml文件中进行设置:

<property>  
  <name>fs.trash.interval</name>  
  <value>1440</value>  
  <description>Number of minutes between trash checkpoints.  
  If zero, the trash feature is disabled.  
  </description>  
</property>  

默认单位是分钟可以根据场景进行设置

猜你喜欢

转载自blog.csdn.net/u013928917/article/details/78637311