如何删除HDFS的数据
Organization Name: advantech
Short summary about the issue/question:我们的Cluster,现在2个worker节点的磁盘占用都超过90%了,从系统里看到HDFS的数据量有18G,我们想把HDFS的数据删除一些,但是在HDFS的portal上没有权限删除,请问有什么办法可用删HDFS的文件吗?
Brief what process you are following:
How to reproduce it:
OpenPAI Environment:cluster
- OpenPAI version:0.8.2
- Cloud provider or hardware configuration:
- OS (e.g. from /etc/os-release):
- Kernel (e.g.
uname -a): - Hardware (e.g. core number, memory size, storage size, GPU type etc.):
- Others:
Anything else we need to know:
you could use hdfs cmd or webhdfs api to delete data
https://github.com/Microsoft/pai/blob/master/docs/hadoop/hdfs.md#WebHDFS- https://github.com/Microsoft/pai/blob/master/docs/hadoop/hdfs.md#hdfs-command-
Ref doc: https://github.com/Microsoft/pai/blob/master/docs/job_tutorial.md#job-submission-steps-
通过在HDFS的protal或者是调用restAPI的方式。 如果要删除HDFS中的owner为root的文件,都会由于权限不足而不能操作。 怎样才能获取root权限,删除这些owner为root的文件?
下面是调用api删除container文件所返回的错误信息 {"RemoteException":{"exception":"AccessControlException","javaClassName":"org.apache.hadoop.security.AccessControlException","message":"Permission denied: user=dr.who, access=ALL, inode="/Container/xianfeng":xianfeng:supergroup:drwxr-xr-x"}}
@hellocandy Try to config the hdfs user,
By hdfs client, you could export HADOOP_USER_NAME=root
By webhdfs, you could refer https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html#Authentication