Bạn cần tìm gì?
Hướng Dẫn Kết Nối Fstorage Với AWS CLI
AWS CLI là một ứng dụng được AWS phát triển để hỗ trợ thao tác với S3 amazon bằng commandline trên hệ hiều hành Linux
B1: Cài đặt AWS CLI
Trên Centos chạy command.
yum install -y awscli
Hoặc
wget https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip
unzip awscli-exe-linux-x86_64.zip
./aws/install
/usr/local/bin/aws --version
Trên Ubuntu chạy command
apt-get install awscli
Hoặc
wget https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip
unzip awscli-exe-linux-x86_64.zip
./aws/install
/usr/local/bin/aws --version
B2: Cấu hình account S3
Chạy command:
aws configure --profile fstorage
AWS Access Key ID [None]: “Nhập Access_key_id”
AWS Secret Access Key [None]: “Nhập Secret_key_id”
Default region name [None]: “Không cần nhập”
Default output format [json]: “json”
Test kết nối.
Chạy command:
aws s3 --profile fstorage --endpoint-url https://s3.fstorage.vn ls s3://fstoragedemo
Upload dữ liệu từ server lên Fstorage
aws s3 --profile fstorage --endpoint-url https://s3.fstorage.vn cp /root/openresty-1.13.6.2.tar.gz s3://fstoragedemo
Download dữ liệu từ S3 xuống Server
aws s3 --profile fstorage --endpoint-url https://s3.fstorage.vn cp s3://fstoragedemo/awscli-exe-linux-x86_64.zip /root
Đồng bộ
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