Merge branch '8784-dir-listings'
[arvados.git] / doc / install / configure-azure-blob-storage.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Configure Azure Blob storage
5 ...
6 {% comment %}
7 Copyright (C) The Arvados Authors. All rights reserved.
8
9 SPDX-License-Identifier: CC-BY-SA-3.0
10 {% endcomment %}
11
12 As an alternative to local and network-attached POSIX filesystems, Keepstore can store data in an Azure Storage container.
13
14 h2. Create a container
15
16 Normally, all keepstore services are configured to share a single Azure Storage container.
17
18 Using the Azure web portal or command line tool, create or choose a storage account with a suitable redundancy profile and availability region. Use the storage account keys to create a new container.
19
20 <notextile>
21 <pre><code>~$ <span class="userinput">azure config mode arm</span>
22 ~$ <span class="userinput">azure login</span>
23 ~$ <span class="userinput">azure group create exampleGroupName eastus</span>
24 ~$ <span class="userinput">azure storage account create --type LRS --location eastus --resource-group exampleGroupName exampleStorageAccountName</span>
25 ~$ <span class="userinput">azure storage account keys list --resource-group exampleGroupName exampleStorageAccountName</span>
26 info:    Executing command storage account keys list
27 + Getting storage account keys
28 data:    Primary: zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz==
29 data:    Secondary: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy==
30 info:    storage account keys list command OK
31 ~$ <span class="userinput">AZURE_STORAGE_ACCOUNT="exampleStorageAccountName" \
32 AZURE_STORAGE_ACCESS_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz==" \
33 azure storage container create exampleContainerName</span>
34 </code></pre>
35 </notextile>
36
37 h2. Configure keepstore
38
39 Copy the primary storage account key to a file where it will be accessible to keepstore at startup time.
40
41 <notextile>
42 <pre><code>~$ <span class="userinput">sudo sh -c 'cat &gt;/etc/sv/keepstore/exampleStorageAccountName.key &lt;&lt;EOF'
43 zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz==
44 EOF</span>
45 ~$ <span class="userinput">sudo chmod 0400 /etc/sv/keepstore/exampleStorageAccountName.key</span>
46 </code></pre>
47 </notextile>
48
49 In your keepstore startup script, instead of specifying a local storage using @-volume /path@ or discovering mount points automatically, use @-azure-*@ arguments to specify the storage container:
50
51 <notextile>
52 <pre><code>#!/bin/sh
53
54 exec 2&gt;&amp;1
55 exec keepstore \
56  -azure-storage-account-key-file <span class="userinput">/etc/sv/keepstore/exampleStorageAccountName.key</span> \
57  -azure-storage-account-name <span class="userinput">exampleStorageAccountName</span> \
58  -azure-storage-container-volume <span class="userinput">exampleContainerName</span>
59 </code></pre>
60 </notextile>
61
62 Start (or restart) keepstore, and check its log file to confirm it is using the new configuration.
63
64 <notextile>
65 <pre><code>2015/10/26 21:06:24 Using volume azure-storage-container:"exampleContainerName" (writable=true)
66 </code></pre>
67 </notextile>