Use OSS as the file system of alibaba cloud (aliyun)

Phanix
·
·
IPFS
·

Alibaba cloud (aliyun) also has a storage service similar to gcp, called Object Storage Service (OSS), which is a cheap option for file storage that is not frequently changed.

If you want to access directly on the ec instance, you can use ossfs to mount the bucket as a general file system.

 $ sudo su
$ apt-get install gdebi-core
$ wget https://github.com/aliyun/ossfs/releases/download/v1.80.3/ossfs_1.80.3_ubuntu16.04_amd64.deb
$ gdebi ossfs_1.80.3_ubuntu16.04_amd64.deb 
$ apt-get install automake autotools-dev g git libcurl4-gnutls-dev libfuse-dev libssl-dev libxml2-dev make pkg-config
$ echo [YOUR_OSS_BUCKET_NAME]:[YOUR_OSS_ACCESS_KEY_ID]:[YOUR_OSS_ACCESS_KEY_SECRET] > /etc/passwd-ossfs
$ mkdir /pkg-bucket
$ chmod 640 /etc/passwd-ossfs 
$ ossfs aiwatcher-pkg-bucket /pkg-bucket -ourl=http://[OSS_ENDPOINT_URL]
$ touch /pkg-bucket/test.txt
$ ll /pkg-bucket/
total 12
drwxr-xr-x 3 root root 4096 Mar 21 14:54 ./
drwxr-xr-x 23 root root 4096 Mar 21 14:41 ../
-rw-r--r-- 1 root root 0 Mar 21 14:46 test.txt

The bucket name, access key id, and access key secret required in the process can be found by referring to the following figures.



Original link: Phanix's Blog

CC BY-NC-ND 2.0

Like my work? Don't forget to support and clap, let me know that you are with me on the road of creation. Keep this enthusiasm together!