Cloud Sync Module

New in version Mimic.

This module syncs zone data to a remote cloud service. The sync is unidirectional; data is not synced back from the remote zone. The goal of this module is to enable syncing data to multiple cloud providers. The currently supported cloud providers are those that are compatible with AWS (S3).

User credentials for the remote cloud object store service need to be configured. Since many cloud services impose limits on the number of buckets that each user can create, the mapping of source objects and buckets is configurable. It is possible to configure different targets to different buckets and bucket prefixes. Note that source ACLs will not be preserved. It is possible to map permissions of specific source users to specific destination users.

Due to API limitations there is no way to preserve original object modification time and ETag. The cloud sync module stores these as metadata attributes on the destination objects.

Cloud Sync Tier Type Configuration

Trivial Configuration:

  1. {
  2. "connection": {
  3. "access_key": <access>,
  4. "secret": <secret>,
  5. "endpoint": <endpoint>,
  6. "host_style": <path | virtual>,
  7. },
  8. "acls": [ { "type": <id | email | uri>,
  9. "source_id": <source_id>,
  10. "dest_id": <dest_id> } ... ],
  11. "target_path": <target_path>,
  12. }

Non Trivial Configuration:

  1. {
  2. "default": {
  3. "connection": {
  4. "access_key": <access>,
  5. "secret": <secret>,
  6. "endpoint": <endpoint>,
  7. "host_style" <path | virtual>,
  8. },
  9. "acls": [
  10. {
  11. "type" : <id | email | uri>, # optional, default is id
  12. "source_id": <id>,
  13. "dest_id": <id>
  14. } ... ]
  15. "target_path": <path> # optional
  16. },
  17. "connections": [
  18. {
  19. "connection_id": <id>,
  20. "access_key": <access>,
  21. "secret": <secret>,
  22. "endpoint": <endpoint>,
  23. "host_style" <path | virtual>, # optional
  24. } ... ],
  25. "acl_profiles": [
  26. {
  27. "acls_id": <id>, # acl mappings
  28. "acls": [ {
  29. "type": <id | email | uri>,
  30. "source_id": <id>,
  31. "dest_id": <id>
  32. } ... ]
  33. }
  34. ],
  35. "profiles": [
  36. {
  37. "source_bucket": <source>,
  38. "connection_id": <connection_id>,
  39. "acls_id": <mappings_id>,
  40. "target_path": <dest>, # optional
  41. } ... ],
  42. }

Note

Trivial configuration can coincide with the non-trivial one.

  • connection (container)

Represents a connection to the remote cloud service. Contains conection_id`, ``access_key, secret, endpoint, and host_style.

  • access_key (string)

The remote cloud access key that will be used for a specific connection.

  • secret (string)

The secret key for the remote cloud service.

  • endpoint (string)

URL of remote cloud service endpoint.

  • host_style (path | virtual)

Type of host style to be used when accessing remote cloud endpoint (default: path).

  • acls (array)

Contains a list of acl_mappings.

  • acl_mapping (container)

Each acl_mapping structure contains type, source_id, and dest_id. These will define the ACL mutation that will be done on each object. An ACL mutation allows converting source user id to a destination id.

  • type (id | email | uri)

ACL type: id defines user id, email defines user by email, and uri defines user by uri (group).

  • source_id (string)

ID of user in the source zone.

  • dest_id (string)

ID of user in the destination.

  • target_path (string)

A string that defines how the target path is created. The target path specifies a prefix to which the source object name is appended. The target path configurable can include any of the following variables: - sid: unique string that represents the sync instance ID - zonegroup: the zonegroup name - zonegroup_id: the zonegroup ID - zone: the zone name - zone_id: the zone id - bucket: source bucket name - owner: source bucket owner ID

For example: target_path = rgwx-${zone}-${sid}/${owner}/${bucket}

  • acl_profiles (array)

An array of acl_profile.

  • acl_profile (container)

Each profile contains acls_id (string) that represents the profile, and acls array that holds a list of acl_mappings.

  • profiles (array)

A list of profiles. Each profile contains the following: - source_bucket: either a bucket name, or a bucket prefix (if ends with *) that defines the source bucket(s) for this profile - target_path: as defined above - connection_id: ID of the connection that will be used for this profile - acls_id: ID of ACLs profile that will be used for this profile

S3 Specific Configurables:

Currently cloud sync will only work with backends that are compatible with AWS S3. There are a few configurables that can be used to tweak its behavior when accessing these cloud services:

  1. {
  2. "multipart_sync_threshold": {object_size},
  3. "multipart_min_part_size": {part_size}
  4. }
  • multipart_sync_threshold (integer)

Objects this size or larger will be synced to the cloud using multipart upload.

  • multipart_min_part_size (integer)

Minimum parts size to use when syncing objects using multipart upload.

How to Configure

See Multi-Site for how to multisite config instructions. The cloud sync module requires a creation of a new zone. The zone tier type needs to be defined as cloud:

  1. # radosgw-admin zone create --rgw-zonegroup={zone-group-name} \
  2. --rgw-zone={zone-name} \
  3. --endpoints={http://fqdn}[,{http://fqdn}]
  4. --tier-type=cloud

The tier configuration can be then done using the following command

  1. # radosgw-admin zone modify --rgw-zonegroup={zone-group-name} \
  2. --rgw-zone={zone-name} \
  3. --tier-config={key}={val}[,{key}={val}]

The key in the configuration specifies the config variable that needs to be updated, and the val specifies its new value. Nested values can be accessed using period. For example:

  1. # radosgw-admin zone modify --rgw-zonegroup={zone-group-name} \
  2. --rgw-zone={zone-name} \
  3. --tier-config=connection.access_key={key},connection.secret={secret}

Configuration array entries can be accessed by specifying the specific entry to be referenced enclosed in square brackets, and adding new array entry can be done by using []. Index value of -1 references the last entry in the array. At the moment it is not possible to create a new entry and reference it again at the same command. For example, creating a new profile for buckets starting with {prefix}:

  1. # radosgw-admin zone modify --rgw-zonegroup={zone-group-name} \
  2. --rgw-zone={zone-name} \
  3. --tier-config=profiles[].source_bucket={prefix}'*'
  4. # radosgw-admin zone modify --rgw-zonegroup={zone-group-name} \
  5. --rgw-zone={zone-name} \
  6. --tier-config=profiles[-1].connection_id={conn_id},profiles[-1].acls_id={acls_id}

An entry can be removed by using --tier-config-rm={key}.