tencent cloud

Cloud Object Storage

Release Notes and Announcements
Release Notes
Announcements
Product Introduction
Overview
Features
Use Cases
Strengths
Concepts
Regions and Access Endpoints
Specifications and Limits
Service Regions and Service Providers
Billing
Billing Overview
Billing Method
Billable Items
Free Tier
Billing Examples
Viewing and Downloading Bill
Payment Overdue
FAQs
Getting Started
Console
Getting Started with COSBrowser
User Guide
Creating Request
Bucket
Object
Data Management
Batch Operation
Global Acceleration
Monitoring and Alarms
Operations Center
Data Processing
Content Moderation
Smart Toolbox
Data Processing Workflow
Application Integration
User Tools
Tool Overview
Installation and Configuration of Environment
COSBrowser
COSCLI (Beta)
COSCMD
COS Migration
FTP Server
Hadoop
COSDistCp
HDFS TO COS
GooseFS-Lite
Online Tools
Diagnostic Tool
Use Cases
Overview
Access Control and Permission Management
Performance Optimization
Accessing COS with AWS S3 SDK
Data Disaster Recovery and Backup
Domain Name Management Practice
Image Processing
Audio/Video Practices
Workflow
Direct Data Upload
Content Moderation
Data Security
Data Verification
Big Data Practice
COS Cost Optimization Solutions
Using COS in the Third-party Applications
Migration Guide
Migrating Local Data to COS
Migrating Data from Third-Party Cloud Storage Service to COS
Migrating Data from URL to COS
Migrating Data Within COS
Migrating Data Between HDFS and COS
Data Lake Storage
Cloud Native Datalake Storage
Metadata Accelerator
GooseFS
Data Processing
Data Processing Overview
Image Processing
Media Processing
Content Moderation
File Processing Service
File Preview
Troubleshooting
Obtaining RequestId
Slow Upload over Public Network
403 Error for COS Access
Resource Access Error
POST Object Common Exceptions
API Documentation
Introduction
Common Request Headers
Common Response Headers
Error Codes
Request Signature
Action List
Service APIs
Bucket APIs
Object APIs
Batch Operation APIs
Data Processing APIs
Job and Workflow
Content Moderation APIs
Cloud Antivirus API
SDK Documentation
SDK Overview
Preparations
Android SDK
C SDK
C++ SDK
.NET(C#) SDK
Flutter SDK
Go SDK
iOS SDK
Java SDK
JavaScript SDK
Node.js SDK
PHP SDK
Python SDK
React Native SDK
Mini Program SDK
Error Codes
Harmony SDK
Endpoint SDK Quality Optimization
Security and Compliance
Data Disaster Recovery
Data Security
Cloud Access Management
FAQs
Popular Questions
General
Billing
Domain Name Compliance Issues
Bucket Configuration
Domain Names and CDN
Object Operations
Logging and Monitoring
Permission Management
Data Processing
Data Security
Pre-signed URL Issues
SDKs
Tools
APIs
Agreements
Service Level Agreement
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

HDFS TO COS

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2024-01-06 16:15:35

Overview

The HDFS TO COS tool is used to copy data from HDFS to Tencent Cloud COS(Cloud Object Storage).

Operating Environments

Operating system

Linux or Windows

Software dependency

JDK v1.7 or v1.8

Installation and configuration

For more information on environment installation and configuration, see Java.

Configuration Method

1. Install Hadoop v2.7.2 or higher. For detailed directions, see Hadoop.
2. Download the HDFS TO COS tool from GitHub and decompress it.
3. Copy the core-site.xml file of the HDFS cluster to be synced to the conf folder. The core-site.xml file contains the configuration information of NameNode.
4. In the cos_info.conf configuration file, configure the bucket, region, and API key information. The bucket name is formed by connecting a user-defined string and the system-generated APPID with a hyphen, for example, examplebucket-1250000000.
5. Specify the configuration file location in the command line parameter. The default location is conf/cos_info.conf.
Note:
If the command line parameter conflicts with the configuration file, the command line parameter shall apply.

Usage

Note:
Linux is used as an example below.

Viewing help

./hdfs_to_cos_cmd -h

Copying a file

Copy from HDFS to COS. If a file with the same name as the file to be copied already exists in COS, the former will be overwritten.
./hdfs_to_cos_cmd --hdfs_path=/tmp/hive --cos_path=/hdfs/20170224/
Copy from HDFS to COS. If a file with the same name and length as the file to be copied already exists in COS, the latter will be skipped (this is suitable for repeated copy).
./hdfs_to_cos_cmd --hdfs_path=/tmp/hive --cos_path=/hdfs/20170224/ -skip_if_len_match
Only the length is checked here, as the overheads would be very high if the digests of files in Hadoop are calculated.
Copy from HDFS to COS. If the Har directory (Hadoop archive file) exists in HDFS, the .har files can be automatically decompressed by specifying the --decompress_har parameter:
./hdfs_to_cos_cmd --decompress_har --hdfs_path=/tmp/hive --cos_path=/hdfs/20170224/
If the --decompress_har parameter is not specified, the directory will be copied as an ordinary HDFS directory, that is, the files in the Har directory such as index and masterindex will be copied as-is.

Directory information

conf: configuration file, which is used to store `core-site.xml` and `cos_info.conf`
log: log directory
src: Java source program
dep: compiled executable JAR package

FAQs and Help

Configuration information

Please make sure that the entered configuration information is correct, including bucket, region, and API key information. The bucket name is formed by connecting the user-defined string and system-generated APPID with a hyphen, such as examplebucket-1250000000. Please also make sure that the time on the server is in sync with the local time (if there is a difference of about 1 minute, it is okay, but if the difference is large, please set the server time correctly).

DataNode

Please make sure that the server where the copy program is located can also access the DataNode. The NameNode uses a public IP address and can be accessed, but the DataNode where the obtained block is located uses a private IP address and cannot be accessed directly; therefore, it is recommended that the copy program be placed in a Hadoop node for execution, so that both the NameNode and DataNode can be accessed.

Permissions

Please use the current account to download a file with the Hadoop command, check whether everything is correct, and then use the synchronization tool to sync the data in Hadoop.

File overwriting

Files that already exist in COS will be overwritten by default in case of repeated upload, unless you explicitly specify the -skip_if_len_match parameter, which indicates to skip files during upload if they have the same length as existing files.

cos path

cos path is considered as a directory by default, and files that are eventually copied from HDFS will be stored in this directory.

Copying data from Tencent Cloud EMR HDFS

To copy data from Tencent Cloud EMR HDFS to COS, you are advised to use the high-performance DistCp tool. For more information, see Migrating Data Between HDFS and COS.

Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan