X-OR Cloud
  • ☁️Giới Thiệu
  • ℹ️Điều khoản dịch vụ
    • Cam kết chất lượng dịch vụ - SLA
    • Chính sách bảo vệ thông tin cá nhân
    • Chính sách thanh toán
    • Cơ chế tiếp nhận và giải quyết khiếu nại
    • Các điều khoản về quyền riêng tư
    • Điều khoản sử dụng dịch vụ
  • 🚀Sản phẩm
    • X-OR Cloud
      • X-OR Cloud Kubernetes Engine
        • Hướng dẫn sử dụng
      • X-OR Cloud Elastic IP
        • Hướng dẫn sử dụng
      • X-OR Cloud Elastic Load Balancer
        • Hướng dẫn sử dụng
      • X-OR Cloud VPC
        • Hướng dẫn sử dụng
      • X-OR Cloud Backup
        • Hướng dẫn sử dụng
      • X-OR Cloud Image Management
      • X-OR Cloud Elastic Volume
      • X-OR Cloud Auto Scaling
      • X-OR Cloud Elastic Compute
        • Hướng dẫn sử dụng
    • X-OR AI
      • Hướng dẫn
        • Mua gói GPU Container
        • Quản lý Container
    • X-OR Data
      • Bắt đầu
      • Hướng dẫn
        • Mua gói Object Storage
        • Quản lý Bucket
        • Tích hợp Wordpress
        • Sử dụng client
        • Đồng bộ dữ liệu từ sử dụng tool s3sync
        • Tích hợp Object Storage với Javascript
        • Tích hợp Object Storage với Java
        • Tích hợp Object Storage với Go
        • Tích hợp Object Storage với PHP
        • Tích hợp Object Storage với C#
        • Tích hợp Object Storage với NodeJS
        • Sử dụng s3 browser
        • Sử dụng với Object Manager tại X-OR
        • Bật xác thực 2FA
        • Sử dụng MinIO Client
        • Sử dụng rclone
      • FAQs
        • Object Storage là gì?
        • Lợi ích Object Storage mang lại?
        • Có thể thay đổi tên Bucket không?
        • Vì sao không xóa được Bucket?
    • X-OR Stack
  • 🌟Giải pháp
    • Quản lý và chia tài liệu trong doanh nghiệp
    • Sao Lưu Dữ Liệu Đảm Bảo An Toàn và Phục Hồi Nhanh Chóng
    • Giải pháp Backup & Recovery cho Windows Server sử dụng Veeam và Object Storage
  • 📗Tutorials
    • XOR Cloud - Portal
      • Kubernetes
      • Keypair
      • Elastic IP (Public IP)
      • Elastic Compute (Cloud Server)
      • Virtual Private Cloud
    • Linux Basics
      • Hướng dẫn cơ bản về Dòng lệnh Linux
    • JavaScript
      • Cách sử dụng Bảng điều khiển dành cho nhà phát triển JavaScript
      • Cách viết chương trình JavaScript đầu tiên của bạn
      • Cách thêm JavaScript vào HTML
    • React
      • How To Set Up a React Project with Create React App
      • How To Create React Elements with JSX
      • How To Create Custom Components in React
    • NodeJS
      • What is Node.js?
      • Node JS Environment Setup - Node.js installation
      • How To Use Node.js Modules with npm and package.json
    • Python
      • How to Install Python on Windows 10
      • Python Variables
      • Conditional Statements in Python
    • Database
    • NextCloud
      • Hướng dẫn dùng trên giao diện Web
        • Files
        • Lưu trữ bên thứ 3
      • Hướng dẫn sử dụng trên PC ( Windows )
    • Multiple PXE Server On Cloud
    • Storware
      • Cài đặt
    • Window Server Basics
      • Hướng dẫn bảo mật Windows Server cơ bản
    • Tự động sao lưu cơ sở dữ liệu lên Object Storage tại X-OR Cloud
    • Cài đặt và thiết lập Backup File trên Windows Server lên Object Storage sử dụng Veeam
Powered by GitBook
On this page
  1. Sản phẩm
  2. X-OR Data
  3. Hướng dẫn

