Object Storage Service (OSS) Acceleration by CDN

By Eugene S. Chung, Solutions Architect

This article describes how to accelerate Alibaba Cloud Content Delivery Network (CDN) by using the baba-oss-uploader-bin tool. For alternative methods that use the Alibaba Cloud CDN console or the OSS console, see the Attach a CDN acceleration domain name topic in the OSS Console User Guide.

Introduction

baba-oss-uploader-bin is a handy command line OSS client that you can configure to work with cron, Jenkins, legacy automated release mgmt. tools, and others. It provides a few useful features with strong controls against all changes in Alibaba Cloud SDK.

baba-oss-uploader-bin has the following features:

  • Allows mass upload by multipart support.
  • Allows bulk upload to OSS bucket with prefix.
  • Integrates well with legacy automation tools such as cron, and Jenkins.
  • Works with Alibaba Cloud CDN after some simple configuration.

Pre-requisites

  • JDK 1.7 or later is installed.
  • Git is installed.

Procedure

1. From your command line, download the repository from GitHub.
2. Configure .clientprofile.
3. Run baba-oss-uploader-bin.

Note: After you download the repository, you can find the all-in-one package at build/libs/baba-oss-uploader-all-1.0.jar.

4. Configure .clientprofile by entering the following information:

  • key.id: your key id from the console
  • key.secret: your key secret from the console
  • endpoint: endpoint where your bucket is located. For a complete list of regions and their corresponding endpoints, see Regions and endpoints in the official documentation.
  • bucket: the bucket name
  • prefix: prefix to be added to the keys to identify. It can be the folder name under / (root) or entire path from /
  • upload.file: file name or directory to be uploaded

Note: .clientprofile is located in the current path or your home.

5. Use the tool to upload to OSS by running one of the following commands:

$ java -jar [options] baba-oss-uploader-all-1.0.jarOr$ java -cp [options] baba-oss-uploader-all-1.0.jar com.eg.baba.oss.uploader.Main

Example:

$ java -jar baba-oss-uploader-all-1.0.jar –Dupload.file=d:/tmp/000006M.dat

Note:

  • Some JDK distributions do not support –jar options.
  • The command line options override all configuration attributes which are defined from .clientprofile. All options are in –Dkey=value format.
  • If the file to be uploaded is larger than 5 MB, multipart upload is used.

That’s it! You now can now experience fast OSS uploads for large files using CDN.

Reference:https://www.alibabacloud.com/blog/object-storage-service-oss-acceleration-by-cdn_594574?spm=a2c41.12663397.0.0

Written by

Follow me to keep abreast with the latest technology news, industry insights, and developer trends.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store