,

HDFS: Failed to move to trash

понедельник, 24 июня 2013 г. Оставить комментарий

I got an error:

[root@vm1 tmp]# hadoop fs -rmr /tmp/my_dir
13/06/21 17:51:40 WARN fs.TrashPolicyDefault: Can't create trash directory: hdfs://vm2:8020/user/root/.Trash/Current/tmp
rmr: Failed to move to trash: hdfs://vm2:8020/tmp/my_dir. Consider using -skipTrash option

I checked if there is a directory "/user/root" and tried to create one.

[root@vm1 tmp]# hadoop fs -ls /
Found 2 items
drwxrwxrwt - hdfs supergroup 0 2013-06-21 17:50 /tmp
drwxr-xr-x - hdfs supergroup 0 2013-06-20 14:25 /user
[root@vm1 tmp]# hadoop fs -ls /user
Found 2 items
drwxrwxr-t - hive hive 0 2013-06-20 14:24 /user/hive
drwxrwxr-x - oozie oozie 0 2013-06-20 14:25 /user/oozie
[root@vm1 tmp]# hadoop fs -mkdir /user/root
mkdir: Permission denied: user=root, access=WRITE, inode="/user":hdfs:supergroup:drwxr-xr-x

The owner of the directory "/ user" is hdfs:supergroup.
Let's create a home directory for the root.

[root@v1 tmp]# sudo -u hdfs hadoop fs -mkdir /user/root 
[root@v1 tmp]# sudo -u hdfs hadoop fs -chown root:root /user/root

Check now delete the file.

[root@v1 tmp]# hadoop fs -rm -r /tmp/my_dir
Moved: 'hdfs://vm2:8020/tmp/my_dir' to trash at: hdfs://vm2:8020/user/root/.Trash/Current

0 коммент. »

Оставьте Ваш комментарий