@@ -10,8 +10,8 @@ constraint) with the right endpoint and credentials.
10
10
This section of the documentation shows you how to set up our currently
11
11
supported public cloud backends:
12
12
13
- - `Amazon S3 <#aws-s3-as-a-backend >`__ ;
14
- - `Microsoft Azure <#microsoft-azure-as-a-backend >`__ .
13
+ - `Amazon S3 <#aws-s3-as-a-data- backend >`__ ;
14
+ - `Microsoft Azure <#microsoft-azure-as-a-data- backend >`__ .
15
15
16
16
For each public cloud backend, you will have to edit your CloudServer
17
17
:code: `locationConfig.json ` and do a few setup steps on the applicable public
@@ -198,7 +198,7 @@ CloudServer credentials defined in :code:`conf/authdata.json`. By default, the
198
198
access key is :code: `accessKey1 ` and the secret key is :code: `verySecretKey1 `.
199
199
For more informations, refer to our template `~/.s3cfg <./CLIENTS/#s3cmd >`__ .
200
200
201
- Pre existing objects in your AWS S3 hosted bucket can unfortunately not be
201
+ Pre- existing objects in your AWS S3 hosted bucket can unfortunately not be
202
202
accessed by CloudServer at this time.
203
203
204
204
Make sure versioning is enabled in your remote AWS S3 hosted bucket. To check,
@@ -208,6 +208,160 @@ top, and then you should see something like this:
208
208
.. figure :: ../res/aws-console-versioning-enabled.png
209
209
:alt: AWS Console showing versioning enabled
210
210
211
+ Microsoft Azure as a data backend
212
+ ---------------------------------
213
+
214
+ From the MS Azure Console
215
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
216
+
217
+ From your Storage Account dashboard, create a container where you will host your
218
+ data for this new location constraint.
219
+
220
+ You will also need to get one of your Storage Account Access Keys, and to
221
+ provide it to CloudServer.
222
+ This can be found from your Storage Account dashboard, under "Settings, then
223
+ "Access keys".
224
+
225
+ In this example, our container will be named ``zenkontainer ``, and will belong
226
+ to the ``zenkomeetups `` Storage Account.
227
+
228
+ From the CloudServer repository
229
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230
+
231
+ locationConfig.json
232
+ ^^^^^^^^^^^^^^^^^^^
233
+
234
+ Edit this file to add a new location constraint. This location constraint will
235
+ contain the information for the MS Azure container to which you will be writing
236
+ your data whenever you create a CloudServer bucket in this location.
237
+ There are a few configurable options here:
238
+
239
+ - :code: `type ` : set to :code: `azure ` to indicate this location constraint is
240
+ writing data to MS Azure;
241
+ - :code: `legacyAwsBehavior ` : set to :code: `true ` to indicate this region should
242
+ behave like AWS S3 :code: `us-east-1 ` region, set to :code: `false ` to indicate
243
+ this region should behave like any other AWS S3 region (in the case of MS Azure
244
+ hosted data, this is mostly relevant for the format of errors);
245
+ - :code: `azureStorageEndpoint ` : set to your storage account's endpoint, usually
246
+ :code: `https://{{storageAccountName}}.blob.core.windows.name `;
247
+ - :code: `azureContainerName ` : set to an *existing container * in your MS Azure
248
+ storage account; this is the container in which your data will be stored for
249
+ this location constraint;
250
+ - :code: `bucketMatch ` : set to :code: `true ` if you want your object name to be
251
+ the same in your local bucket and your MS Azure container; set to
252
+ :code: `false ` if you want your object name to be of the form
253
+ :code: `{{localBucketName}}/{{objectname}} ` in your MS Azure container ;
254
+ - :code: `azureStorageAccountName ` : the MS Azure Storage Account to which your
255
+ container belongs;
256
+ - :code: `azureStorageAccessKey ` : one of the Access Keys associated to the above
257
+ defined MS Azure Storage Account.
258
+
259
+ .. code :: json
260
+
261
+ (...)
262
+ "azure-test" : {
263
+ "type" : " azure" ,
264
+ "legacyAwsBehavior" : false ,
265
+ "details" : {
266
+ "azureStorageEndpoint" : " https://zenkomeetups.blob.core.windows.net/" ,
267
+ "bucketMatch" : true ,
268
+ "azureContainerName" : " zenkontainer" ,
269
+ "azureStorageAccountName" : " zenkomeetups" ,
270
+ "azureStorageAccessKey" : " auhyDo8izbuU4aZGdhxnWh0ODKFP3IWjsN1UfFaoqFbnYzPj9bxeCVAzTIcgzdgqomDKx6QS+8ov8PYCON0Nxw=="
271
+ }
272
+ },
273
+ (...)
274
+
275
+ .. WARNING ::
276
+ If you set :code: `bucketMatch ` to :code: `true `, we strongly advise that you
277
+ only have one local bucket per MS Azure location.
278
+ Without :code: `bucketMatch ` set to :code: `false `, your object names in your
279
+ MS Azure container will not be prefixed with your Cloud Server bucket name.
280
+ This means that if you put an object :code: `foo ` to your CloudServer bucket
281
+ :code: `zenko1 ` and you then put a different :code: `foo ` to your CloudServer
282
+ bucket :code: `zenko2 ` and both :code: `zenko1 ` and :code: `zenko2 ` point to the
283
+ same MS Azure container, the second :code: `foo ` will overwrite the first
284
+ :code: `foo `.
285
+
286
+ .. TIP ::
287
+ You may export environment variables to **override ** some of your
288
+ :code: `locationConfig.json ` variable ; the syntax for them is
289
+ :code: `{{region-name}}_{{ENV_VAR_NAME}} `; currently, the available variables
290
+ are those shown below, with the values used in the current example:
291
+
292
+ .. code :: shell
293
+
294
+ $> export azure-test_AZURE_STORAGE_ACCOUNT_NAME=" zenkomeetups"
295
+ $> export azure-test_AZURE_STORAGE_ACCESS_KEY=" auhyDo8izbuU4aZGdhxnWh0ODKFP3IWjsN1UfFaoqFbnYzPj9bxeCVAzTIcgzdgqomDKx6QS+8ov8PYCON0Nxw=="
296
+ $> export azure-test_AZURE_STORAGE_ENDPOINT=" https://zenkomeetups.blob.core.windows.net/"
297
+
298
+ Start the server with the ability to write to MS Azure
299
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
300
+
301
+ Inside the repository, once all the files have been edited, you should be able
302
+ to start the server and start writing data to MS Azure through CloudServer.
303
+
304
+ .. code :: shell
305
+
306
+ # Start the server locally
307
+ $> S3DATA=multiple npm start
308
+
309
+ Run the server as a docker container with the ability to write to MS Azure
310
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
311
+
312
+ Mount all the files that have been edited to override defaults, and do a
313
+ standard Docker run; then you can start writing data to MS Azure through
314
+ CloudServer.
315
+
316
+ .. code :: shell
317
+
318
+ # Start the server in a Docker container
319
+ $> sudo docker run -d --name CloudServer \
320
+ -v $( pwd) /data:/usr/src/app/localData \
321
+ -v $( pwd) /metadata:/usr/src/app/localMetadata \
322
+ -v $( pwd) /locationConfig.json:/usr/src/app/locationConfig.json \
323
+ -v $( pwd) /conf/authdata.json:/usr/src/app/conf/authdata.json \
324
+ -e S3DATA=multiple -e ENDPOINT=http://localhost -p 8000:8000
325
+ -d scality/s3server
326
+
327
+ Testing: put an object to MS Azure using CloudServer
328
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
329
+
330
+ In order to start testing pushing to MS Azure, you will need to create a local
331
+ bucket in the MS Azure region - this local bucket will only store the metadata
332
+ locally, while both the data and any user metadata (:code: `x-amz-meta ` headers
333
+ sent with a PUT object, and tags) will be stored on MS Azure.
334
+ This example is based on all our previous steps.
335
+
336
+ .. code :: shell
337
+
338
+ # Create a local bucket storing data in MS Azure
339
+ $> s3cmd --host=127.0.0.1:8000 mb s3://zenkontainer --region=azure-test
340
+ # Put an object to MS Azure, and store the metadata locally
341
+ $> s3cmd --host=127.0.0.1:8000 put /etc/hosts s3://zenkontainer/testput
342
+ upload: ' /etc/hosts' -> ' s3://zenkontainer/testput' [1 of 1]
343
+ 330 of 330 100% in 0s 380.87 B/s done
344
+ # List locally to check you have the metadata
345
+ $> s3cmd --host=127.0.0.1:8000 ls s3://zenkobucket
346
+ 2017-10-24 14:38 330 s3://zenkontainer/testput
347
+
348
+ Then, from the MS Azure Console, if you go into your container, you should see
349
+ your newly uploaded object:
350
+
351
+ .. figure :: ../res/azure-console-successful-put.png
352
+ :alt: MS Azure Console upload example
353
+
354
+ Troubleshooting
355
+ ~~~~~~~~~~~~~~~
356
+
357
+ Make sure your :code: `~/.s3cfg ` file has credentials matching your local
358
+ CloudServer credentials defined in :code: `conf/authdata.json `. By default, the
359
+ access key is :code: `accessKey1 ` and the secret key is :code: `verySecretKey1 `.
360
+ For more informations, refer to our template `~/.s3cfg <./CLIENTS/#s3cmd >`__ .
361
+
362
+ Pre-existing objects in your MS Azure container can unfortunately not be
363
+ accessed by CloudServer at this time.
364
+
211
365
For any data backend
212
366
--------------------
213
367
@@ -230,7 +384,7 @@ endpoint :code:`zenkotos3.com`:
230
384
.. code :: json
231
385
232
386
(...)
233
- "restEndpoints" : {
387
+ "restEndpoints" : {
234
388
"localhost" : " us-east-1" ,
235
389
"127.0.0.1" : " us-east-1" ,
236
390
"cloudserver-front" : " us-east-1" ,
0 commit comments