开启HDFS的回收站功能:
首先:执行stop-dfs.sh命令脚本关闭HDFS
只需在namenode节点上的core-site.xml文件中,添加如下两个属性:
<property>
<name>fs.trash.interval</name>
<value>10080</value>
<description>Number of minutes after which the checkpoint gets deleted. If zero, the trash feature is disabled.</description>
</property>
<property>
<name>fs.trash.checkpoint.interval</name>
<value>0</value>
<description>Number of minutes between trash checkpoints. Should be smaller or equal to fs.trash.interval. If zero, the value is set to the value of fs.trash.interval.</description>
</property>