Help Center/ MapReduce Service/ Troubleshooting/ Using HDFS/ An Error Is Reported When DistCP Is Used to Copy an Empty Folder
Updated on 2022-12-08 GMT+08:00

An Error Is Reported When DistCP Is Used to Copy an Empty Folder

Symptom

When a user runs the following distcp commands on the MRS client, empty folders cannot be copied from HDFS to OBS:

hadoop distcp -Dfs.obs.endpoint=xxx

-Dfs.obs.access.key=xxx -Dfs.obs.secret.key=xxx -update hdfs://hacluster/blee obs://xxx/aaa

Cause Analysis

If the source directory (for example, blee) is empty and the destination directory (for example, aaa) does not exist, the system automatically creates the aaa directory but does not create the blee directory under aaa.

If the blee directory at the source is not empty and the aaa directory at the destination does not exist, the system automatically creates the aaa directory and creates the blee directory under aaa to move files.

Procedure

  • It is recommended that the source directory (for example, blee) is not empty.
  • If the source directory is empty, manually create a destination directory (aaa for example) before moving files.