Synchronization of AFM to cloud object storage data to the bucket by using prefix

Prefixes can be used to organize AFM to cloud object storage fileset data inside a bucket. You can upload and download fileset data to the prefix inside the target bucket by creating an AFM to cloud object storage fileset by using user-defined prefix.

To use prefix, you must specify --prefix <prefix> parameter while creating AFM to cloud object storage fileset by using mmafmcosconfig command. After an AFM fileset is created by using prefix, it synchronizes data directly to the prefix every time. AFM appends the root of the bucket with the prefix created and uses this prefix as the target path of the AFM to cloud object storage fileset and sync all the operations to this path.

The prefix is useful when you do not have access to the root level of the bucket. You can use prefix to upload or download fileset data inside that bucket prefix path.

Example: Creating fileset by using prefix to sync data to the bucket

The following example shows how to create a fileset by using prefix to sync AFM to cloud object storage fileset data to the bucket prefix.

  1. Obtain access key, secret key, region, and URL for a bucket similar to the following as shown here.
    
    AccessKey = key1234567890
    SecretKey = key1234567890
    region = us-west-1
    url = s3.amazonaws.com
  2. After the step #1 is completed, issue the following command to add keys with AFM to use it for data synchronization:
    mmafmcoskeys bkt1:region@endpoint set AccessKey SecretKey
    Issue the following command to retrieve the keys:
    mmafmcoskeys bkt1:region@endpoint get
  3. Issue the following command to create an AFM to cloud object storage fileset by using prefix. The following command creates a prefix inside a bucket and uses this prefix as target root path of the bucket.
    mmafmcosconfig fs1 afmbktprefix1 --endpoint https://region@endpoint --object-fs --xattr --prefix dir1  --bucket bkt1 --acls --mode sw

The preceding example creates a prefix to the existing bucket bkt1, then creates an AFM to cloud object storage fileset and append the prefix to the target of the fileset. This prefix becomes the root level of the bucket and all the data is synchronized to this location.