Installing controller service » History » Version 6

Tom Clegg, 07/17/2018 08:42 PM

1 1 Tom Clegg
h1. Installing controller service
2 1 Tom Clegg
3 2 Tom Clegg
refs #13497
4 2 Tom Clegg
5 6 Tom Clegg
h2. Add controller to an existing cluster
6 6 Tom Clegg
7 1 Tom Clegg
Add to "upgrading to master" section of doc.arvados.org:
8 4 Tom Clegg
* Create @/etc/arvados/config.yml@ on your API server node, if you haven't already
9 4 Tom Clegg
* Add to @/etc/arvados/config.yml@: <pre><code class="yaml">
10 1 Tom Clegg
Clusters:
11 1 Tom Clegg
  {your-uuid-prefix}:
12 3 Tom Clegg
    NodeProfiles:
13 4 Tom Clegg
      apiserver:
14 1 Tom Clegg
        arvados-controller:
15 1 Tom Clegg
          Listen: ":9004" # choose a port
16 1 Tom Clegg
        arvados-api-server:
17 1 Tom Clegg
          Listen: ":8000" # must match Rails server port in your Nginx config
18 1 Tom Clegg
</code></pre>
19 4 Tom Clegg
* Create @/etc/arvados/environment@ containing one line, @ARVADOS_NODE_PROFILE=apiserver@
20 1 Tom Clegg
* Install the arvados-controller package on your API server node
21 1 Tom Clegg
* Update your Nginx configuration so incoming traffic for $ARVADOS_API_HOST is routed to port 9004 (or whichever port you chose for arvados-controller in your config).
22 1 Tom Clegg
** Add: <pre>
23 1 Tom Clegg
upstream arvados-controller {
24 1 Tom Clegg
  server                  127.0.0.1:9004;
25 1 Tom Clegg
}
26 1 Tom Clegg
</pre>
27 1 Tom Clegg
** Update server section that currently forwards traffic to @http://api@: <pre><code class="diff">
28 1 Tom Clegg
 server {
29 1 Tom Clegg
   listen                  [your public IP address]:443 ssl;
30 1 Tom Clegg
   server_name             uuid_prefix.your.domain;
31 1 Tom Clegg
   # ...
32 1 Tom Clegg
   location  / {
33 1 Tom Clegg
-    proxy_pass            http://api;
34 1 Tom Clegg
+    proxy_pass            http://arvados-controller;
35 1 Tom Clegg
     # ...
36 1 Tom Clegg
   }
37 1 Tom Clegg
 }
38 1 Tom Clegg
</code></pre>
39 1 Tom Clegg
40 6 Tom Clegg
h2. Install controller in a new cluster
41 6 Tom Clegg
42 1 Tom Clegg
Update install docs:
43 1 Tom Clegg
* Add arvados-controller to the list of deb/rpm packages to install
44 4 Tom Clegg
* Create @/etc/arvados/config.yml@ (as above)
45 1 Tom Clegg
* Create @/etc/arvados/environment@ (as above)
46 5 Nico César
* If using systemd, run @systemctl start arvados-controller@ and confirm running status
47 5 Nico César
* If not using systemd, set up a supervised service using runit
48 1 Tom Clegg
49 6 Tom Clegg
h2. Verify controller is working
50 1 Tom Clegg
51 6 Tom Clegg
Watch controller's log messages.
52 6 Tom Clegg
53 6 Tom Clegg
<pre>
54 6 Tom Clegg
apiserver# journalctl -fu arvados-controller.service
55 6 Tom Clegg
</pre>
56 6 Tom Clegg
57 6 Tom Clegg
When the controller service starts, you should see startup messages:
58 6 Tom Clegg
59 6 Tom Clegg
<pre>
60 6 Tom Clegg
Jul 17 20:29:16 4xphq.arvadosapi.com systemd[1]: Starting Arvados controller...
61 6 Tom Clegg
Jul 17 20:29:16 4xphq.arvadosapi.com arvados-controller[28118]: {"Listen":"[::]:9004","Service":"arvados-controller","level":"info","msg":"listening","time":"2018-07-17T20:29:16.287796594Z"}
62 6 Tom Clegg
Jul 17 20:29:16 4xphq.arvadosapi.com systemd[1]: Started Arvados controller.
63 6 Tom Clegg
</pre>
64 6 Tom Clegg
65 6 Tom Clegg
When clients access the API, you should see "request" and "response" log messages:
66 6 Tom Clegg
67 6 Tom Clegg
<pre>
68 6 Tom Clegg
Jul 17 20:41:01 4xphq.arvadosapi.com arvados-controller[28118]: {"RequestID":"req-5o2lhd2i1peunbmat2u2","level":"info","msg":"request","remoteAddr":"127.0.0.1:17192","reqBytes":140,"reqForwardedFor":"10.20.49.0","reqHost":"4xphq.arvadosapi.com","reqMethod":"POST","reqPath":"arvados/v1/collections","reqQuery":"","time":"2018-07-17T20:41:01.816350482Z"}
69 6 Tom Clegg
Jul 17 20:41:02 4xphq.arvadosapi.com arvados-controller[28118]: {"RequestID":"req-5o2lhd2i1peunbmat2u2","level":"info","msg":"response","remoteAddr":"127.0.0.1:17192","reqBytes":140,"reqForwardedFor":"10.20.49.0","reqHost":"4xphq.arvadosapi.com","reqMethod":"POST","reqPath":"arvados/v1/collections","reqQuery":"","respBytes":6138,"respStatus":"OK","respStatusCode":200,"time":"2018-07-17T20:41:02.135405529Z","timeToStatus":0.318963,"timeTotal":0.319050,"timeWriteBody":0.000086}
70 6 Tom Clegg
</pre>