By default, HDFS trash is disabled

Hadoop is a hierarchical file system, so the old fashioned ' rm deathstar'  (DONT RUN THIS! 'rm -rf /') is the greatest fear of people who worry about stuff for a living (system admins). Hadoop has this really awesome feature called the trash can, so if you accidentally delete your entire filesystem it just gets moved into your hdfs home folder. This feature is really awesome. This feature is incredible. Also this feature is OFF by default. Check the configuration in core-default.xml: fs.trash.interval = 0 . The value of fs.trash.interval represents minutes between checkpoints. If 0, the trash feature is disabled.

 

To enable this feature, check your core-site.xml and make sure the trash is larger than 0 so you have time to realize and recover your data! Also you will need to restart your NameNode for this change to take effect.

 

In my case I set it as:

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

 This configuration will do you BIG favor if you accidentally run 'hadoop fs -rmr /' on HDFS, it leave you two days to recovery the deleted contents.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值