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>
48 Usage: keepproxy [-config path/to/keepproxy.yml]
53 h3. Create an API token for the Keepproxy server
55 {% assign railscmd = "bundle exec ./script/get_anonymous_user_token.rb --get" %}
56 {% assign railsout = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" %}
57 The Keepproxy server needs a token to talk to the API server. On the <strong>API server</strong>, use the following command to create the token. {% include 'install_rails_command' %}
59 h3. Set up the Keepproxy service
61 Install runit to supervise the keepproxy daemon. {% include 'install_runit' %}
63 The run script for the keepproxy service should set the environment variables @ARVADOS_API_TOKEN@ (with the token you just generated), @ARVADOS_API_HOST@, and, if needed, @ARVADOS_API_HOST_INSECURE@. The core keepproxy command to run is:
66 <pre><code>ARVADOS_API_TOKEN=<span class="userinput">{{railsout}}</span> ARVADOS_API_HOST=<span class="userinput">uuid_prefix.your.domain</span> exec keepproxy
70 h3. Set up a reverse proxy with SSL support
72 Because the Keepproxy is intended for access from anywhere on the internet, it is recommended to use SSL for transport encryption.
74 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.
78 server 127.0.0.1:<span class="userinput">25107</span>;
82 listen <span class="userinput">[your public IP address]</span>:443 ssl;
83 server_name keep.<span class="userinput">uuid_prefix</span>.your.domain;
85 proxy_connect_timeout 90s;
86 proxy_read_timeout 300s;
87 proxy_set_header X-Real-IP $remote_addr;
88 proxy_http_version 1.1;
89 proxy_request_buffering off;
92 ssl_certificate /etc/nginx/keep.<span class="userinput">uuid_prefix</span>.your.domain-ssl.crt;
93 ssl_certificate_key /etc/nginx/keep.<span class="userinput">uuid_prefix</span>.your.domain-ssl.key;
95 # Clients need to be able to upload blocks of data up to 64MiB in size.
96 client_max_body_size 64m;
99 proxy_pass http://keepproxy;
104 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.
106 h3. Tell the API server about the Keepproxy server
108 The API server needs to be informed about the presence of your Keepproxy server.
110 First, if you don't already have an admin token, create a superuser token.
112 {% include 'create_superuser_token' %}
114 Configure your environment to run @arv@ using the output of create_superuser_token.rb:
117 export ARVADOS_API_HOST=zzzzz.example.com
118 export ARVADOS_API_TOKEN=zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
122 <pre><code>~$ <span class="userinput">uuid_prefix=`arv --format=uuid user current | cut -d- -f1`</span>
123 ~$ <span class="userinput">echo "Site prefix is '$uuid_prefix'"</span>
124 ~$ <span class="userinput">read -rd $'\000' keepservice <<EOF; arv keep_service create --keep-service "$keepservice"</span>
125 <span class="userinput">{
126 "service_host":"<strong>keep.$uuid_prefix.your.domain</strong>",
128 "service_ssl_flag":true,
129 "service_type":"proxy"
132 </code></pre></notextile>
134 h3. Testing keepproxy
136 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).
138 Install the "Python SDK":{{site.baseurl}}/sdk/python/sdk-python.html
140 @ARVADOS_API_HOST@ and @ARVADOS_API_TOKEN@ must be set in the environment.
142 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.