21700: Install Bundler system-wide in Rails postinst
[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 Keepstore can store data in one or more Azure Storage containers.
13
14 h2. Set up VMs and Storage Accounts
15
16 Before starting the configuration of individual keepstore servers is good to have an idea of the keepstores servers' final layout. One key decision is the amount of servers and type of VM to run. Azure may change over time the bandwith capacity of each type. After conducting some empirical saturation tests, the conclusion was that the bandwith is proportional to the amount of cores with some exceptions. As a rule of thumb, is better to invest resources in more cores instead of memory or IOps.
17
18 Another decision is how many VMs should be running keepstore. For example there could be 8 VMs with one core each or one machine with 8 cores. Or anything in between. Assuming is the same cost for Cloud resources, there is always the benefit of distributing the risk of faulty VMs. The recommendation is to start with 2 VMs and expand in pairs. Having a minimum of 2 cores each. The total amount of VMs will be a function of the budget and the pipeline traffic to avoid saturation during periods of high usage. Standard D v3 family is a balanced choice, making Standard_D2_v3 the 2-core option
19
20 There are many options for storage accounts. You can read details from Azure on their documentation "https://docs.microsoft.com/en-us/azure/storage/common/storage-introduction":https://docs.microsoft.com/en-us/azure/storage/common/storage-introduction. The type of storage and access tier will be a function of the budget and desired responsiveness. A balanced option is to have General-purpose Standard Storage account and use Blob storage, hot access tiers.
21
22 Keepstore can be configure to reflect the level of underlaying redundancy the storage will have. This is call data replication option. For example LRS (Locally Redundant Storage) saves 3 copies of the data. There desired redundancy can be chosen at the keepstore layer or at the Storage Accunt layer. The decision where the redundancy will be done and the type of Storage Account data replication (LRS, ZRS, GRS and RA-GRS) has trade-offs. Please read more on "https://docs.microsoft.com/en-us/azure/storage/common/storage-redundancy":https://docs.microsoft.com/en-us/azure/storage/common/storage-redundancy and decide what is best for your needs.
23
24 h2. Create a storage container
25
26 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.
27
28 <notextile>
29 <pre><code>~$ <span class="userinput">azure config mode arm</span>
30 ~$ <span class="userinput">az login</span>
31 ~$ <span class="userinput">az group create exampleGroupName eastus2</span>
32 ~$ <span class="userinput">az storage account create --sku Standard_LRS --kind BlobStorage --encryption-services blob --access-tier Hot --https-only true --location eastus2 --resource-group exampleGroupName --name exampleStorageAccountName</span>
33 ~$ <span class="userinput">az storage account keys list --resource-group exampleGroupName --account-name exampleStorageAccountName
34 [
35   {
36     "keyName": "key1",
37     "permissions": "Full",
38     "value": "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz=="
39   },
40   {
41     "keyName": "key2",
42     "permissions": "Full",
43     "value": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy=="
44   }
45 ]</span>
46 ~$ <span class="userinput">AZURE_STORAGE_ACCOUNT="exampleStorageAccountName" \
47 AZURE_STORAGE_ACCESS_KEY="zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz==" \
48 azure storage container create --name exampleContainerName</span>
49 </code></pre>
50 </notextile>
51
52 Note that Keepstore services may be configured to use multiple Azure Storage accounts and multiple containers within a storage account.
53
54 h2. Configure keepstore
55
56 Volumes are configured in the @Volumes@ section of the cluster configuration file.
57
58 {% include 'assign_volume_uuid' %}
59
60 <notextile><pre><code>    Volumes:
61       <span class="userinput">ClusterID</span>-nyw5e-<span class="userinput">000000000000000</span>:
62         AccessViaHosts:
63           # This section determines which keepstore servers access the
64           # volume. In this example, keep0 has read/write access, and
65           # keep1 has read-only access.
66           #
67           # If the AccessViaHosts section is empty or omitted, all
68           # keepstore servers will have read/write access to the
69           # volume.
70           "http://<span class="userinput">keep0.ClusterID.example.com</span>:25107": {}
71           "http://<span class="userinput">keep1.ClusterID.example.com</span>:25107": {ReadOnly: true}
72
73         Driver: <span class="userinput">Azure</span>
74         DriverParameters:
75           # Storage account name and secret key, used for
76           # authentication.
77           StorageAccountName: <span class="userinput">exampleStorageAccountName</span>
78           StorageAccountKey: <span class="userinput">zzzzzzzzzzzzzzzzzzzzzzzzzz</span>
79
80           # Storage container name.
81           ContainerName: <span class="userinput">exampleContainerName</span>
82
83           # The cloud environment to use,
84           # e.g. "core.chinacloudapi.cn". Defaults to
85           # "core.windows.net" if blank or omitted.
86           StorageBaseURL: ""
87
88           # Time to wait for an upstream response before failing the
89           # request.
90           RequestTimeout: 10m
91
92           # Time to wait before retrying a failed "list blobs" Azure
93           # API call.
94           ListBlobsRetryDelay: 10s
95
96           # Maximum attempts at a "list blobs" Azure API call before
97           # giving up.
98           ListBlobsMaxAttempts: 12
99
100           # If non-zero, use multiple concurrent requests (each
101           # requesting MaxGetBytes bytes) when retrieving data. If
102           # zero or omitted, get the entire blob with one request.
103           #
104           # Normally this is zero but if you find that 4 small
105           # requests complete faster than a single large request, for
106           # example, you might set this to 16777216 (64 MiB รท 4).
107           MaxGetBytes: 0
108
109           # Time to wait for an unexpectedly empty blob to become
110           # non-empty. Azure's create-and-write operation is not
111           # atomic. The default value typically allows concurrent GET
112           # and PUT requests to succeed despite the race window.
113           WriteRaceInterval: 15s
114
115           # Time to wait between GET attempts while waiting for
116           # WriteRaceInterval to expire.
117           WriteRacePollTime: 1s
118
119         # How much replication is provided by the underlying storage
120         # container.  This is used to inform replication decisions at
121         # the Keep layer.
122         Replication: 3
123
124         # If true, do not accept write or trash operations, even if
125         # AccessViaHosts.*.ReadOnly is false.
126         #
127         # If false or omitted, enable write access (subject to
128         # AccessViaHosts.*.ReadOnly, where applicable).
129         ReadOnly: false
130
131         # Storage classes to associate with this volume.  See "Storage
132         # classes" in the "Admin" section of doc.arvados.org.
133         StorageClasses: null
134 </code></pre></notextile>