[ 
https://issues.apache.org/jira/browse/HDFS-12161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Siyao Meng updated HDFS-12161:
------------------------------
    Description: 
After running distcp as user 'usertest' which is a hdfs superuser, the 
destination folder ownership is not preserved.

e.g.
{code:bash}
hadoop distcp -pugpaxt -update -skipcrccheck /tmp/usertest  
/tmp/new_user/usertest_copy
{code}

 After distcp is executed, the parent folder has ownership with 'usertest' : 
{code:bash}
drwxr-xr-x   - usertest supergroup          0 2017-07-13 22:09 
/tmp/new_user/usertest_copy 
{code}  
  and the actual files copied by distcp preserved the permissions:
{code:bash}
drwxr-xr-x   - hive hive          0 2017-07-13 22:09 
/tmp/new_user/usertest_copy/dir1
-rw-r--r--   1 hdfs hive        287 2017-07-13 22:09 
/tmp/new_user/usertest_copy/test1.txt
{code}
The distcp options (-pugpaxt) does not apply to the destination parent 
directory specified in the distcp command e.g. "/tmp/new_user/usertest_copy".

Can we document this in https://hadoop.apache.org/docs/r1.2.1/distcp2.html 
under Command Line Options

The destination folder location needs to be pre-created with correct 
ownership/permissions before using distcp. The preserve options do not apply to 
parent folder.

  was:
After running distcp as user 'usertest' which is a hdfs superuser, the 
destination folder ownership is not preserved.

e.g.
{code:bash}
hadoop distcp -pugpaxt -update -skipcrccheck /tmp/usertest  
/tmp/new_user/usertest_copy
{code}

 After distcp is executed, the parent folder has ownership with 'usertest' : 
{code:bash} 
drwxr-xr-x   - usertest supergroup          0 2017-07-13 22:09 
/tmp/new_user/usertest_copy 
{code}  
  and the actual files copied by distcp preserved the permissions:
{code:bash}
  drwxr-xr-x   - hive hive          0 2017-07-13 22:09 
/tmp/new_user/usertest_copy/dir1
  -rw-r--r--   1 hdfs hive        287 2017-07-13 22:09 
/tmp/new_user/usertest_copy/test1.txt
{code}
The distcp options (-pugpaxt) does not apply to the destination parent 
directory specified in the distcp command e.g. "/tmp/new_user/usertest_copy"

Can we document this in https://hadoop.apache.org/docs/r1.2.1/distcp2.html
under Command Line Options

The destination folder location needs to be pre-created with correct 
ownership/permissions before using distcp. The preserve options do not apply to 
parent folder.


> Distcp does not preserve ownership in  destination parent folder
> ----------------------------------------------------------------
>
>                 Key: HDFS-12161
>                 URL: https://issues.apache.org/jira/browse/HDFS-12161
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: hdfs
>    Affects Versions: 2.6.0
>            Reporter: Sailesh Patel
>            Assignee: Siyao Meng
>            Priority: Minor
>
> After running distcp as user 'usertest' which is a hdfs superuser, the 
> destination folder ownership is not preserved.
> e.g.
> {code:bash}
> hadoop distcp -pugpaxt -update -skipcrccheck /tmp/usertest  
> /tmp/new_user/usertest_copy
> {code}
>  After distcp is executed, the parent folder has ownership with 'usertest' : 
> {code:bash}
> drwxr-xr-x   - usertest supergroup          0 2017-07-13 22:09 
> /tmp/new_user/usertest_copy 
> {code}  
>   and the actual files copied by distcp preserved the permissions:
> {code:bash}
> drwxr-xr-x   - hive hive          0 2017-07-13 22:09 
> /tmp/new_user/usertest_copy/dir1
> -rw-r--r--   1 hdfs hive        287 2017-07-13 22:09 
> /tmp/new_user/usertest_copy/test1.txt
> {code}
> The distcp options (-pugpaxt) does not apply to the destination parent 
> directory specified in the distcp command e.g. "/tmp/new_user/usertest_copy".
> Can we document this in https://hadoop.apache.org/docs/r1.2.1/distcp2.html 
> under Command Line Options
> The destination folder location needs to be pre-created with correct 
> ownership/permissions before using distcp. The preserve options do not apply 
> to parent folder.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to