rclone 으로 오브젝트 스토리지에 파일 동기화 하기
rclone 은 클라우드 스토리지 간 동기화 또는 로컬 서버에 있는 파일을 주기적으로 오브젝트 스토리지에 동기화 할 수 있는 커맨드 기반의 프로그램이다. (참고 https://rclone.org )
rclone - rsync for cloud storage
Twitter. Facebook. Reddit.
rclone.org
AWS , Azure, GCP 의 오브젝트 스토리지 뿐 아니라 AWS S3 API 가 호환되는 네이버 클라우드 플랫폼 (Ncloud) 의 오브젝트 스토리지에서도 rclone 을 사용할 수 있다.
- Ncloud 오브젝트 스토리지 https://www.ncloud.com/product/storage/objectStorage
NAVER CLOUD PLATFORM
cloud computing services for corporations, IaaS, PaaS, SaaS, with Global region and Security Technology Certification
www.ncloud.com
1. rclone 설치
서버 <-> 오브젝트 스토리지 간 파일 복제 환경을 구성하기 위해 업로드 할 데이터가 저장되는 서버에 rclone 을 설치한다.
# curl https://rclone.org/install.sh | sudo bash |
2. rclone 설정
Ncloud Object Storage 를 rclone 프로그램이 제어할 수 있도록 설정해준다.
특정 값을 입력해줘야 하는 항목 외에는 모두 default 항목으로 설정하면 되므로 입력이 필요한 값에 대해서만 아래 내용에서 표기하였다.
# rclone config 1 / Amazon Web Services (AWS) S3 \ "AWS" 2 / Alibaba Cloud Object Storage System (OSS) formerly Aliyun \ "Alibaba" 3 / Ceph Object Storage \ "Ceph" 4 / Digital Ocean Spaces \ "DigitalOcean" 5 / Dreamhost DreamObjects \ "Dreamhost" 6 / IBM COS S3 \ "IBMCOS" 7 / Minio Object Storage \ "Minio" 8 / Netease Object Storage (NOS) \ "Netease" 9 / StackPath Object Storage \ "StackPath" 10 / Wasabi Object Storage \ "Wasabi" 11 / Any other S3 compatible provider \ "Other"
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if no env vars). Only applies if access_key_id and secret_access_key is blank. Enter a boolean value (true or false). Press Enter for the default ("false"). Choose a number from below, or type in your own value 1 / Enter AWS credentials in the next step \ "false" 2 / Get AWS credentials from the environment (env vars or IAM) \ “true"
AWS Access Key ID. Leave blank for anonymous access or runtime credentials. Enter a string value. Press Enter for the default (""). access_key_id> access key 입력
AWS Secret Access Key (password) Leave blank for anonymous access or runtime credentials. Enter a string value. Press Enter for the default (""). secret_access_key> secret key 입력
Leave blank if you are using an S3 clone and you don't have a region. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Use this if unsure. Will use v4 signatures and an empty region. \ "" 2 / Use this only if v4 signatures don't work, eg pre Jewel/v10 CEPH. \ "other-v2-signature"
Endpoint for S3 API. Required when using an S3 clone. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value endpoint> https://kr.object.ncloudstorage.com |
Ncloud 에서 사용할 수 있는 Aceess / Secret key 는 ncloud 포털의 마이페이지-> 인증키 관리 에서 확인할 수 있다.
rclone 설정이 완료된 후 아래와 같이 ncloud bucket 과 object 를 조회할 수 있다.
# rclone ls ncloud:bucket02 # rclone ls $rclone config 에서 설정한 ncloud별칭:$조회할 버킷명 |
목록 조회 외 rclone 주요 명령어는 아래 링크에서 확인할 수 있다.
Commands
Twitter. Facebook. Reddit.
rclone.org