3 navsection: installguide
4 title: Install Keepproxy server
7 Copyright (C) The Arvados Authors. All rights reserved.
9 SPDX-License-Identifier: CC-BY-SA-3.0
12 The Keepproxy server is a gateway into your Keep storage. Unlike the Keepstore servers, which are only accessible on the local LAN, Keepproxy is suitable for clients located elsewhere on the internet. Specifically, in contrast to Keepstore:
13 * A client writing through Keepproxy generates less network traffic: the client sends a single copy of a data block, and Keepproxy sends copies to the appropriate Keepstore servers.
14 * A client can write through Keepproxy without precomputing content hashes. Notably, the browser-based upload feature in Workbench requires Keepproxy.
15 * Keepproxy checks API token validity before processing requests. (Clients that can connect directly to Keepstore can use it as scratch space even without a valid API token.)
17 By convention, we use the following hostname for the Keepproxy server:
20 table(table table-bordered table-condensed).
22 |keep.@uuid_prefix@.your.domain|
25 This hostname should resolve from anywhere on the internet.
29 On Debian-based systems:
32 <pre><code>~$ <span class="userinput">sudo apt-get install keepproxy</span>
36 On Red Hat-based systems:
39 <pre><code>~$ <span class="userinput">sudo yum install keepproxy</span>
43 Verify that Keepproxy is functional:
46 <pre><code>~$ <span class="userinput">keepproxy -h</span>
49 Site configuration file (default may be overridden by setting an ARVADOS_CONFIG environment variable) (default "/etc/arvados/config.yml")
51 write current configuration to stdout and exit
54 print version information and exit.
58 h3. Update the cluster config
60 Edit the cluster config at @/etc/arvados/config.yml@ and set @Services.Keepproxy.ExternalURL@ and @Services.Keepproxy.InternalURLs@. Replace @uuid_prefix@ with your cluster id.
64 <span class="userinput">uuid_prefix</span>:
67 ExternalURL: <span class="userinput">https://keep.uuid_prefix.your.domain</span>
69 <span class="userinput">"http://localhost:25107": {}</span>
73 h3. Set up a reverse proxy with SSL support
75 Because the Keepproxy is intended for access from anywhere on the internet, it is recommended to use SSL for transport encryption.
77 This is best achieved by putting a reverse proxy with SSL support in front of Keepproxy. Keepproxy itself runs on port 25107 by default; your reverse proxy can run on port 443 and pass requests to Keepproxy on port 25107.
81 server 127.0.0.1:<span class="userinput">25107</span>;
85 listen <span class="userinput">[your public IP address]</span>:443 ssl;
86 server_name keep.<span class="userinput">uuid_prefix</span>.your.domain;
88 proxy_connect_timeout 90s;
89 proxy_read_timeout 300s;
90 proxy_set_header X-Real-IP $remote_addr;
91 proxy_http_version 1.1;
92 proxy_request_buffering off;
95 ssl_certificate /etc/nginx/keep.<span class="userinput">uuid_prefix</span>.your.domain-ssl.crt;
96 ssl_certificate_key /etc/nginx/keep.<span class="userinput">uuid_prefix</span>.your.domain-ssl.key;
98 # Clients need to be able to upload blocks of data up to 64MiB in size.
99 client_max_body_size 64m;
102 proxy_pass http://keepproxy;
107 Note: if the Web uploader is failing to upload data and there are no logs from keepproxy, be sure to check the nginx proxy logs. In addition to "GET" and "PUT", The nginx proxy must pass "OPTIONS" requests to keepproxy, which should respond with appropriate Cross-origin resource sharing headers. If the CORS headers are not present, brower security policy will cause the upload request to silently fail. The CORS headers are generated by keepproxy and should not be set in nginx.
109 h3. Tell the API server about the Keepproxy server
111 The API server needs to be informed about the presence of your Keepproxy server.
113 First, if you don't already have an admin token, create a superuser token.
115 {% include 'create_superuser_token' %}
117 Configure your environment to run @arv@ using the output of create_superuser_token.rb:
120 export ARVADOS_API_HOST=zzzzz.example.com
121 export ARVADOS_API_TOKEN=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
125 <pre><code>~$ <span class="userinput">uuid_prefix=`arv --format=uuid user current | cut -d- -f1`</span>
126 ~$ <span class="userinput">echo "Site prefix is '$uuid_prefix'"</span>
127 ~$ <span class="userinput">read -rd $'\000' keepservice <<EOF; arv keep_service create --keep-service "$keepservice"</span>
128 <span class="userinput">{
129 "service_host":"<strong>keep.$uuid_prefix.your.domain</strong>",
131 "service_ssl_flag":true,
132 "service_type":"proxy"
135 </code></pre></notextile>
139 h3. Start the service (option 1: systemd)
141 If your system does not use systemd, skip this section and follow the "runit instructions":#runit instead.
143 If your system uses systemd, the keepproxy service should already be set up. Start it and check its status:
146 <pre><code>~$ <span class="userinput">sudo systemctl restart keepproxy</span>
147 ~$ <span class="userinput">sudo systemctl status keepproxy</span>
148 ● keepproxy.service - Arvados Keep Proxy
149 Loaded: loaded (/lib/systemd/system/keepproxy.service; enabled)
150 Active: active (running) since Tue 2019-07-23 09:33:47 EDT; 3 weeks 1 days ago
151 Docs: https://doc.arvados.org/
152 Main PID: 1150 (Keepproxy)
153 CGroup: /system.slice/keepproxy.service
154 └─1150 /usr/bin/keepproxy
159 h3(#runit). Start the service (option 2: runit)
161 Install runit to supervise the Keep-web daemon. {% include 'install_runit' %}
163 h3. Testing keepproxy
165 Log into a host that is on an external network from your private Arvados network. The host should be able to contact your keepproxy server (eg keep.$uuid_prefix.arvadosapi.com), but not your keepstore servers (eg keep[0-9].$uuid_prefix.arvadosapi.com).
167 Install the "Python SDK":{{site.baseurl}}/sdk/python/sdk-python.html
169 @ARVADOS_API_HOST@ and @ARVADOS_API_TOKEN@ must be set in the environment.
171 You should now be able to use @arv-put@ to upload collections and @arv-get@ to fetch collections, for an example see "Testing keep.":install-keepstore.html#testing on the keepstore install page.