hdfs回收站机制

1.在 core-site.xml 中添加:

  <property>
     <name>fs.trash.interval</name>
     <value>4320</value>
  </property>

fs.trash.interval参数的含义:

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.

不需要重启hdfs进行,直接生效

  1. 建立目录
    需要首先建立 /user/YOUER_USER 目录

3.测试
[hadoop@hadoop01 hadoop]$ hdfs dfs -rm hdfs-site.xml
18/10/18 15:21:53 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform… using builtin-java classes where applicable
18/10/18 15:21:54 INFO fs.TrashPolicyDefault: Moved: 'hdfs://hadoop01:9000/user/hadoop/hdfs-site.xml' to trash at: hdfs://hadoop01:9000/user/hadoop/.Trash/Current/user/hadoop/hdfs-site.xml

可以看见文件进入了回收站

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值