为了防止误删除,造成数据无法恢复,建议开启hadoop垃圾箱
修改conf/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>
默认是0.单位分钟。这里我设置的是1天(60*24)
删除数据rm后,会将数据move到当前文件夹下的.Trash目录