2016-06-03 4 views
0

내 hadoop hdfs 파일 디렉토리로 Azure blob 저장소를 사용하고 있습니다. 로컬 컴퓨터에서 명령 프롬프트를 사용하여 Azure BLOB 저장소에 입력 파일을 전달하면 content-type이 'application/octet-stream'으로 변경되어 분할되지 않습니다.hadoop hdfs 파일에서 'application/octet-stream'에서 'text/plain'으로 파일의 인코딩을 변경하는 방법

hdfs 파일의 인코딩을 변경하는 방법은 무엇입니까?

+0

, 의미합니까? 또한 어떤 프로그램을 사용하여 파일을 이동합니까? –

+0

예, 나는 방울 저장을 의미했습니다. 임씨는 그것을하는 유닉스 명령을 찾고있다. –

답변

0

Azure-CLI를 사용하여 BLOB를 Azure 저장소에 업로드 할 수 있습니다. .txt 파일이 있으면이 스크립트는 파일을 텍스트/일반 내용 유형으로 업로드합니다.

#!/bin/bash 
# A simple Azure storage example 

export AZURE_STORAGE_ACCOUNT=<storage_account_name> 
export AZURE_STORAGE_ACCESS_KEY=<storage_account_key> 

export container_name=<container_name> 
export blob_name=<blob_name> 

export image_to_upload=\Downloads\\uploadtest.txt 

echo "Creating the container..." 
azure storage container create $container_name 

echo "Uploading the image..." 
azure storage blob upload $image_to_upload $container_name $blob_name 

echo "Listing the blobs..." 
azure storage blob list $container_name 

echo "Done" 

업로드하는 동안 콘텐츠 유형을 변경할 수있는 기능이 없습니다. 다른 파일 형식과 텍스트를 사용하는 경우 업로드하기 전에 파일을 변환하거나 업로드 후에 BLOB를 변환해야합니다.

자료 : 당신이 blobstorage

는 HDFS 말

Azure Docs - CLI Install

Azure Docs - How to upload