COSN

Slack Docker Pulls GitHub edit source

This guide describes how to configure Alluxio with Tencent COS (Cloud Object Storage) as the under storage system. Tencent Cloud Object Storage (COS) is a distributed storage service offered by Tencent Cloud for unstructured data and accessible via HTTP/HTTPS protocols. It can store massive amounts of data and features imperceptible bandwidth and capacity expansion, making it a perfect data pool for big data computation and analytics.

Basic Setup

Alluxio runs on multiple machines in cluster mode so its binary package needs to be deployed on the machines. You can either compile Alluxio or download the binaries locally.

In preparation for using COS with Alluxio, create a new bucket or use an existing bucket. You should also note the directory you want to use in that bucket, either by creating a new directory in the bucket or using an existing one. For the purposes of this guide, the COS Bucket name is called COSN_ALLUXIO_BUCKET, the directory in that bucket is called COSN_DATA, and COS Bucket region is called COSN_REGION which specifies the region of your bucket.

Basic Setup

Alluxio unifies access to different storage systems through the unified namespace feature. COSN UFS is used to access Tencent Cloud object storage and a COS location can be either mounted at the root of the Alluxio namespace or as a nested directory.

Root Mount Point

Create conf/alluxio-site.properties and conf/core-site.xml if they do not exist.

  1. $ cp conf/alluxio-site.properties.template conf/alluxio-site.properties
  2. $ cp conf/core-site.xml.template conf/core-site.xml

Configure Alluxio to use COSN as its under storage system by modifying conf/alluxio-site.properties and conf/core-site.xml. Specify an existing COS bucket and directory as the under storage system by modifying conf/alluxio-site.properties to include:

  1. alluxio.master.mount.table.root.ufs=cosn://COSN_ALLUXIO_BUCKET/COSN_DATA/

Specify COS configuration information in order to access COS by modifying conf/core-site.xml to include:

  1. <property>
  2. <name>fs.cosn.impl</name>
  3. <value>org.apache.hadoop.fs.CosFileSystem</value>
  4. </property>
  5. <property>
  6. <name>fs.AbstractFileSystem.cosn.impl</name>
  7. <value>org.apache.hadoop.fs.CosN</value>
  8. </property>
  9. <property>
  10. <name>fs.cosn.userinfo.secretKey</name>
  11. <value>xxxx</value>
  12. </property>
  13. <property>
  14. <name>fs.cosn.userinfo.secretId</name>
  15. <value>xxxx</value>
  16. </property>
  17. <property>
  18. <name>fs.cosn.bucket.region</name>
  19. <value>xx</value>
  20. </property>

The above is the most basic configuration. For more configuration please refer to here. After these changes, Alluxio should be configured to work with COSN as its under storage system and you can try Running Alluxio Locally with COSN.

Nested Mount

A COS location can be mounted at a nested directory in the Alluxio namespace to have unified access to multiple under storage systems. The mount command can be used for this purpose.

  1. $ ./bin/alluxio fs mount --option fs.cosn.userinfo.secretId=<COSN_SECRET_ID> \
  2. --option fs.cosn.userinfo.secretKey=<COSN_SECRET_KEY> \
  3. --option fs.cosn.bucket.region=<COSN_REGION> \
  4. --option fs.cosn.impl=org.apache.hadoop.fs.CosFileSystem \
  5. --option fs.AbstractFileSystem.cosn.impl=org.apache.hadoop.fs.CosN \
  6. /cosn cosn://COSN_ALLUXIO_BUCKET/COSN_DATA/

Running Alluxio Locally with COSN

Start up Alluxio locally to see that everything works.

  1. $ ./bin/alluxio format
  2. $ ./bin/alluxio-start.sh local

This should start an Alluxio master and an Alluxio worker. You can see the master UI at http://localhost:19999.

Run a simple example program:

  1. $ ./bin/alluxio runTests

Visit your COS directory at COSN_ALLUXIO_BUCKET/COSN_DATA to verify the files and directories created by Alluxio exist. For this test, you should see files named like:

  1. COSN_ALLUXIO_BUCKET/COSN_DATA/default_tests_files/BASIC_CACHE_THROUGH

To stop Alluxio, you can run:

  1. $ ./bin/alluxio-stop.sh local