Merge branch 'master' into 3198-writable-fuse
[arvados.git] / doc / install / install-keepstore.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Install Keepstore servers
5 ...
6
7 This installation guide assumes you are on a 64 bit Debian or Ubuntu system.
8
9 We are going to install two Keepstore servers. By convention, we use the following hostname pattern:
10
11 <div class="offset1">
12 table(table table-bordered table-condensed).
13 |_Hostname_|
14 |keep0.@uuid_prefix@.your.domain|
15 |keep1.@uuid_prefix@.your.domain|
16 </div>
17
18 Because the Keepstore servers are not directly accessible from the internet, these hostnames only need to resolve on the local network.
19
20 h2. Install Keepstore
21
22 First add the Arvados apt repository, and then install the Keepstore package.
23
24 <notextile>
25 <pre><code>~$ <span class="userinput">echo "deb http://apt.arvados.org/ wheezy main" | sudo tee /etc/apt/sources.list.d/apt.arvados.org.list</span>
26 ~$ <span class="userinput">sudo /usr/bin/apt-key adv --keyserver pool.sks-keyservers.net --recv 1078ECD7</span>
27 ~$ <span class="userinput">sudo /usr/bin/apt-get update</span>
28 ~$ <span class="userinput">sudo /usr/bin/apt-get install keepstore</span>
29 </code></pre>
30 </notextile>
31
32 Verify that Keepstore is functional:
33
34 <notextile>
35 <pre><code>~$ <span class="userinput">keepstore -h</span>
36 2015/05/08 13:41:16 keepstore starting, pid 2565
37 Usage of ./keepstore:
38   -blob-signature-ttl=1209600: Lifetime of blob permission signatures. See services/api/config/application.default.yml.
39   -blob-signing-key-file="": File containing the secret key for generating and verifying blob permission signatures.
40   -data-manager-token-file="": File with the API token used by the Data Manager. All DELETE requests or GET /index requests must carry this token.
41   -enforce-permissions=false: Enforce permission signatures on requests.
42   -listen=":25107": Listening address, in the form "host:port". e.g., 10.0.1.24:8000. Omit the host part to listen on all interfaces.
43   -max-buffers=128: Maximum RAM to use for data buffers, given in multiples of block size (64 MiB). When this limit is reached, HTTP requests requiring buffers (like GET and PUT) will wait for buffer space to be released.
44   -never-delete=false: If set, nothing will be deleted. HTTP 405 will be returned for valid DELETE requests.
45   -permission-key-file="": Synonym for -blob-signing-key-file.
46   -permission-ttl=0: Synonym for -blob-signature-ttl.
47   -pid="": Path to write pid file during startup. This file is kept open and locked with LOCK_EX until keepstore exits, so `fuser -k pidfile` is one way to shut down. Exit immediately if there is an error opening, locking, or writing the pid file.
48   -readonly=false: Do not write, delete, or touch anything on the following volumes.
49   -serialize=false: Serialize read and write operations on the following volumes.
50   -volume=[]: Local storage directory. Can be given more than once to add multiple directories. If none are supplied, the default is to use all directories named "keep" that exist in the top level directory of a mount point at startup time. Can be a comma-separated list, but this is deprecated: use multiple -volume arguments instead.
51   -volumes=[]: Deprecated synonym for -volume.
52 </code></pre>
53 </notextile>
54
55 If you want access control on your Keepstore server(s), you must specify the @-enforce-permissions@ flag and provide a signing key. The @-blob-signing-key-file@ argument should be a file containing a long random alphanumeric string with no internal line breaks (it is also possible to use a socket or FIFO: keepstore reads it only once, at startup). This key must be the same as the @blob_signing_key@ configured in the "API server":install-api-server.html config/application.yml file.
56
57 The @-max-buffers@ argument can be used to restrict keepstore's memory use. By default, keepstore will allocate no more than 128 blocks (8 GiB) worth of data buffers at a time. Normally this should be set as high as possible without risking swapping.
58
59 Prepare one or more volumes for Keepstore to use. Simply create a /keep directory on all the partitions you would like Keepstore to use, and then start Keepstore. For example, using 2 tmpfs volumes:
60
61 <notextile>
62 <pre><code>~$ <span class="userinput">keepstore -blob-signing-key-file=./blob-signing-key</span>
63 2015/05/08 13:44:26 keepstore starting, pid 2765
64 2015/05/08 13:44:26 Using volume [UnixVolume /mnt/keep] (writable=true)
65 2015/05/08 13:44:26 listening at :25107
66
67 </code></pre>
68 </notextile>
69
70 It's recommended to run Keepstore under "runit":https://packages.debian.org/search?keywords=runit or something similar.
71
72 Repeat this section for each Keepstore server you are setting up.
73
74 h3. Tell the API server about the Keepstore servers
75
76 The API server needs to be informed about the presence of your Keepstore servers. For each of the Keepstore servers you have created, please execute the following commands on your <strong>shell server</strong>.
77
78 Make sure to update the @service_host@ value to match each of your Keepstore servers.
79
80 <notextile>
81 <pre><code>~$ <span class="userinput">prefix=`arv --format=uuid user current | cut -d- -f1`</span>
82 ~$ <span class="userinput">echo "Site prefix is '$prefix'"</span>
83 ~$ <span class="userinput">read -rd $'\000' keepservice &lt;&lt;EOF; arv keep_service create --keep-service "$keepservice"</span>
84 <span class="userinput">{
85  "service_host":"keep0.$prefix.your.domain",
86  "service_port":25107,
87  "service_ssl_flag":false,
88  "service_type":"disk"
89 }
90 EOF</span>
91 </code></pre></notextile>
92
93
94