tencent cloud

Cloud Object Storage

DocumentaçãoCloud Object StorageData Lake StorageMetadata AcceleratorData AccessUsing Hadoop Shell to Access COS Metadata-Accelerated Bucket

Using Hadoop Shell to Access COS Metadata-Accelerated Bucket

PDF
Modo Foco
Tamanho da Fonte
Última atualização: 2025-12-23 17:17:04

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


Ajuda e Suporte

Esta página foi útil?

comentários