Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Can't remove file from HDFS

Solved Go to solution
Highlighted

Can't remove file from HDFS

Explorer

Hi , 

 

I can't remove file from HDFS

 

hdfs dfs -rm -r /user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248/dt=2018-02-22

rm: Permission denied: user=hadoop, access=ALL, inode="/user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248/dt=2018-02-22":impala:hive:drwxr-xr-x

 

1. i created the table on hive and user : hadoop

drwxrwxrwt   - hadoop hive          0 2018-02-23 18:54 /user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248

2, i inserted data to table:dbaa.tablea with impala ,so the folder like below.

drwxr-xr-x   - impala hive          0 2018-02-23 19:33 /user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea1519385391248/dt=2018-02-22

 

my question is 

How can i remove the folder:/user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea1519385391248/dt=2018-02-22

 

1. I tried remove it with user:hadoop

hdfs dfs -rm -r /user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248/dt=2018-02-22

rm: Permission denied: user=hadoop, access=ALL, inode="/user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248/dt=2018-02-22":impala:hive:drwxr-xr-x

2. I tried remove it with user:impala

hdfs dfs -rm -r /user/hadoop/.Trash/180223212154/user/hive/warehouse/dbaa.db/tablea21519385391248/dt=2018-02-22
rm: Permission denied: user=impala, access=EXECUTE, inode="/user/hadoop/.Trash":hadoop:supergroup:drwx-w----

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Can't remove file from HDFS

Expert Contributor

You have a mixed up situation.

Try as user "hdfs" (the superuser of hdfs) and also add -skipTrash in your command.

2 REPLIES 2

Re: Can't remove file from HDFS

Expert Contributor

You have a mixed up situation.

Try as user "hdfs" (the superuser of hdfs) and also add -skipTrash in your command.

Re: Can't remove file from HDFS

Explorer

Yes, 

 

As your said, i removed the file by user'hdfs.