Nhảy đến nội dung chính

Hướng Dẫn Kết Nối Fstorage với AWS CLI

image-1660903091118.png

Download AWS CLI https://awscli.amazonaws.com/AWSCLIV2.msi

1. Cài đặt AWS CLI

image-1660903364422.png

image-1660903541110.png

image-1660903587900.png

image-1660903607498.png

image-1660903630755.png

image-1660903684864.png

Bấm Finish để hoàn tất việc cài đặt.

Sau khi cài đặt thành công mở Windows Powershell lên xem Awscli đã chạy được chưa

kiểm tra bằng command

aws -h

image-1660904344089.png

2. Cấu hình kết nối với Fstorage

Gõ lệnh.

aws configure --profile fstorage

Nhập các thông tin tài khoản Fstorage

AWS Access Key ID [None]: xxxxxxxxxxx
AWS Secret Access Key [None]: xxxxxxxxxxxxxxxxxxxxxxxxxx
Default region name [None]: hcm1
Default output format [None]: json

image-1660904771672.png

Chạy command để kiểm tra kết nối

Chạy command:   

aws s3 --profile fstorage --endpoint-url https://hcm1.fstorage.vn ls s3://

image-1660905037948.png

như vậy là đã kết nối thành công với Fstorage

Copy file từ máy tính lên Fstorage

aws s3 --profile fstorage --endpoint-url https://hcm1.fstorage.vn cp D:\access.log s3://multicloud

image-1660905169810.png

Awscli hỗ trợ một số command

ls : list danh sách Bucket/File/Folder

cp : copy file/folder từ máy tính lên Fstorage hoặc ngược lại

rm : xóa file/folder

mb : tạo bucket

rb : xóa bucket

mv : move file/folder từ máy tính lên Fstorage và ngược lại

sync : đồng bộ dữ liệu từ máy tính lên Fstorage và ngược lại