Configuring Alluxio with OSS
This guide describes how to configure Alluxio with Aliyun OSS as the under storage system. Object Storage Service (OSS) is a massive, secure and highly reliable cloud storage service provided by Aliyun.
To run an Alluxio cluster on a set of machines, you must deploy Alluxio binaries to each of these machines.You can either compile the binaries from Alluxio source code, or download the precompiled binaries directly.
Also, in preparation for using OSS with alluxio, create a bucket or use an existing bucket. You
should also note that 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 OSS bucket
name is called
OSS_BUCKET, and the directory in that bucket is called
OSS_DIRECTORY. Also, for
using the OSS Service, you should provide an OSS endpoint to specify which range your bucket is
on. The endpoint here is called
OSS_ENDPOINT, and to learn more about the endpoints for special
range you can see here. For more
information about OSS Bucket, please see here
Alluxio unifies access to different storage systems through the unified namespace feature. An OSS location can be either mounted at the root of the Alluxio namespace or at a nested directory.
You need to configure Alluxio to use OSS as its under storage system. The first modification is to
specify an existing OSS bucket and directory as the under storage system by modifying
conf/alluxio-site.properties to include:
Next you need to specify the Aliyun credentials for OSS access. In
fs.oss.accessKeyId=<OSS_ACCESS_KEY_ID> fs.oss.accessKeySecret=<OSS_ACCESS_KEY_SECRET> fs.oss.endpoint=<OSS_ENDPOINT>
fs.oss.accessKeyId is the Access Key Id string and
fs.oss.accessKeySecret is the Access
Key Secret string, which are managed in AccessKeys in Aliyun UI.
fs.oss.endpoint is the endpoint of this bucket, which can be found in the Bucket overview with
possible values like “oss-us-west-1.aliyuncs.com”, “oss-cn-shanghai.aliyuncs.com”
(OSS Internet Endpoint).
After these changes, Alluxio should be configured to work with OSS as its under storage system, and you can try to run alluxio locally with OSS.
An OSS location can be mounted at a nested directory in the Alluxio namespace to have unified
access to multiple under storage systems. Alluxio’s
Mount Command can be used for this purpose.
For example, the following command mounts a directory inside an OSS bucket into Alluxio directory
./bin/alluxio fs mount --option fs.oss.accessKeyId=<OSS_ACCESS_KEY_ID> \ --option fs.oss.accessKeySecret=<OSS_ACCESS_KEY_SECRET> \ --option fs.oss.endpoint=<OSS_ENDPOINT> \ /oss oss://<OSS_BUCKET>/<OSS_DIRECTORY>/
Running Alluxio Locally with OSS
After everything is configured, you can start up Alluxio locally to see that everything works.
bin/alluxio format 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.
Next, you can run a simple example program:
After this succeeds, you can visit your OSS directory
oss://<OSS_BUCKET>/<OSS_DIRECTORY> to verify the files
and directories created by Alluxio exist. For this test, you should see files named like
To stop Alluxio, you can run: