Configuring Multiple Mounts

Slack Docker Pulls

Introduction

Alluxio enables effective data management across different storage systems and provides a unified view of all data sources. Alluxio achieves this by using a mount table to map paths in Alluxio to those storage systems.

We use the term “Under File System (UFS)” for a storage system managed and cached by Alluxio. Alluxio is built on top of the storage layer, providing cache speed-up and various other data management functionalities. Therefore, those storage systems are “under” the Alluxio layer.

A user “mounts” a UFS to an Alluxio path. The example below illustrates how a user mounts an S3 bucket and a GCS bucket to Alluxio.

Alluxio Namespace

The mount table for the example above will look like:

Alluxio Paths       UFS Paths
=================== =========================
/s3/                s3://bucketA/data/
/gcs/               gs://bucketB/records/

Configuring the Mount Table

Alluxio supports using STATIC_FILE to provide the mount table information. You can add the properties keys in alluxio-site.properties To enable STATIC_FILE for mount table, you need to modify conf/alluxio-site.properties to include:

alluxio.mount.table.source=STATIC_FILE
alluxio.mount.table.static.conf.file=/<path>/mount_table

The format of the static configuration file for mount tables should include the mount path in alluxio, UFS path, and UFS options. Each row represents a mount point, such as: <ALLUXIO_DIR_TO_MOUNT> <UFS_PATH> <UFS_OPTIONS>..., with spaces in between. For example:

/s3 s3://bucketA/data/ s3a.secretKey=<S3 ACCESS KEY> s3a.accessKeyId=<S3 SECRET KEY>
/gcs gs://bucketB/records/ fs.gcs.credential.path=<GCS CREDENTIAL FILE>

After the configuration is complete, you need to restart all processes for the new mount table to take effect.

Use the same configurations for all mount points

You can leave all the UFS configurations in alluxio-site.properties and Alluxio will use those configurations for all mount points of that UFS type. For example:

# Configure the S3 credentials for all mount points
s3.accessKeyId=<S3 ACCESS KEY>
s3.secretKey=<S3 SECRET KEY>
alluxio.underfs.s3.region=us-east-1
alluxio.underfs.s3.endpoint=http://s3.amazonaws.com

# Configure the HDFS configurations for all mount points
alluxio.underfs.hdfs.configuration=/path/to/hdfs/conf/core-site.xml:/path/to/hdfs/conf/hdfs-site.xml

All mount points will use the same S3 credentials and HDFS configurations. This is the simplest way to configure Alluxio for mount points if all UFS of the corresponding type can use the same configuration. It is the simplest way to manage all configuration properties in one alluxio-site.properties file.

Use different configurations for different mount points

It is common that a user may want to use different configurations for different mount points. For example, if a user has two mount points to S3-flavor paths, one backed by AWS S3 and the other backed by MinIO, they will need to use different credentials and endpoints for each mount point.

Alluxio Paths       UFS Paths
=================== ===========================
/s3-images          s3://S3-bucket/data/images
/minio-tables       s3://minio-bucket/data/tables

You can specify different mount options for different mount point.

/s3-images s3://minio-bucket/data/tables/ s3a.secretKey=<S3 SECRET KEY> s3a.accessKeyId=<S3 ACCESS KEY>
/minio-tables s3://minio-bucket/data/tables/ alluxio.underfs.s3.endpoint=http://minio:9000 s3a.accessKeyId=minio s3a.secretKey=minio123 alluxio.underfs.s3.inherit.acl=false alluxio.underfs.s3.disable.dns.buckets=true

In this way, you specify configuration properties for this specific mount point.

Note: If you specify mount options in the STATIC_FILE, please remove those configuration options from the alluxio-site.properties file to avoid confusion as the mount options in the STATIC_FILE will take precedence.

After restarting, the new configuration options will take effect.