Client tool kết nối với Simple Storage
Simple Storage có thể tương thích với nhiều client tool như: S3CMD, MC (command line for linux/unix), CyberDuck (software for Mac & Windows)
Bạn cần:
- Cài đặt client tool trên một máy tính/máy chủ
- Tạo tài khoản và tạo bucket trên BizFly Dashboard
- Lấy Access Key & Secret key của bucket
Bước 1: Lấy cặp Access Key & Secret key
Truy cập đường dẫn https://manage.bizflycloud.vn/account/security lấy cặp Access Key & Secret Key dùng trong việc kết nối:
Bước 2: Thực hiện việc configure các tool theo thông tin như bên dưới
Các trường Access Keyvà Secret Key được thay bằng thông tin lấy tại bước 1
- S3CMD (command line for linux/unix)
– Cài đặt:
CentOS/RHEL:
$ sudo yum install s3cmd -y
Ubuntu/Debian:
$ sudo apt-get install s3cmd
– Edit cấu hình file config: ~/.s3cfg
[default]
access_key = UV5GNSEGE31H619C138C
bucket_location = hn1
host_base = ss-hn-1.bizflycloud.vn
host_bucket = ss-hn-1.bizflycloud.vn
secret_key = fjEK04YtZddX8RJXXXXXXXXXX
use_https = True
Một số thao tác cơ bản:\
- List các bucket
$ s3cmd ls
2019-11-01 03:42 s3://bucket-1
- Upload file to bucket\
$ s3cmd put file.txt s3://bucket-1
- MC (command line for linux/unix)
– Cài đặt:
$ wget https://dl.min.io/client/mc/release/linux-amd64/mc
$ sudo chmod +x mc
$ ./mc –help
– Updates file config ~/.mc/config.json
{
"version": "9",
"hosts": {
"s3": {
"url": "https://ss-hn-1.bizflycloud.vn",
"accessKey": "UV5GNSEGE31H619C138C",
"secretKey": "fjEK04YtZddX8RJtroxxxxxxxxxxxxxxxx,
"api": "s3v4",
"lookup": "auto"
}
}
}
-
List bucket
$ ./mc ls s3
[2019-11-01 10:42:36 +07] 0B bucket-1/> -
Upload file to bucket
$ ./mc cp myobject.txt s3/bucket-1 -
Cyberduck (for Mac and Windows)
– Cài đặt:
Tải Cyberduck về và cài đặt: https://cyberduck.io/download/
– Cấu hình:
Dùng notepad tạo một file cấu hình, đặt tên là s3bizfly.cyberduckprofile (tên có thể bất kỳ nhưng phải có đuôi .cyberduckprofile) có nội dung như sau:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Protocol</key>
<string>s3</string>
<key>Vendor</key>
<string>s3-aws2-https</string>
<key>Scheme</key>
<string>https</string>
<key>Description</key>
<string>BizFly Simple Storage (HTTPS)</string>
<key>Default Port</key>
<string>443</string>
<key>Hostname Configurable</key>
<true/>
<key>Port Configurable</key>
<true/>
<key>Username Configurable</key>
<true/>
<key>Authorization</key>
<string>BizFly</string>
</dict>
</plist>
Run file bằng click đúp= Tại giao diện cyberduck, chọn Open connection:
Profile: lựa chọn BizFly Simple Storage (HTTPS)
Servers: ss-hn-1.bizflycloud.vn
Access Key ID: nhập Access Key ID lấy ở bước 1
Secret Access Key: nhập Secret Key lấy ở bước 1
Chọn Save Password nếu muốn lưu lại mật khẩu, ấn Connect để kết nối
Sau khi đã kết nối thành công, giao diện cyberduck sẽ hiển thị các bucket đang có trong tài khoản. Bạn hoàn toàn có thể download, upload, tạo mới…folder và file
Các folder và file tải về nằm trong thư mục Downloads của user chạy cyberduck.