18785: update defaults and comments in local.params files.
[arvados.git] / doc / install / salt-single-host.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Single host Arvados
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 # "Limitations of the single host install":#limitations
13 # "Prerequisites":#prerequisites
14 # "Single host install using the provision.sh script":#single_host
15 # "Choose the desired configuration":#choose_configuration
16 ## "Single host / single hostname":#single_host_single_hostname
17 ## "Single host / multiple hostnames (Alternative configuration)":#single_host_multiple_hostnames
18 # "Choose the SSL configuration (SSL_MODE)":#certificates
19 ## "Using self-signed certificates":#self-signed
20 ## "Using Let's Encrypt certificates":#lets-encrypt
21 ## "Using your own certificates":#bring-your-own
22 # "Further customization of the installation (modifying the salt pillars and states)":#further_customization
23 # "Run the provision.sh script":#run_provision_script
24 # "Final configuration steps":#final_steps
25 ## "Install the CA root certificate (required in both alternatives)":#ca_root_certificate
26 ## "DNS configuration (single host / multiple hostnames)":#single_host_multiple_hostnames_dns_configuration
27 # "Initial user and login":#initial_user
28 # "Test the installed cluster running a simple workflow":#test_install
29 # "After the installation":#post_install
30
31 h2(#limitations). Limitations of the single host install
32
33 <b>NOTE: The single host installation is a good choice for evaluating Arvados, but it is not recommended for production use.</b>
34
35 Using the default configuration, this installation method has a number of limitations:
36
37 * all services run on the same machine, and they will compete for resources. This includes any compute jobs.
38 * it uses the local machine disk for Keep storage (under the @/tmp@ directory). There may not be a lot of space available.
39 * it installs the @crunch-dispatch-local@ dispatcher, which can run just eight concurrent CWL jobs. These jobs will be executed on the same machine that runs all the Arvados services and may well starve them of resources.
40
41 It is possible to start with the single host installation method and modify the Arvados configuration file later to address these limitations. E.g. switch to a "different storage volume setup":{{site.baseurl}}/install/configure-s3-object-storage.html for Keep, and switch to "the cloud dispatcher":{{site.baseurl}}/install/crunch2-cloud/install-dispatch-cloud.html to provision compute resources dynamically.
42
43 h2(#prerequisites). Prerequisites and planning
44
45 Prerequisites:
46
47 * git
48 * a dedicated (virtual) machine for your Arvados server with at least 2 cores and 8 GiB of RAM, running a "supported Arvados distribution":{{site.baseurl}}/install/install-manual-prerequisites.html#supportedlinux
49 * at least one DNS hostname that resolves to the IP address of your Arvados server
50 * ports 443, 8800-8805 need to be reachable from your client (configurable, see below)
51 * port 80 needs to be reachable from everywhere on the internet (only when using "Let's Encrypt":#lets-encrypt)
52 * one or more SSL certificates matching the hostname(s) in use (only when using "bring your own certificate(s)":#bring-your-own)
53
54 h2(#single_host). Single host install using the provision.sh script
55
56 {% include 'branchname' %}
57
58 This procedure will install all the main Arvados components to get you up and running in a single host.
59
60 This is a package-based installation method, however the installation script is currently distributed in source form via @git@:
61
62 <notextile>
63 <pre><code>git clone https://git.arvados.org/arvados.git
64 git checkout {{ branchname }}
65 cd arvados/tools/salt-install
66 </code></pre>
67 </notextile>
68
69 The @provision.sh@ script will help you deploy Arvados by preparing your environment to be able to run the installer, then running it. The actual installer is located in the "arvados-formula git repository":https://git.arvados.org/arvados-formula.git/tree/refs/heads/{{ branchname }} and will be cloned during the running of the @provision.sh@ script.  The installer is built using "Saltstack":https://saltproject.io/ and @provision.sh@ performs the install using master-less mode.
70
71 After setting up a few variables in a config file (next step), you'll be ready to run it and get Arvados deployed.
72
73 h2(#choose_configuration). Choose the desired configuration
74
75 Arvados' single host installation can be done in two ways:
76
77 * Using a single hostname, assigning <i>a different port (other than 443) for each user-facing service</i>: This choice is easier to setup, but the user will need to know the port/s for the different services she wants to connect to.
78 * Using multiple hostnames on the same IP: this setup involves a few extra steps but each service will have a meaningful hostname so it will make easier to access them later.
79
80 Once you decide which of these choices you prefer, copy one the two example configuration files and directory, and edit them to suit your needs.
81
82 h3(#single_host_single_hostname). Single host / single hostname
83 <notextile>
84 <pre><code>cp local.params.example.single_host_single_hostname local.params
85 cp -r config_examples/single_host/single_hostname local_config_dir
86 </code></pre>
87 </notextile>
88
89 Edit the variables in the <i>local.params</i> file. Pay attention to the <b>*_PORT, *_TOKEN</b> and <b>*KEY</b> variables.
90
91 h3(#single_host_multiple_hostnames). Single host / multiple hostnames (Alternative configuration)
92 <notextile>
93 <pre><code>cp local.params.example.single_host_multiple_hostnames local.params
94 cp -r config_examples/single_host/multiple_hostnames local_config_dir
95 </code></pre>
96 </notextile>
97
98 Edit the variables in the <i>local.params</i> file.
99
100 h2(#certificates). Choose the SSL configuration (SSL_MODE)
101
102 Arvados requires SSL certificates to work correctly. This installer supports these options:
103
104 * @self-signed@: let the installer create self-signed certificate(s)
105 * @lets-encrypt@: automatically obtain and install SSL certificates for your hostname(s)
106 * @bring-your-own@: supply your own certificate(s) in the `certs` directory
107
108 h3(#self-signed). Using self-signed certificates
109
110 In the default configuration, this installer uses self-signed certificate(s):
111
112 <notextile>
113 <pre><code>SSL_MODE="self-signed"
114 </code></pre>
115 </notextile>
116
117 When connecting to the Arvados web interface for the first time, you will need to accept the self-signed certificate as trusted to bypass the browser warnings.
118
119 h3(#lets-encrypt). Using Let's Encrypt certificates
120
121 To automatically get (a) valid certificate(s) via Let's Encrypt, change the configuration like this:
122
123 <notextile>
124 <pre><code>SSL_MODE="lets-encrypt"
125 </code></pre>
126 </notextile>
127
128 It is important that the DNS hostnames defined in the configuration resolve to the Arvados instance(s), so that Let's Encrypt can validate the domainname ownership and issue the certificate(s).
129
130 When using AWS, EC2 instances can have a default hostname that ends with `amazonaws.com`. Let's Encrypt has a blacklist of domain names for which it will not issue certificates, and that blacklist includes the `amazonaws.com` domain, which means the default hostname can not be used to get a certificate from Let's Encrypt.
131
132 For a @single hostname@ setup, the hostname must be defined in @HOSTNAME_EXT@ and resolve to the IP address of your Arvados instance.
133
134 For a @multiple hostnames@ setup, the hostnames are created by combining the values of @CLUSTER@ and @DOMAIN@ from the configuration with a prefix. These hostnames must resolve to the IP address of your Arvados instance:
135
136 * @CLUSTER@.@DOMAIN@
137 * ws.@CLUSTER@.@DOMAIN@
138 * workbench.@CLUSTER@.@DOMAIN@
139 * workbench2.@CLUSTER@.@DOMAIN@
140 * webshell.@CLUSTER@.@DOMAIN@
141 * download.@CLUSTER@.@DOMAIN@
142 * collections.@CLUSTER@.@DOMAIN@
143 * keep.@CLUSTER@.@DOMAIN@
144
145 h3(#bring-your-own). Using your own certificates
146
147 To supply your own certificates, change the configuration like this:
148
149 <notextile>
150 <pre><code>SSL_MODE="bring-your-own"
151 CUSTOM_CERTS_DIR="${SCRIPT_DIR}/certs"
152 </code></pre>
153 </notextile>
154
155 {% include 'install_custom_certificates' %}
156
157 h3(#further_customization). Further customization of the installation (modifying the salt pillars and states)
158
159 If you want or need further customization, you can edit the Saltstack pillars and states files. Pay particular attention to the <i>pillars/arvados.sls</i> one. Any extra <i>state</i> file you add under <i>local_config_dir/states</i> will be added to the salt run and applied to the host.
160
161 h2(#run_provision_script). Run the provision.sh script
162
163 When you finished customizing the configuration, you are ready to copy the files to the host (if needed) and run the @provision.sh@ script:
164
165 <notextile>
166 <pre><code>scp -r provision.sh local* tests user@host:
167 # if you are using bring-your-own certificates, make sure to copy those too:
168 # scp -r certs user@host:
169 ssh user@host sudo ./provision.sh
170 </code></pre>
171 </notextile>
172
173 or, if you saved the @local.params@ in another directory or with some other name
174
175 <notextile>
176 <pre><code>scp -r provision.sh local* tests user@host:
177 ssh user@host sudo ./provision.sh -c /path/to/your/local.params.file
178 </code></pre>
179 </notextile>
180
181 and wait for it to finish. The script will need 5 to 10 minutes to install and configure everything.
182
183 If everything goes OK, you'll get some final lines stating something like:
184
185 <notextile>
186 <pre><code>arvados: Succeeded: 109 (changed=9)
187 arvados: Failed:      0
188 </code></pre>
189 </notextile>
190
191 h2(#final_steps). Final configuration steps
192
193 Once the deployment went OK, you'll need to perform a few extra steps in your local browser/host to access the cluster.
194
195 h3(#ca_root_certificate). Install the CA root certificate (SSL_MODE=self-signed only)
196
197 Arvados uses SSL to encrypt communications. Its UI uses AJAX which will silently fail if the certificate is not valid or signed by an unknown Certification Authority.
198
199 For this reason, the @arvados-formula@ has a helper state to create a root certificate to authorize Arvados services. The @provision.sh@ script will leave a copy of the generated CA's certificate (@arvados-snakeoil-ca.pem@) in the script's directory so you can add it to your workstation.
200
201 Installing the root certificate into your web browser will prevent security errors when accessing Arvados services with your web browser.
202
203 # Go to the certificate manager in your browser.
204 #* In Chrome, this can be found under "Settings &rarr; Advanced &rarr; Manage Certificates" or by entering @chrome://settings/certificates@ in the URL bar.
205 #* In Firefox, this can be found under "Preferences &rarr; Privacy & Security" or entering @about:preferences#privacy@ in the URL bar and then choosing "View Certificates...".
206 # Select the "Authorities" tab, then press the "Import" button.  Choose @arvados-snakeoil-ca.pem@
207
208 The certificate will be added under the "Arvados Formula".
209
210 To access your Arvados instance using command line clients (such as arv-get and arv-put) without security errors, install the certificate into the OS certificate storage.
211
212 * On Debian/Ubuntu:
213
214 <notextile>
215 <pre><code>cp arvados-root-cert.pem /usr/local/share/ca-certificates/
216 /usr/sbin/update-ca-certificates
217 </code></pre>
218 </notextile>
219
220 * On CentOS:
221
222 <notextile>
223 <pre><code>cp arvados-root-cert.pem /etc/pki/ca-trust/source/anchors/
224 /usr/bin/update-ca-trust
225 </code></pre>
226 </notextile>
227
228 h3(#single_host_multiple_hostnames_dns_configuration). Local DNS configuration (multiple hostnames only)
229
230 When using multiple hostnames, you need to set up your DNS to be able to access the cluster.
231
232 If you don't have access to the domain's DNS to add the required entries, the simplest way to do it is to edit your @/etc/hosts@ file (as root). Change @CLUSTER@, @DOMAIN@ and @HOST_IP@ to your local values:
233
234 <notextile>
235 <pre><code>export CLUSTER="arva2"
236 export DOMAIN="arv.local"
237 export HOST_IP="127.0.0.2"    # This is valid either if installing in your computer directly
238                               # or in a Vagrant VM. If you're installing it on a remote host
239                               # just change the IP to match that of the host.
240 echo "${HOST_IP} api keep keep0 collections download ws workbench workbench2 ${CLUSTER}.${DOMAIN} api.${CLUSTER}.${DOMAIN} keep.${CLUSTER}.${DOMAIN} keep0.${CLUSTER}.${DOMAIN} collections.${CLUSTER}.${DOMAIN} download.${CLUSTER}.${DOMAIN} ws.${CLUSTER}.${DOMAIN} workbench.${CLUSTER}.${DOMAIN} workbench2.${CLUSTER}.${DOMAIN}" >> /etc/hosts
241 </code></pre>
242 </notextile>
243
244 h2(#initial_user). Initial user and login
245
246 At this point you should be able to log on to your new Arvados cluster.
247
248 For a @single hostname@ setup, the workbench URL will be
249
250 * https://@HOSTNAME_EXT@
251
252 For a @multiple hostnames@ setup, the workbench URL will be
253
254 * https://workbench.@CLUSTER@.@DOMAIN@
255
256 By default, the provision script creates an initial user for testing purposes. This user is configured as administrator of the newly created cluster. The username, password and e-mail address for the initial user are configured in the @local.params@ file.
257
258 h2(#test_install). Test the installed cluster running a simple workflow
259
260 The @provision.sh@ script saves a simple example test workflow in the @/tmp/cluster_tests@ directory in the node. If you want to run it, just ssh to the node, change to that directory and run:
261
262 <notextile>
263 <pre><code>cd /tmp/cluster_tests
264 sudo ./run-test.sh
265 </code></pre>
266 </notextile>
267
268 It will create a test user (by default, the same one as the admin user), upload a small workflow and run it. If everything goes OK, the output should similar to this (some output was shortened for clarity):
269
270 <notextile>
271 <pre><code>Creating Arvados Standard Docker Images project
272 Arvados project uuid is 'arva2-j7d0g-0prd8cjlk6kfl7y'
273 {
274  ...
275  "uuid":"arva2-o0j2j-n4zu4cak5iifq2a",
276  "owner_uuid":"arva2-tpzed-000000000000000",
277  ...
278 }
279 Uploading arvados/jobs' docker image to the project
280 2.1.1: Pulling from arvados/jobs
281 8559a31e96f4: Pulling fs layer
282 ...
283 Status: Downloaded newer image for arvados/jobs:2.1.1
284 docker.io/arvados/jobs:2.1.1
285 2020-11-23 21:43:39 arvados.arv_put[32678] INFO: Creating new cache file at /home/vagrant/.cache/arvados/arv-put/c59256eda1829281424c80f588c7cc4d
286 2020-11-23 21:43:46 arvados.arv_put[32678] INFO: Collection saved as 'Docker image arvados jobs:2.1.1 sha256:0dd50'
287 arva2-4zz18-1u5pvbld7cvxuy2
288 Creating initial user ('admin')
289 Setting up user ('admin')
290 {
291  "items":[
292   {
293    ...
294    "owner_uuid":"arva2-tpzed-000000000000000",
295    ...
296    "uuid":"arva2-o0j2j-1ownrdne0ok9iox"
297   },
298   {
299    ...
300    "owner_uuid":"arva2-tpzed-000000000000000",
301    ...
302    "uuid":"arva2-o0j2j-1zbeyhcwxc1tvb7"
303   },
304   {
305    ...
306    "email":"admin@arva2.arv.local",
307    ...
308    "owner_uuid":"arva2-tpzed-000000000000000",
309    ...
310    "username":"admin",
311    "uuid":"arva2-tpzed-3wrm93zmzpshrq2",
312    ...
313   }
314  ],
315  "kind":"arvados#HashList"
316 }
317 Activating user 'admin'
318 {
319  ...
320  "email":"admin@arva2.arv.local",
321  ...
322  "username":"admin",
323  "uuid":"arva2-tpzed-3wrm93zmzpshrq2",
324  ...
325 }
326 Running test CWL workflow
327 INFO /usr/bin/cwl-runner 2.1.1, arvados-python-client 2.1.1, cwltool 3.0.20200807132242
328 INFO Resolved 'hasher-workflow.cwl' to 'file:///tmp/cluster_tests/hasher-workflow.cwl'
329 ...
330 INFO Using cluster arva2 (https://arva2.arv.local:8443/)
331 INFO Upload local files: "test.txt"
332 INFO Uploaded to ea34d971b71d5536b4f6b7d6c69dc7f6+50 (arva2-4zz18-c8uvwqdry4r8jao)
333 INFO Using collection cache size 256 MiB
334 INFO [container hasher-workflow.cwl] submitted container_request arva2-xvhdp-v1bkywd58gyocwm
335 INFO [container hasher-workflow.cwl] arva2-xvhdp-v1bkywd58gyocwm is Final
336 INFO Overall process status is success
337 INFO Final output collection d6c69a88147dde9d52a418d50ef788df+123
338 {
339     "hasher_out": {
340         "basename": "hasher3.md5sum.txt",
341         "class": "File",
342         "location": "keep:d6c69a88147dde9d52a418d50ef788df+123/hasher3.md5sum.txt",
343         "size": 95
344     }
345 }
346 INFO Final process status is success
347 </code></pre>
348 </notextile>
349
350 h2(#post_install). After the installation
351
352 Once the installation is complete, it is recommended to keep a copy of your local configuration files. Committing them to version control is a good idea.
353
354 Re-running the Salt-based installer is not recommended for maintaining and upgrading Arvados, please see "Maintenance and upgrading":{{site.baseurl}}/admin/maintenance-and-upgrading.html for more information.