tencent cloud

Cloud Object Storage

문서Cloud Object StorageData Lake StorageMetadata AcceleratorData AccessUsing Hadoop Shell to Access COS Metadata-Accelerated Bucket

Using Hadoop Shell to Access COS Metadata-Accelerated Bucket

Download
포커스 모드
폰트 크기
마지막 업데이트 시간: 2025-12-23 17:17:04
AI 번역

Scenarios

For relatively simple file operations, they can be performed directly using the command-line approach. This article guides you on how to access Metadata Acceleration-enabled buckets via Hadoop Shell using the command-line method.

Prerequisites

Ensure that the metadata-acceleration service has been enabled, and that the environment has been properly deployed and the HDFS protocol configured. For specific deployment and configuration details, see Using the HDFS protocol to access a bucket with metadata acceleration enabled.
Log in to any server that has completed environment deployment and HDFS protocol configuration, and go to the command-line interface.

Supported Operations

1. For detailed Hadoop command-line documentation, see Hadoop Shell Commands.
2. Below are some common file operations.

Traverse Directory (list)

hadoop fs -ls cosn://examplebucket-1250000000/

Create Directory (mkdir)

hadoop fs -mkdir -p cosn://examplebucket-1250000000/test_01/xxx

Uploading Files

hadoop fs -put ./len1m.txt cosn://examplebucket-1250000000/test_01/xxx/len1m_1.txt

Downloading a File

hadoop fs -get cosn://examplebucket-1250000000/test_01/xxx/len1m_1.txt ./len1m_1.txt

Deletes files

hadoop fs -rm cosn://examplebucket-1250000000/test_01/xxx/len1m_1.txt

Deleting a Directory

hadoop fs -rm -r cosn://examplebucket-1250000000/test_01/xxx

Directory Statistics (du)

hadoop fs -du cosn://examplebucket-1250000000/test_01

File Checksum

hadoop fs -checksum cosn://examplebucket-1250000000/test_01/xxx/len1m_1.txt


도움말 및 지원

문제 해결에 도움이 되었나요?

피드백