Reply
Highlighted
Explorer
Posts: 12
Registered: ‎07-26-2017
Accepted Solution

Can't remove file from HDFS

[ Edited ]

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----

 

 

 

Expert Contributor
Posts: 127
Registered: ‎01-08-2018

Re: Can't remove file from HDFS

You have a mixed up situation.

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

Explorer
Posts: 12
Registered: ‎07-26-2017

Re: Can't remove file from HDFS

Yes, 

 

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

 

Announcements