[问题记录]hdfs删除文件提示rmr: Failed to move to trash
来源:互联网 发布:linux时钟同步设置 编辑:程序博客网 时间:2024/05/28 23:12
问题/现象
使用hadoop fs -rmr xxx
删除hdfs上的文件失败
$ hadoop fs -rmr /app/lbs/nuomi-da-stat/stat_platform_auto/1004/dt=20161118/000000_0rmr: Failed to move to trash: /app/lbs/nuomi-da-stat/stat_platform_auto/1004/dt=20161118/000000_0
原因分析
原因一:集群回收站空间占满
原因二:当前ugi
没有权限删除对应的hdfs
文件,通过hadoop fs -ls
命令可以发现,用户权限是nuomi-abc
,用户组权限是nuomi-da-stat
,当前运行的ugi
是在hadoop-site.xml
文件中配置的,如果当前运行的ugi
与用户权限或用户组权限不符合,就会因为没有权限执行而报错
$ hadoop fs -ls /app/lbs/nuomi-da-stat/stat_platform_auto/1405/dt=20161111/000000_0Found 1 items-rw-r--r-- 3 nuomi-abc nuomi-da-stat 85 2016-11-18 05:09 /app/lbs/nuomi-da-stat/stat_platform_auto/1405/dt=20161111/000000_0
解决方案
原因一:集群回收站空间占满
方法:清空集群回收站
$ hadoop fs -rmr /user/nuomi-da-stat/.Trash/*
原因二:当前ugi
没有权限删除对应的hdfs
文件
方法一:更改
hdfs
文件权限
-chown [-R] [OWNER][:[GROUP]] PATH... Changes owner and group of a file. This is similar to shell's chown with a few exceptions. -R modifies the files recursively. This is the only option currently supported. If only owner or group is specified then only owner or group is modified. The owner and group names may only cosists of digits, alphabet, and any of '-_.@/' i.e. [-_.@/a-zA-Z0-9]. The names are case sensitive. WARNING: Avoid using '.' to separate user name and group though Linux allows it. If user names have dots in them and you are using local file system, you might see surprising results since shell command 'chown' is used for local files.
如下命令,作用是递归地将/app/lbs/nuomi-da-stat/stat_platform_auto/
下的所有文件,用户权限和组权限都改成nuomi-da-stat
,文件多的话执行会很慢
hadoop fs -chown -R nuomi-da-stat:nuomi-da-stat /app/lbs/nuomi-da-stat/stat_platform_auto/
方法二:使用有权限的
ugi
来操作
$ hadoop fs -D hadoop.job.ugi=nuomi-abc -rmr /app/lbs/nuomi-da-stat/stat_platform_auto/1405/dt=20161111/000000_0Moved to trash: /app/lbs/nuomi-da-stat/stat_platform_auto/1405/dt=20161111/000000_0
1 0
- [问题记录]hdfs删除文件提示rmr: Failed to move to trash
- Hadoop问题集锦:rmr: failed to get server trash configuration:null.……
- xcode 文件move to trash 怎么找回
- hive查询写文件报错Failed with exception Unable to move source hdfs:xx to destination xxx
- ubuntu中用命令行把文件移到回收站 move files to trash from command line
- iOS开发:remove reference与move to trash的区别
- HDFS研究----.Trash文件
- PHP中调用move_uploaded_file函数提示failed to open stream和 Unable to move
- PHP中调用move_uploaded_file函数提示failed to open stream和 Unable to move
- Failed with exception Unable to move source hdfs://maeter:8000/usr/local/hadoop/input/test_hive/test
- IAR文件查找提示Failed to read
- IAR查找文件提示Failed to read
- 'rm' to the Trash
- “App” is damaged and can’t be opened. You should move it to the Trash.
- 【HDFS】hdfs如何打开回收站机制trash,恢复删除的文件
- AndroidStudio提示failed to resolve:
- hdfs.DFSClient: Failed to close file 解决办法
- 【HDFS】文件入Trash-rename操作
- NAT与NAT穿透(一)
- Andorid Dialog万能去黑边去白底方法
- Java学习路程之StringBuffer
- SQL GROUP BY 语句
- iOS - 页面之间传值的实现 - 代理
- [问题记录]hdfs删除文件提示rmr: Failed to move to trash
- Android 关于文件存储路径的总结
- 自适应辛普森法
- CUIT 2016 新生训练题第一周 D-Text Reverse
- H5知识 -- 表单篇
- 在windows10上使用docker哪些坑
- 邮件营销之模板设计 | 五分钟搞定,秒变编辑达人!
- MySql连接字符串
- 好压(HaoZip)的命令行模式用法介绍-转载