Sử dụng client

Last updated 11 months ago

X-OR Cloud 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 X-OR Cloud Portal

  • 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 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 Key và Secret Key được thay bằng thông tin lấy tại bước 1

  • Tool S3CMD (command line for linux/unix)

– Cài đặt: CentOS/RHEL: $ sudo yum install s3cmd -y

Ubuntu/Debian: $ sudo apt-get install s3cmd

MacOS: $ brew install s3cmd

– Edit cấu hình file config: ~/.s3cfg

[default]
access_key = UV5GNSEGE31H619C138C
bucket_location = hn1
host_base = s3.xorcloud.net
host_bucket = s3.xorcloud.net
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

– Lưu ý:

  • Khi upload có thể sẽ xảy ra lỗi khi file hoặc folder có dấu cách (sapce), log khi upload file có thể xảy ra

ERROR: S3 error: 403 (SignatureDoesNotMatch)
  • Nguyên nhân của lỗi này là do lỗi của s3cmd ở phiên bản < 2.0.0 xử lý file có dấu sách không đúng.

  • Cách khắc phục :

Có 2 cách để khắc phục việc này

    1. Thêm vào file config s3cfg dòng sau

signature_v2 = True
    1. Cài đặt phiên bản s3cmd từ bản 2 trở lên bằng từ source

wget https://sourceforge.net/projects/s3tools/files/s3cmd/2.0.0/s3cmd-2.0.0.tar.gz
cd s3cmd-2.0.0
python setup.py install

Sau đó kiểm tra lại bằng lệnh 

s3cmd --version

Các phiên bản mới hơn của s3cmd có thể tìm thấy ở đây 

https://github.com/s3tools/s3cmd/releases

  • Tool MC (command line for linux/unix)

– Updates file config ~/.mc/config.json

{
       "version": "9",
       "hosts": {
               "s3": {
                       "url": "https://s3.xorcloud.net",
                       "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ấu hình: Dùng notepad tạo một file cấu hình, đặt tên là xor-cloud-s3.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>X-OR Cloud 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>X-OR Cloud</string>
    </dict>
</plist>

Run file bằng click đúp= Tại giao diện cyberduck, chọn Open connection:

Profile: lựa chọn X-OR Cloud S3 Storage (HTTPS) Servers: s3.xorcloud.net 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

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.

  • Tool aws-cli (command line for linux/unix/windows)

– Cài đặt:

Linux:

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

Windows:

  • Mở cmd của windows và gõ lệnh

msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi***
  • Kiểm tra aws-cli đã được cài đặt bằng cách gõ lệnh sau ở cửa sổ cmd

aws --version

– Cấu hình tạo profile mới với tên là bizfly-s3

  • Thực hiện lệnh

aws configure --profile=xor-cloud-s3
  • Điền thông access key và secret key của tài khoản lấy ở bước 1 và output là json

AWS Access Key ID [None]: 3K1UN991WP0xxxxxx
AWS Secret Access Key [None]: DVDV1Y6zVtPNHG1xxxxx
Default region name [None]: 
Default output format [None]: json
  • Các câu lệnh của aws-cli sẽ cần thêm tham số

–profile=xor-cloud-s3 –endpoint=https://s3.xorcloud.net

  • Ví dụ như câu lệnh list các bucket

aws --profile=xor-cloud-s3 --endpoint=https://s3.xorcloud.net s3 ls
  • Có thể thêm alias như sau để tiện hơn cho việc gõ lệnh

alias aws-xor=“aws –profile=xor-cloud-s3 –endpoint=https://s3.xorcloud.net”

  • Khi đó lệnh list các bucket ngắn gọn hơn

aws-xor s3 ls

– Cài đặt: $ wget $ sudo chmod +x mc $ ./mc –help

– Cài đặt: Tải Cyberduck về và cài đặt:

Chọn Save Password nếu muốn lưu lại mật khẩu, ấn Connect để kết nối

🚀
https://dl.min.io/client/mc/release/linux-amd64/mc
https://cyberduck.io/download/
https://data.x-or.cloud/