首先需要明白一点,现在linux系统好像没有回收站的说法了,所以在删除别人的文件或文件夹之前一定要慎重,毕竟rm命令是高危命令,删除了就没有了,所以对于高危命令,我们要保持敬畏之心.
hdfs在部署的时候默认垃圾回收站是禁用的,因此hdfs是可以开启垃圾回收站的。
先看看官网对回收站的解释:
第一个参数:fs.trash.interval=0 表示禁用
Number of minutes after which the checkpoint gets deleted. If zero,the trash feature is disabled. This option may be configured both on the server and the client. If trash is disabled server side then the client side configuration is checked. If trash is enabled on the server side then the value configured on the server is used and the client configuration value is ignored.
也就是说将fs.trash.interval的值表示检查点被删除之前的分钟数。 如果为零,则禁用垃圾箱功能。 可以在服务器和客户端上配置此选项。 如果在服务器端禁用垃圾,则检查客户端配置。 如果在服务器端启用了垃圾箱,则使用服务器上配置的值,并忽略客户端配置值。
那么可以按照生产上的需求设置回收站的保存时间,这个时间以分钟为单位,例如1440=24h=1天。
第二个参数:fs.trash.checkpoint.interval:0