pai icon indicating copy to clipboard operation
pai copied to clipboard

如何删除HDFS的数据

Open hellocandy opened this issue 7 years ago • 3 comments

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:

hellocandy avatar Jan 04 '19 01:01 hellocandy

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-

YanjieGao avatar Jan 04 '19 09:01 YanjieGao

通过在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 avatar Jan 05 '19 03:01 hellocandy

@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

mzmssg avatar Jan 06 '19 09:01 mzmssg