Merge branch '21644-flaky-test'
[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 and planning":#prerequisites
14 # "Download the installer":#download
15 # "Edit local.params* files":#localparams
16 # "Choose the SSL configuration":#certificates
17 ## "Using a self-signed certificate":#self-signed
18 ## "Using a Let's Encrypt certificate":#lets-encrypt
19 ## "Bring your own certificate":#bring-your-own
20 # "Configure your authentication provider":#authentication
21 # "Further customization of the installation":#further_customization
22 # "Begin installation":#installation
23 # "Install the CA root certificate":#ca_root_certificate
24 # "Confirm the cluster is working":#test-install
25 # "Initial user and login":#initial_user
26 # "After the installation":#post_install
27
28 h2(#limitations). Limitations of the single host install
29
30 *NOTE: The single host installation is a good choice for evaluating Arvados, but it is not recommended for production use.*
31
32 Using the default configuration, the single host install has scaling limitations compared to a production multi-host install:
33
34 * It uses the local disk for Keep storage (under the @/var/lib/arvados@ directory).
35 * It uses the @crunch-dispatch-local@ dispatcher, which has a limit of eight concurrent jobs.
36 * Because jobs and Arvados services all run on the same machine, they will compete for CPU/RAM resources.
37
38 h2(#prerequisites). Prerequisites and planning
39
40 h3. Cluster ID and base domain
41
42 Choose a 5-character cluster identifier that will represent the cluster.  Here are "guidelines on choosing a cluster identifier":../architecture/federation.html#cluster_id .  Only lowercase letters and digits 0-9 are allowed.  Examples will use @xarv1@ or @${CLUSTER}@, you should substitute the cluster id you have selected.
43
44 Determine if you will use a single hostname, or multiple hostnames.
45
46 * Single hostname is simpler to set up and can even be used without a hostname at all, just a bare IP address.
47 * Multiple hostnames is more similar to the recommended production configuration may make it easier to migrate to a multi-host production configuration in the future, but is more complicated as it requires adding a number of DNS entries.
48
49 If you are using multiple hostnames, determine the base domain for the cluster.  This will be referred to as @${DOMAIN}@.
50
51 For example, if CLUSTER is @xarv1@ and DOMAIN is @example.com@, then @controller.${CLUSTER}.${DOMAIN}@ means @controller.xarv1.example.com@.
52
53 h3. Machine specification
54
55 You will need a dedicated (virtual) machine for your Arvados server with at least 2 cores and 8 GiB of RAM (4+ cores / 16+ GiB recommended if you are running workflows) running a supported Linux distribution:
56
57 {% include 'supportedlinux' %}
58
59 Note: if you want to try out Arvados inside a Docker container, use "Arvbox":arvbox.html.  The package-based install method uses @systemd@ to manage services; lightweight container images generally lack an init system and other tools that the installer requires.
60
61 The single host install stores user data in a PostgreSQL database (usually found under @/var/lib/postgresql@) and as Keep blocks that are stored as files under @/var/lib/arvados/@.
62 Arvados logs are also kept in @/var/log@ and @/var/www/arvados-api/shared/log@.  Accordingly, you should ensure that the disk partition containing @/var@ has adequate storage for your planned usage.  We suggest starting with at least 50GiB of free space.
63
64 h3(#DNS). DNS hostnames for each service (multi-hostname only)
65
66 If you are using a single hostname for all services (they will be distingushed by listening port), you can skip this section.
67
68 If you are using the multi-hostname configuration, you will need a DNS entry for each service.  If you are using "bring-your-own" TLS certificates, your certificate will need to include all of these hostnames.
69
70 In the default configuration these are:
71
72 # @controller.${CLUSTER}.${DOMAIN}@
73 # @ws.${CLUSTER}.${DOMAIN}@
74 # @keep0.${CLUSTER}.${DOMAIN}@
75 # @keep1.${CLUSTER}.${DOMAIN}@
76 # @keep.${CLUSTER}.${DOMAIN}@
77 # @download.${CLUSTER}.${DOMAIN}@
78 # @*.collections.${CLUSTER}.${DOMAIN}@  -- important note, this must be a wildcard DNS, resolving to the @keepweb@ service
79 # @workbench.${CLUSTER}.${DOMAIN}@
80 # @workbench2.${CLUSTER}.${DOMAIN}@
81 # @webshell.${CLUSTER}.${DOMAIN}@
82 # @shell.${CLUSTER}.${DOMAIN}@
83 # @prometheus.${CLUSTER}.${DOMAIN}@
84 # @grafana.${CLUSTER}.${DOMAIN}@
85
86 This is described in more detail in "DNS entries and TLS certificates":install-manual-prerequisites.html#dnstls.
87
88 h3. Additional prerequisites
89
90 # root or passwordless @sudo@ access on the account where you are doing the install
91 this usually means adding the account to the @sudo@ group and having a rule like this in @/etc/sudoers.d/arvados_passwordless@ that allows members of group @sudo@ to execute any command without entering a password.
92 <pre>%sudo ALL=(ALL:ALL) NOPASSWD:ALL</pre>
93 # @git@ installed on the machine
94 # Port 443 reachable by clients
95 # For the single-host install, ports 8800-8805 also need to be reachable from your client (configurable in @local.params@, see below)
96 # When using "Let's Encrypt":#lets-encrypt port 80 needs to be reachable from everywhere on the internet
97 # When using "bring your own certificate":#bring-your-own you need TLS certificate(s) covering the hostname(s) used by Arvados
98
99 h2(#download). Download the installer
100
101 {% assign local_params_src = 'single_host_single_hostname' %}
102 {% assign config_examples_src = 'single_host/single_hostname' %}
103 {% include 'download_installer' %}
104
105 If you are using multiple hostname configuration, substitute 'multiple_hostnames' where it says 'single_hostname' in the command above.
106
107 h2(#localparams). Edit @local.params*@ files
108
109 The cluster configuration parameters are included in two files: @local.params@ and @local.params.secrets@. These files can be found wherever you choose to initialize the installation files (e.g., @~/setup-arvados-xarv1@ in these examples).
110
111 The @local.params.secrets@ file is intended to store security-sensitive data such as passwords, private keys, tokens, etc. Depending on the security requirements of the cluster deployment, you may wish to store this file in a secrets store like AWS Secrets Manager or Jenkins credentials.
112
113 h3. Parameters from @local.params@:
114
115 # Set @CLUSTER@ to the 5-character cluster identifier (e.g "xarv1")
116 # Set @DOMAIN@ to the base DNS domain of the environment, e.g. "example.com"
117 # Single hostname only: set @IP_INT@ to the host's IP address.
118 # Single hostname only: set @HOSTNAME_EXT@ to the hostname that users will use to connect.
119 # Set @INITIAL_USER_EMAIL@ to your email address, as you will be the first admin user of the system.
120
121 h3. Parameters from @local.params.secrets@:
122
123 # Set each @KEY@ / @TOKEN@ to a random string
124         Here's an easy way to create five random tokens:
125 <pre><code>for i in 1 2 3 4 5; do
126   tr -dc A-Za-z0-9 </dev/urandom | head -c 32 ; echo ''
127 done
128 </code></pre>
129 # Set @DATABASE_PASSWORD@ to a random string
130    Important! If this contains any non-alphanumeric characters, in particular ampersand ('&'), it is necessary to add backslash quoting.
131    For example, if the password is @Lq&MZ<V']d?j@
132    With backslash quoting the special characters it should appear like this in local.params:
133 <pre><code>DATABASE_PASSWORD="Lq\&MZ\<V\'\]d\?j"</code></pre>
134 # Set @DISPATCHER_SSH_PRIVKEY@ to @"no"@, as it isn't needed.
135 {% include 'ssl_config_single' %}
136
137 h2(#authentication). Configure your authentication provider (optional, recommended)
138
139 By default, the installer will use the "Test" provider, which is a list of usernames and cleartext passwords stored in the Arvados config file.  *This is low security configuration and you are strongly advised to configure one of the other "supported authentication methods":setup-login.html* .
140
141 h2(#further_customization). Further customization of the installation (optional)
142
143 If you want to customize the behavior of Arvados, this may require editing the Saltstack pillars and states files found in @local_config_dir@.  In particular, @local_config_dir/pillars/arvados.sls@ contains the template (in the @arvados.cluster@ section) used to produce the Arvados configuration file.  Consult the "Configuration reference":config.html for a comprehensive list of configuration keys.
144
145 Any extra Salt "state" files you add under @local_config_dir/states@ will be added to the Salt run and applied to the hosts.
146
147 h2(#installation). Begin installation
148
149 At this point, you are ready to run the installer script in deploy mode that will conduct all of the Arvados installation.
150
151 Run this in the @~/arvados-setup-xarv1@ directory:
152
153 <pre>
154 ./installer.sh deploy
155 </pre>
156
157 h2(#ca_root_certificate). Install the CA root certificate (SSL_MODE=self-signed only)
158
159 *If you are not using self-signed certificates (you selected SSL_MODE=lets-encrypt or SSL_MODE=bring-your-own), skip this section.*
160
161 Arvados uses SSL to encrypt communications. The web interface uses AJAX which will silently fail if the certificate is not valid or signed by an unknown Certification Authority.
162
163 For this reason, the installer has the option to create its own a root certificate to authorize Arvados services. The installer script will leave a copy of the generated CA's certificate  (something like @xarv1.example.com-arvados-snakeoil-ca.crt@) in the script's directory so you can add it to your workstation.
164
165 {% assign ca_cert_name = 'xarv1.example.com-arvados-snakeoil-ca.crt' %}
166
167 {% include 'install_ca_cert' %}
168
169 h2(#test-install). Confirm the cluster is working
170
171 When everything has finished, you can run the diagnostics.  This requires the `arvados-client` package:
172
173 <pre>
174 apt-get install arvados-client
175 </pre>
176
177 Depending on where you are running the installer, you need to provide @-internal-client@ or @-external-client@.
178
179 If you are running the diagnostics on the same machine where you installed Arvados, you want @-internal-client@ .
180
181 You are an "external client" if you running the diagnostics from your workstation outside of the private network.
182
183 <pre>
184 ./installer.sh diagnostics (-internal-client|-external-client)
185 </pre>
186
187 h3(#debugging). Debugging issues
188
189 The installer records log files for each deployment.
190
191 Most service logs go to @/var/log/syslog@.
192
193 The logs for Rails API server can be found in @/var/www/arvados-api/current/log/production.log@ on the appropriate instance.
194
195 Workbench 2 is a client-side Javascript application.  If you are having trouble loading Workbench 2, check the browser's developer console (this can be found in "Tools &rarr; Developer Tools").
196
197 h3(#iterating). Iterating on config changes
198
199 You can iterate on the config and maintain the cluster by making changes to @local.params@ and @local_config_dir@ and running @installer.sh deploy@ again.
200
201 h3(#common-problems). Common problems and solutions
202
203 h4. PG::UndefinedTable: ERROR:  relation \"api_clients\" does not exist
204
205 The arvados-api-server package sets up the database as a post-install script.  If the database host or password wasn't set correctly (or quoted correctly) at the time that package is installed, it won't be able to set up the database.
206
207 This will manifest as an error like this:
208
209 <pre>
210 #<ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation \"api_clients\" does not exist
211 </pre>
212
213 If this happens, you need to
214
215 # correct the database information
216 # run @./installer.sh deploy@ to update the configuration
217 # Log in to the server, then run this command to re-run the post-install script, which will set up the database:
218 <pre>dpkg-reconfigure arvados-api-server</pre>
219 # Re-run @./installer.sh deploy@ again to synchronize everything, and so that the install steps that need to contact the API server are run successfully.
220
221 h2(#initial_user). Initial user and login
222
223 At this point you should be able to log into the Arvados cluster. The initial URL for the single hostname install will use the hostname or IP address you put in @HOSTNAME_EXT@:
224
225 https://${HOSTNAME_EXT}
226
227 For the multi-hostname install, it will be:
228
229 https://workbench.@${CLUSTER}.${DOMAIN}@
230
231 If you did *not* "configure a different authentication provider":#authentication you will be using the "Test" provider, and the provision script creates an initial user for testing purposes. This user is configured as administrator of the newly created cluster.  It uses the values of @INITIAL_USER@ and @INITIAL_USER_PASSWORD@ the @local.params@ file.
232
233 If you *did* configure a different authentication provider, the first user to log in will automatically be given Arvados admin privileges.
234
235 h2(#monitoring). Monitoring and Metrics
236
237 You can monitor the health and performance of the system using the admin dashboard.
238
239 For the multi-hostname install, it will be:
240
241 https://grafana.@${CLUSTER}.${DOMAIN}@
242
243 To log in, use username "admin" and @${INITIAL_USER_PASSWORD}@ from @local.conf@.
244
245 Once logged in, you will want to add the dashboards to the front page.
246
247 # On the left icon bar, click on "Browse"
248 # If the check box next to "Starred" is selected, click on it to de-select it
249 # You should see a folder with "Arvados cluster overview", "Node exporter" and "Postgres exporter"
250 # You can visit each dashboard and click on the star next to the title to "Mark as favorite"
251 # They should now be linked on the front page.
252
253 h2(#post_install). After the installation
254
255 As part of the operation of @installer.sh@, it automatically creates a @git@ repository with your configuration templates.  You should retain this repository but be aware that it contains sensitive information (passwords and tokens used by the Arvados services).
256
257 As described in "Iterating on config changes":#iterating you may use @installer.sh deploy@ to re-run the Salt to deploy configuration changes and upgrades.  However, be aware that the configuration templates created for you by @installer.sh@ are a snapshot which are not automatically kept up to date.
258
259 When deploying upgrades, consult the "Arvados upgrade notes":{{site.baseurl}}/admin/upgrading.html to see if changes need to be made to the configuration file template in @local_config_dir/pillars/arvados.sls@.  To specify the version to upgrade to, set the @VERSION@ parameter in @local.params@.
260
261 See also "Maintenance and upgrading":{{site.baseurl}}/admin/maintenance-and-upgrading.html for more information.