2 Middleware bucket locator
Ismael Garrido edytuje tę stronę 2024-03-08 11:01:13 -03:00

s3proxy can be configured to select the backend by the bucket names. Each bucket for the backend must be specified in the properties file. Example:

s3proxy.bucket-locator.1=container1
s3proxy.bucket-locator.2=container2

The indexing 1, 2, etc is only to differentiate the bucket entries. The bucket-locator middleware supports glob syntax for bucket names.

If the same bucket exists in two backends, the alias blobstore can be used to disambiguate them. For example, if bucket "data" exists in two backends, the properties files can be arranged as follows. First properties file:

s3proxy.authorization=none
s3proxy.endpoint=http://127.0.0.1:8080
jclouds.provider=filesystem
jclouds.filesystem.basedir=/tmp/one
s3proxy.alias-blobstore.data-backend-1=data
s3proxy.bucket-locator.1=data-backend-1

Second properties file:

s3proxy.authorization=none
s3proxy.endpoint=http://127.0.0.1:8080
jclouds.provider=filesystem
jclouds.filesystem.basedir=/tmp/two
s3proxy.alias-blobstore.data-backend-2=data
s3proxy.bucket-locator.1=data-backend-2

This allows the clients to access the bucket "data" in both backends, while using the same s3proxy credentials.

Start s3proxy with:

s3proxy --properties file1.conf --properties file2.conf