-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-11948. [Docs] [User Guide] DistCP integration. #7588
Open
jojochuang
wants to merge
5
commits into
apache:master
Choose a base branch
from
jojochuang:HDDS-11948
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+117
−0
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c9689fd
HDDS-11931. [Website v2] [Docs] [User Guide] Impala Integration.
jojochuang 3dac746
HDDS-11948. [Docs] [User Guide] DistCP integration.
jojochuang 12b6e8f
Remove Impala doc
jojochuang 5fcd563
Update doc.
jojochuang 9dc0f9c
Fix example command
jojochuang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
--- | ||
title: DistCp | ||
weight: 4 | ||
menu: | ||
main: | ||
parent: "Application Integrations" | ||
--- | ||
<!--- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
|
||
# Hadoop DistCp | ||
|
||
[Hadoop DistCP](https://hadoop.apache.org/docs/current/hadoop-distcp/DistCp.html) is a command line, MapReduce-based tool for bulk data copying. | ||
|
||
The `hadoop distcp` command can be used to copy data to and from Ozone and any Hadoop compatible file systems, such as HDFS or S3A. | ||
|
||
## Basic usage | ||
|
||
To copy files from a source Ozone cluster directory to a destination Ozone cluster directory, use the following command: | ||
|
||
```bash | ||
hadoop distcp ofs://ozone1/vol1/bucket/dir1 ofs://ozone2/vol2/bucket2/dir2 | ||
``` | ||
|
||
You must define the service IDs for both `ozone1` and `ozone2` clusters in the `ozone-site.xml` configuration file. For example: | ||
```bash | ||
<property> | ||
<name>ozone.om.service.ids</name> | ||
<value>ozone1,ozone2</value> | ||
</property> | ||
``` | ||
|
||
Next, define their logical mappings. For more details, refer to [OM High Availability]({{< ref "OM-HA.md" >}}). | ||
|
||
## Copy from HDFS to Ozone | ||
|
||
DistCp performs a file checksum check to ensure file integrity. However, since the default checksum type of HDFS (`CRC32C`) differs from that of Ozone (`CRC32`), the file checksum check will cause the DistCp job to fail. | ||
|
||
To prevent job failures, specify checksum options in the DistCp command to force Ozone to use the same checksum type as HDFS. For example: | ||
|
||
```bash | ||
hadoop distcp \ | ||
-Ddfs.checksum.combine.mode=COMPOSITE_CRC \ | ||
-Dozone.client.checksum.type=CRC32C \ | ||
hdfs://ns1/tmp ofs://ozone1/vol1/bucket1/dst | ||
``` | ||
|
||
> Note: The parameter `-Ddfs.checksum.combine.mode=COMPOSITE_CRC` is not required if the HDFS cluster is running Hadoop 3.1.1 or later. | ||
|
||
Alternatively, you can skip the file checksum check entirely: | ||
|
||
```bash | ||
hadoop distcp \ | ||
-skipcrccheck \ | ||
hdfs://ns1/tmp ofs://ozone1/vol1/bucket1/dst | ||
``` | ||
|
||
## Copy from Ozone to HDFS | ||
|
||
When copying files from Ozone to HDFS, similar issues can occur due to differences in checksum types. In this case, you must configure the checksum type for HDFS, as it is the destination system. | ||
|
||
Example: | ||
|
||
```bash | ||
hadoop distcp \ | ||
-Ddfs.checksum.combine.mode=COMPOSITE_CRC \ | ||
-Ddfs.checksum.type=CRC32 \ | ||
ofs://ozone1/vol1/bucket1/src hdfs://ns1/tmp/dst | ||
``` | ||
|
||
By specifying the appropriate checksum configuration or skipping the validation, you can ensure that DistCp jobs complete successfully when transferring data between HDFS and Ozone. | ||
|
||
## Encrypted data | ||
|
||
When data resides in an HDFS encryption zone or Ozone encrypted buckets, the file checksum will not match. This is because the underlying block data differs due to the use of a new EDEK (Encryption Data Encryption Key) at the destination. In such cases, specify the `-skipcrccheck` parameter to avoid job failures. | ||
|
||
For more information about using Hadoop DistCP, consult the [DistCp Guide](https://hadoop.apache.org/docs/current/hadoop-distcp/DistCp.html). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
title: "Application Integrations" | ||
menu: | ||
main: | ||
weight: 5 | ||
--- | ||
<!--- | ||
Licensed to the Apache Software Foundation (ASF) under one or more | ||
contributor license agreements. See the NOTICE file distributed with | ||
this work for additional information regarding copyright ownership. | ||
The ASF licenses this file to You under the Apache License, Version 2.0 | ||
(the "License"); you may not use this file except in compliance with | ||
the License. You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
|
||
{{<jumbotron>}} | ||
Many applications can be integrated with Ozone through the the Hadoop compatible ofs interface or the S3 interface. | ||
{{</jumbotron>}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this also required if the source and destination are reversed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I havent tried but it will require -Ddfs.checksum.type to specify HDFS checksum type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. tried myself and updated the doc to include commands for both Ozone to HDFS and HDFS to Ozone.