20610: Documentation fixes & additions.
[arvados.git] / doc / install / salt-multi-host.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Multi-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 # "Introduction":#introduction
13 # "Prerequisites and planning":#prerequisites
14 # "Download the installer":#download
15 # "Initialize the installer":#copy_config
16 # "Set up your infrastructure":#setup-infra
17 ## "Create AWS infrastructure with Terraform":#terraform
18 ## "Create required infrastructure manually":#inframanual
19 # "Edit local.params* files":#localparams
20 # "Configure Keep storage":#keep
21 # "Choose the SSL configuration":#certificates
22 ## "Using a Let's Encrypt certificates":#lets-encrypt
23 ## "Bring your own certificates":#bring-your-own
24 # "Create a compute image":#create_a_compute_image
25 # "Begin installation":#installation
26 # "Further customization of the installation":#further_customization
27 # "Confirm the cluster is working":#test-install
28 ## "Debugging issues":#debugging
29 ## "Iterating on config changes":#iterating
30 ## "Common problems and solutions":#common-problems
31 # "Initial user and login":#initial_user
32 # "Monitoring and Metrics":#monitoring
33 # "Load balancing controllers":#load_balancing
34 ## "Rolling upgrades procedure":#rolling-upgrades
35 # "After the installation":#post_install
36
37 h2(#introduction). Introduction
38
39 This multi host installer is the recommendend way to set up a production Arvados cluster.  These instructions include specific details for installing on Amazon Web Services (AWS), which are marked as "AWS specific".  However with additional customization the installer can be used as a template for deployment on other cloud provider or HPC systems.
40
41 h2(#prerequisites). Prerequisites and planning
42
43 h3. Cluster ID and base domain
44
45 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.
46
47 Determine the base domain for the cluster.  This will be referred to as @${DOMAIN}@.
48
49 For example, if DOMAIN is @xarv1.example.com@, then @controller.${DOMAIN}@ means @controller.xarv1.example.com@.
50
51 h3(#DNS). DNS hostnames for each service
52
53 You will need a DNS entry for each service.  When using the "Terraform script":#terraform to set up your infrastructure, these domains will be created automatically using AWS Route 53.
54
55 In the default configuration these are:
56
57 # @controller.${DOMAIN}@
58 # @ws.${DOMAIN}@
59 # @keep0.${DOMAIN}@
60 # @keep1.${DOMAIN}@
61 # @keep.${DOMAIN}@
62 # @download.${DOMAIN}@
63 # @*.collections.${DOMAIN}@  -- important note, this must be a wildcard DNS, resolving to the @keepweb@ service
64 # @workbench.${DOMAIN}@
65 # @workbench2.${DOMAIN}@
66 # @webshell.${DOMAIN}@
67 # @shell.${DOMAIN}@
68 # @prometheus.${DOMAIN}@
69 # @grafana.${DOMAIN}@
70
71 For more information, see "DNS entries and TLS certificates":install-manual-prerequisites.html#dnstls.
72
73 h2(#download). Download the installer
74
75 {% assign local_params_src = 'multiple_hosts' %}
76 {% assign config_examples_src = 'multi_host/aws' %}
77 {% assign terraform_src = 'terraform/aws' %}
78 {% include 'download_installer' %}
79
80 h2(#setup-infra). Set up your infrastructure
81
82 ## "Create AWS infrastructure with Terraform":#terraform
83 ## "Create required infrastructure manually":#inframanual
84
85 h3(#terraform). Create AWS infrastructure with Terraform (AWS specific)
86
87 We provide a set of Terraform code files that you can run to create the necessary infrastructure on Amazon Web Services.
88
89 These files are located in the @terraform@ installer directory and are divided in three sections:
90
91 # The @terraform/vpc/@ subdirectory controls the network related infrastructure of your cluster, including firewall rules and split-horizon DNS resolution.
92 # The @terraform/data-storage/@ subdirectory controls the stateful part of your cluster, currently only sets up the S3 bucket for holding the Keep blocks and in the future it'll also manage the database service.
93 # The @terraform/services/@ subdirectory controls the hosts that will run the different services on your cluster, makes sure that they have the required software for the installer to do its job.
94
95 h4. Software requirements & considerations
96
97 {% include 'notebox_begin' %}
98 The Terraform state files (that keep crucial infrastructure information from the cloud) will be saved inside each subdirectory, under the @terraform.tfstate@ name.  These will be committed to the git repository used to coordinate deployment.  It is very important to keep this git repository secure, only sysadmins that will be responsible for maintaining your Arvados cluster should have access to it.
99 {% include 'notebox_end' %}
100
101 h4. Terraform code configuration
102
103 Each section described above contain a @terraform.tfvars@ file with some configuration values that you should set before applying each configuration. You should at least set the AWS region, cluster prefix and domain name in @terraform/vpc/terraform.tfvars@:
104
105 <pre><code>{% include 'terraform_vpc_tfvars' %}</code></pre>
106
107 If you don't set the main configuration variables at @vpc/terraform.tfvars@ file, you will be asked to re-enter these parameters every time you run Terraform.
108
109 The @data-storage/terraform.tfvars@ and @services/terraform.tfvars@ let you configure additional details, including the SSH public key for deployment, instance & volume sizes, etc. All these configurations are provided with sensible defaults:
110
111 <pre><code>{% include 'terraform_datastorage_tfvars' %}</code></pre>
112
113 <pre><code>{% include 'terraform_services_tfvars' %}</code></pre>
114
115 h4. Set credentials
116
117 You will need an AWS access key and secret key to create the infrastructure.
118
119 <pre><code class="userinput">export AWS_ACCESS_KEY_ID="anaccesskey"
120 export AWS_SECRET_ACCESS_KEY="asecretkey"</code></pre>
121
122 h4. Create the infrastructure
123
124 Build the infrastructure by running @./installer.sh terraform@.  The last stage will output the information needed to set up the cluster's domain and continue with the installer. for example:
125
126 <pre><code class="userinput">./installer.sh terraform
127 ...
128 Apply complete! Resources: 16 added, 0 changed, 0 destroyed.
129
130 Outputs:
131
132 arvados_sg_id = "sg-02f999a99973999d7"
133 arvados_subnet_id = "subnet-01234567abc"
134 cluster_int_cidr = "10.1.0.0/16"
135 cluster_name = "xarv1"
136 compute_subnet_id = "subnet-abcdef12345"
137 deploy_user = "admin"
138 domain_name = "xarv1.example.com"
139 letsencrypt_iam_access_key_id = "AKAA43MAAAWAKAADAASD"
140 private_ip = {
141   "controller" = "10.1.1.1"
142   "keep0" = "10.1.1.3"
143   "keep1" = "10.1.1.4"
144   "keepproxy" = "10.1.1.2"
145   "shell" = "10.1.1.7"
146   "workbench" = "10.1.1.5"
147 }
148 public_ip = {
149   "controller" = "18.235.116.23"
150   "keep0" = "34.202.85.86"
151   "keep1" = "38.22.123.98"
152   "keepproxy" = "34.231.9.201"
153   "shell" = "44.208.155.240"
154   "workbench" = "52.204.134.136"
155 }
156 region_name = "us-east-1"
157 route53_dns_ns = tolist([
158   "ns-1119.awsdns-11.org",
159   "ns-1812.awsdns-34.co.uk",
160   "ns-437.awsdns-54.com",
161   "ns-809.awsdns-37.net",
162 ])
163 ssl_password_secret_name = "xarv1-arvados-ssl-privkey-password"
164 vpc_id = "vpc-0999994998399923a"
165 letsencrypt_iam_secret_access_key = "XXXXXSECRETACCESSKEYXXXX"
166 </code></pre>
167
168
169 h4. Additional DNS configuration
170
171 Once Terraform has completed, the infrastructure for your Arvados cluster is up and running.  One last piece of DNS configuration is required.
172
173 The domain names for your cluster (e.g.: controller.xarv1.example.com) are managed via "Route 53":https://aws.amazon.com/route53/ and the TLS certificates will be issued using "Let's Encrypt":https://letsencrypt.org/ .
174
175 You need to configure the parent domain to delegate to the newly created zone.  For example, you need to configure "example.com" to delegate the subdomain "xarv1.example.com" to the nameservers for the Arvados hostname records created by Terraform.  You do this by creating a @NS@ record on the parent domain that refers to the name servers listed in the Terraform output parameter @route53_dns_ns@.
176
177 If your parent domain is also controlled by Route 53, the process will be like this:
178
179 # Log in to the AWS Console and navigate to the service page for *Route 53*
180 # Go to the list of *Hosted zones* and click on the zone for the parent domain
181 # Click on *Create record*
182 # For *Record name* put the cluster id
183 # For *Record type* choose @NS - Name servers for a hosted zone@
184 # For *Value* add the values from Terraform output parameter @route53_dns_ns@, one hostname per line, with punctuation (quotes and commas) removed.
185 # Click *Create records*
186
187 If the parent domain is controlled by some other service, follow the guide for the the appropriate service.
188
189 h4. Other important output parameters
190
191 The certificates will be requested from Let's Encrypt when you run the installer.
192
193 * @cluster_int_cidr@ will be used to set @CLUSTER_INT_CIDR@
194
195 * You'll also need @compute_subnet_id@ and @arvados_sg_id@ to set @COMPUTE_SUBNET@ and @COMPUTE_SG@ in @local.params@ and when you "create a compute image":#create_a_compute_image.
196
197 You can now proceed to "edit local.params* files":#localparams.
198
199 h3(#inframanual). Create required infrastructure manually
200
201 If you will be setting up infrastructure without using the provided Terraform script, here are the recommendations you will need to consider.
202
203 h4. Virtual Private Cloud (AWS specific)
204
205 We recommend setting Arvados up in its own "Virtual Private Cloud (VPC)":https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html
206
207 When you do so, you need to configure a couple of additional things:
208
209 # "Create a subnet for the compute nodes":https://docs.aws.amazon.com/vpc/latest/userguide/configure-subnets.html
210 # You should set up a "security group which allows SSH access (port 22)":https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html
211 # Make sure to add a "VPC S3 endpoint":https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-s3.html
212
213 h4(#keep-bucket). S3 Bucket (AWS specific)
214
215 We recommend "creating an S3 bucket":https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html for data storage named @${CLUSTER}-nyw5e-000000000000000-volume@.  We recommend creating an IAM role called @${CLUSTER}-keepstore-00-iam-role@ with a "policy that can read, write, list and delete objects in the bucket":configure-s3-object-storage.html#IAM .  With the example cluster id @xarv1@ the bucket would be called @xarv1-nyw5e-000000000000000-volume@ and the role would be called @xarv1-keepstore-00-iam-role@.
216
217 These names are recommended because they are default names used in the configuration template.  If you use different names, you will need to edit the configuration template later.
218
219 h4(#hosts). Required hosts
220
221 You will need to allocate several hosts (physical or virtual machines) for the fixed infrastructure of the Arvados cluster.  These machines should have at least 2 cores and 8 GiB of RAM, running a supported Linux distribution.
222
223 {% include 'supportedlinux' %}
224
225 Allocate the following hosts as appropriate for your site.  On AWS you may choose to do it manually with the AWS console, or using a DevOps tool such as CloudFormation or Terraform.  With the exception of "keep0" and "keep1", all of these hosts should have external (public) IP addresses if you intend for them to be accessible outside of the private network or VPC.
226
227 The installer will set up the Arvados services on your machines.  Here is the default assignment of services to machines:
228
229 # API node
230 ## postgresql server
231 ## arvados api server
232 ## arvados controller  (recommendend hostname @controller.${DOMAIN}@)
233 ## arvados websocket   (recommendend hostname @ws.${DOMAIN}@)
234 ## arvados cloud dispatcher
235 ## arvados keepbalance
236 # KEEPSTORE nodes (at least 1 if using S3 as a Keep backend, else 2)
237 ## arvados keepstore   (recommendend hostnames @keep0.${DOMAIN}@ and @keep1.${DOMAIN}@)
238 # KEEPPROXY node
239 ## arvados keepproxy   (recommendend hostname @keep.${DOMAIN}@)
240 ## arvados keepweb     (recommendend hostname @download.${DOMAIN}@ and @*.collections.${DOMAIN}@)
241 # WORKBENCH node
242 ## arvados workbench   (recommendend hostname @workbench.${DOMAIN}@)
243 ## arvados workbench2  (recommendend hostname @workbench2.${DOMAIN}@)
244 ## arvados webshell    (recommendend hostname @webshell.${DOMAIN}@)
245 # SHELL node  (optional)
246 ## arvados shell       (recommended hostname @shell.${DOMAIN}@)
247
248 When using the database installed by Arvados (and not an "external database":#ext-database), the database is stored under @/var/lib/postgresql@.  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 50GiB of free space on the database host.
249
250 h4. Additional prerequisites when preparing machines to run the installer
251
252 # From the account where you are performing the install, passwordless @ssh@ to each machine
253 This means the client's public key should added to @~/.ssh/authorized_keys@ on each node.
254 # Passwordless @sudo@ access on the account on each machine you will @ssh@ in to
255 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.
256 <pre>%sudo ALL=(ALL:ALL) NOPASSWD:ALL</pre>
257 # @git@ installed on each machine
258 # Port 443 reachable by clients
259
260 (AWS specific) The machine that runs the arvados cloud dispatcher will need an "IAM role that allows it to manage EC2 instances.":{{site.baseurl}}/install/crunch2-cloud/install-dispatch-cloud.html#IAM
261
262 If your infrastructure differs from the setup proposed above (ie, different hostnames), you can still use the installer, but "additional customization may be necessary":#further_customization .
263
264 h2(#localparams). Edit @local.params*@ files
265
266 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).
267
268 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.
269
270 h3. Parameters from @local.params@:
271
272 # Set @CLUSTER@ to the 5-character cluster identifier (e.g "xarv1")
273 # Set @DOMAIN@ to the base DNS domain of the environment, e.g. "xarv1.example.com"
274 # Set the @*_INT_IP@ variables with the internal (private) IP addresses of each host. Since services share hosts, some hosts are the same.  See "note about /etc/hosts":#etchosts
275 # Edit @CLUSTER_INT_CIDR@, this should be the CIDR of the private network that Arvados is running on, e.g. the VPC.  If you used terraform, this is emitted as @cluster_int_cidr@.
276 _CIDR stands for "Classless Inter-Domain Routing" and describes which portion of the IP address that refers to the network.  For example 192.168.3.0/24 means that the first 24 bits are the network (192.168.3) and the last 8 bits are a specific host on that network._
277 _AWS Specific: Go to the AWS console and into the VPC service, there is a column in this table view of the VPCs that gives the CIDR for the VPC (IPv4 CIDR)._
278 # Set @INITIAL_USER_EMAIL@ to your email address, as you will be the first admin user of the system.
279
280 h3. Parameters from @local.params.secrets@:
281
282 # Set each @KEY@ / @TOKEN@ / @PASSWORD@ to a random string.  You can use @installer.sh generate-tokens@
283 <pre><code class="userinput">./installer.sh generate-tokens
284 BLOB_SIGNING_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
285 MANAGEMENT_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
286 SYSTEM_ROOT_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
287 ANONYMOUS_USER_TOKEN=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
288 WORKBENCH_SECRET_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
289 DATABASE_PASSWORD=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
290 </code></pre>
291 # Set @DATABASE_PASSWORD@ to a random string (unless you "already have a database":#ext-database then you should set it to that database's password)
292    Important! If this contains any non-alphanumeric characters, in particular ampersand ('&'), it is necessary to add backslash quoting.
293    For example, if the password is @Lq&MZ<V']d?j@
294    With backslash quoting the special characters it should appear like this in local.params:
295 <pre><code>DATABASE_PASSWORD="Lq\&MZ\<V\'\]d\?j"</code></pre>
296 # Set @DISPATCHER_SSH_PRIVKEY@ to a SSH private key that @arvados-dispatch-cloud@ will use to connect to the compute nodes:
297 <pre><code>DISPATCHER_SSH_PRIVKEY="-----BEGIN OPENSSH PRIVATE KEY-----
298 b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
299 ...
300 s4VY40kNxs6MsAAAAPbHVjYXNAaW5zdGFsbGVyAQIDBA==
301 -----END OPENSSH PRIVATE KEY-----"
302 </code></pre>You can create one by following the steps described on the "building a compute node documentation":{{site.baseurl}}/install/crunch2-cloud/install-compute-node.html#sshkeypair page.
303
304 h3(#etchosts). Note on @/etc/hosts@
305
306 Because Arvados services are typically accessed by external clients, they are likely to have both a public IP address and a internal IP address.
307
308 On cloud providers such as AWS, sending internal traffic to a service's public IP address can incur egress costs and throttling.  Thus it is very important for internal traffic to stay on the internal network.  The installer implements this by updating @/etc/hosts@ on each node to associate each service's hostname with the internal IP address, so that when Arvados services communicate with one another, they always use the internal network address.  This is NOT a substitute for DNS, you still need to set up DNS names for all of the services that have public IP addresses (it does, however, avoid a complex "split-horizon" DNS configuration).
309
310 It is important to be aware of this because if you mistype the IP address for any of the @*_INT_IP@ variables, hosts may unexpectedly fail to be able to communicate with one another.  If this happens, check and edit as necessary the file @/etc/hosts@ on the host that is failing to make an outgoing connection.
311
312 h2(#keep). Configure Keep storage
313
314 The @multi_host/aws@ template uses S3 for storage.  Arvados also supports "filesystem storage":configure-fs-storage.html and "Azure blob storage":configure-azure-blob-storage.html .  Keep storage configuration can be found in in the @arvados.cluster.Volumes@ section of @local_config_dir/pillars/arvados.sls@.
315
316 h3. Object storage in S3 (AWS Specific)
317
318 Open @local_config_dir/pillars/arvados.sls@ and edit as follows:
319
320 # In the @arvados.cluster.Volumes.DriverParameters@ section, set @Region@ to the appropriate AWS region (e.g. 'us-east-1')
321
322 If "followed the recommendend naming scheme":#keep-bucket for both the bucket and role (or used the provided Terraform script), you're done.
323
324 If you did not follow the recommendend naming scheme for either the bucket or role, you'll need to update these parameters as well:
325
326 # Set @Bucket@ to the value of "keepstore bucket you created earlier":#keep-bucket
327 # Set @IAMRole@ to "keepstore role you created earlier":#keep-bucket
328
329 {% include 'ssl_config_multi' %}
330
331 h2(#authentication). Configure your authentication provider (optional, recommended)
332
333 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* .
334
335 h2(#ext-database). Using an external database (optional)
336
337 The standard behavior of the installer is to install and configure PostgreSQL for use by Arvados.  You can optionally configure it to use a separately managed database instead.
338
339 Arvados requires a database that is compatible with PostgreSQL 9.5 or later.  For example, Arvados is known to work with Amazon Aurora (note: even idle, Arvados services will periodically poll the database, so we strongly advise using "provisioned" mode).
340
341 # In @local.params@, remove 'database' from the list of roles assigned to the controller node:
342 <pre><code>NODES=(
343   [controller.${DOMAIN}]=controller,websocket,dispatcher,keepbalance
344   ...
345 )
346 </code></pre>
347 # In @local.params@, set @DATABASE_INT_IP@ to the database endpoint (can be a hostname, does not have to be an IP address).
348 <pre><code>DATABASE_INT_IP=...
349 </code></pre>
350 # In @local.params@, set @DATABASE_PASSWORD@ to the correct value.  "See the previous section describing correct quoting":#localparams
351 # In @local_config_dir/pillars/arvados.sls@ you may need to adjust the database name and user.  This can be found in the section @arvados.cluster.database@.
352
353 h2(#further_customization). Further customization of the installation (optional)
354
355 If you are installing on AWS and have followed all of the naming conventions recommend in this guide, you probably don't need to do any further customization.
356
357 If you are installing on a different cloud provider or on HPC, other changes 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 that is distributed to all the nodes.  Consult the "Configuration reference":config.html for a comprehensive list of configuration keys.
358
359 Any extra Salt "state" files you add under @local_config_dir/states@ will be added to the Salt run and applied to the hosts.
360
361 h2(#create_a_compute_image). Configure compute nodes
362
363 {% include 'branchname' %}
364
365 If you will use fixed compute nodes with an HPC scheduler such as SLURM or LSF, you will need to "Set up your compute nodes with Docker":{{site.baseurl}}/install/crunch2/install-compute-node-docker.html or "Set up your compute nodes with Singularity":{{site.baseurl}}/install/crunch2/install-compute-node-singularity.html.
366
367 On cloud installations, containers are dispatched in Docker daemons running in the _compute instances_, which need some additional setup.
368
369 h3. Build the compute image
370
371 Follow "the instructions to build a cloud compute node image":{{site.baseurl}}/install/crunch2-cloud/install-compute-node.html using the compute image builder script found in @arvados/tools/compute-images@ in your Arvados clone from "step 3":#download.
372
373 h3. Configure the compute image
374
375 Once the image has been created, open @local.params@ and edit as follows (AWS specific settings described here, you will need to make custom changes for other cloud providers):
376
377 # Set @COMPUTE_AMI@ to the AMI produced by Packer
378 # Set @COMPUTE_AWS_REGION@ to the appropriate AWS region
379 # Set @COMPUTE_USER@ to the admin user account on the image
380 # Set the @COMPUTE_SG@ list to the VPC security group which you set up to allow SSH connections to these nodes
381 # Set @COMPUTE_SUBNET@ to the value of SubnetId of your VPC
382 # Update @arvados.cluster.InstanceTypes@ in @local_config_dir/pillars/arvados.sls@ as necessary.  The example instance types are for AWS, other cloud providers will of course have different instance types with different names and specifications.
383 (AWS specific) If m5/c5 node types are not available, replace them with m4/c4. You'll need to double check the values for Price and IncludedScratch/AddedScratch for each type that is changed.
384
385 h2(#installation). Begin installation
386
387 At this point, you are ready to run the installer script in deploy mode that will conduct all of the Arvados installation.
388
389 Run this in the @~/arvados-setup-xarv1@ directory:
390
391 <pre><code class="userinput">./installer.sh deploy</code></pre>
392
393 This will install and configure Arvados on all the nodes.  It will take a while and produce a lot of logging.  If it runs into an error, it will stop.
394
395 h2(#test-install). Confirm the cluster is working
396
397 When everything has finished, you can run the diagnostics.
398
399 Depending on where you are running the installer, you need to provide @-internal-client@ or @-external-client@.
400
401 If you are running the diagnostics from one of the Arvados machines inside the private network, you want @-internal-client@ .
402
403 You are an "external client" if you running the diagnostics from your workstation outside of the private network.
404
405 <pre><code class="userinput">./installer.sh diagnostics (-internal-client|-external-client)</code></pre>
406
407 h3(#debugging). Debugging issues
408
409 The installer records log files for each deployment.
410
411 Most service logs go to @/var/log/syslog@.
412
413 The logs for Rails API server and for Workbench can be found in
414
415 @/var/www/arvados-api/current/log/production.log@
416 and
417 @/var/www/arvados-workbench/current/log/production.log@
418
419 on the appropriate instances.
420
421 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").
422
423 h3(#iterating). Iterating on config changes
424
425 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.
426
427 If you are debugging a configuration issue on a specific node, you can speed up the cycle a bit by deploying just one node:
428
429 <pre><code class="userinput">./installer.sh deploy keep0.xarv1.example.com</code></pre>
430
431 However, once you have a final configuration, you should run a full deploy to ensure that the configuration has been synchronized on all the nodes.
432
433 h3(#common-problems). Common problems and solutions
434
435 h4. PG::UndefinedTable: ERROR:  relation \"api_clients\" does not exist
436
437 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.
438
439 This will manifest as an error like this:
440
441 <pre>
442 #<ActiveRecord::StatementInvalid: PG::UndefinedTable: ERROR:  relation \"api_clients\" does not exist
443 </pre>
444
445 If this happens, you need to
446
447 1. correct the database information
448 2. run @./installer.sh deploy xarv1.example.com@ to update the configuration on the API/controller node
449 3. Log in to the API/controller server node, then run this command to re-run the post-install script, which will set up the database:
450 <pre><code class="userinput">dpkg-reconfigure arvados-api-server</code></pre>
451 4. 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.
452
453 h4. Missing ENA support (AWS Specific)
454
455 If the AMI wasn't built with ENA (extended networking) support and the instance type requires it, it'll fail to start.  You'll see an error in syslog on the node that runs @arvados-dispatch-cloud@.  The solution is to build a new AMI with --aws-ena-support true
456
457 h2(#initial_user). Initial user and login
458
459 At this point you should be able to log into the Arvados cluster. The initial URL will be
460
461 @https://workbench.${DOMAIN}@
462
463 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@ from the @local.params*@ file.
464
465 If you *did* configure a different authentication provider, the first user to log in will automatically be given Arvados admin privileges.
466
467 h2(#monitoring). Monitoring and Metrics
468
469 You can monitor the health and performance of the system using the admin dashboard:
470
471 @https://grafana.${DOMAIN}@
472
473 To log in, use username "admin" and @${INITIAL_USER_PASSWORD}@ from @local.params.secrets@.
474
475 Once logged in, you will want to add the dashboards to the front page.
476
477 # On the left icon bar, click on "Browse"
478 # You should see a folder called "Arvados Cluster", click to open it
479 ## If you don't see anything, make sure the check box next to "Starred" is not selected
480 # You should see three dashboards "Arvados cluster overview", "Node exporter" and "Postgres exporter"
481 # Visit each dashboard, at the top of the page click on the star next to the title to "Mark as favorite"
482 # They should now be linked on the front page.
483
484 h2(#load_balancing). Load balancing controllers (optional)
485
486 In order to handle high loads and perform rolling upgrades, the controller & api services can be scaled to a number of hosts and the installer make this implementation a fairly simple task.
487
488 First, you should take care of the infrastructure deployment: if you use our Terraform code, you will need to set up the @terraform.tfvars@ in @terraform/vpc/@ so that in addition to the node named @controller@ (the load-balancer), a number of @controllerN@ nodes (backends) are defined as needed, and added to the @internal_service_hosts@ list.
489
490 We suggest that the backend nodes just hold the controller & api services and nothing else, so they can be easily created or destroyed as needed without other service disruption. Because of this, you will need to set up a custom @dns_aliases@ variable map.
491
492 The following is an example @terraform/vpc/terraform.tfvars@ file that describes a cluster with a load-balancer, 2 backend nodes, a separate database node, a keepstore node and a workbench node that will also hold other miscelaneous services:
493
494 <pre><code>region_name = "us-east-1"
495 cluster_name = "xarv1"
496 domain_name = "xarv1.example.com"
497 # Include controller nodes in this list so instances are assigned to the
498 # private subnet. Only the balancer node should be connecting to them.
499 internal_service_hosts = [ "keep0", "database", "controller1", "controller2" ]
500
501 # Assign private IPs for the controller nodes. These will be used to create
502 # internal DNS resolutions that will get used by the balancer and database nodes.
503 private_ip = {
504   controller = "10.1.1.11"
505   workbench = "10.1.1.15"
506   database = "10.1.2.12"
507   controller1 = "10.1.2.21"
508   controller2 = "10.1.2.22"
509   keep0 = "10.1.2.13"
510 }
511
512 # Some services that used to run on the non-balanced controller node need to be
513 # moved to another. Here we assign DNS aliases because they will run on the
514 # workbench node.
515 dns_aliases = {
516   workbench = [
517     "ws",
518     "workbench2",
519     "keep",
520     "download",
521     "prometheus",
522     "grafana",
523     "*.collections"
524   ]
525 }</code></pre>
526
527 Once the infrastructure is deployed, you'll then need to define which node will be using the @balancer@ role and which will be the @controller@ nodes in @local.params@, as it's being shown in this partial example. Note how the workbench node got the majority of the other roles, reflecting the above terraform configuration example:
528
529 <pre><code>...
530 NODES=(
531   [controller.${DOMAIN}]=balancer
532   [controller1.${DOMAIN}]=controller
533   [controller2.${DOMAIN}]=controller
534   [database.${DOMAIN}]=database
535   [workbench.${DOMAIN}]=monitoring,workbench,workbench2,keepproxy,keepweb,websocket,keepbalance,dispatcher
536   [keep0.${DOMAIN}]=keepstore
537 )
538 ...</code></pre>
539
540 h3(#rolling-upgrades). Rolling upgrades procedure
541
542 Once you have more than one controller backend node, it's easy to take one at a time from the backend pool to upgrade it to a newer version of Arvados (which might involve applying database migrations) by adding its name to the @DISABLED_CONTROLLER@ variable in @local.params@. For example:
543
544 <pre><code>...
545 DISABLED_CONTROLLER="controller1"
546 ...</code></pre>
547
548 Then, apply the configuration change to just the load-balancer:
549
550 <pre><code class="userinput">./installer.sh deploy controller.xarv1.example.com</code></pre>
551
552 This will allow you to do the necessary changes to the @controller1@ node without service disruption, as it will not be receiving any traffic until you remove it from the @DISABLED_CONTROLLER@ variable.
553
554 Next step is applying the @deploy@ command to @controller1@:
555
556 <pre><code class="userinput">./installer.sh deploy controller1.xarv1.example.com</code></pre>
557
558 After that, disable the other controller node by editing @local.params@:
559
560 <pre><code>...
561 DISABLED_CONTROLLER="controller2"
562 ...</code></pre>
563
564 ...applying the changes on the balancer node:
565
566 <pre><code class="userinput">./installer.sh deploy controller.xarv1.example.com</code></pre>
567
568 Then, deploy the changes to the recently disabled @controller2@ node:
569
570 <pre><code class="userinput">./installer.sh deploy controller2.xarv1.example.com</code></pre>
571
572 This won't cause a service interruption because the load balancer is already routing all traffic to the othe @controller1@ node.
573
574 And the last step is enabling both controller nodes by making the following change to @local.params@:
575
576 <pre><code>...
577 DISABLED_CONTROLLER=""
578 ...</code></pre>
579
580 ...and running:
581
582 <pre><code class="userinput">./installer.sh deploy controller.xarv1.example.com</code></pre>
583
584 This should get all your @controller@ nodes correctly upgraded, and you can continue executing the @deploy@ command with the rest of the nodes individually, or just run:
585
586 <pre><code class="userinput">./installer.sh deploy</code></pre>
587
588 Only the nodes with pending changes might require certain services to be restarted. In this example, the @workbench@ node will have the remaining Arvados services upgraded and restarted. However, these services are not as critical as the ones on the @controller@ nodes.
589
590 h2(#post_install). After the installation
591
592 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 as well as cloud credentials if you used Terraform to create the infrastructure).
593
594 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.
595
596 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@.
597
598 See also "Maintenance and upgrading":{{site.baseurl}}/admin/maintenance-and-upgrading.html for more information.