Merge branch 'master' into 15572-new-install-docs
[arvados.git] / doc / install / install-keep-balance.html.textile.liquid
1 ---
2 layout: default
3 navsection: installguide
4 title: Install Keep-balance
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 # "Update config.yml":#update-config
14 # "Install keep-balance package":#install-packages
15 # "Start the service":#start-service
16
17 h2(#introduction). Introduction
18
19 Keep-balance deletes unreferenced and overreplicated blocks from Keep servers, makes additional copies of underreplicated blocks, and moves blocks into optimal locations as needed (e.g., after adding new servers). See "Balancing Keep servers":{{site.baseurl}}/admin/keep-balance.html for usage details.
20
21 {% include 'notebox_begin' %}
22
23 If you are installing keep-balance on an existing system with valuable data, you can run keep-balance in "dry run" mode first and review its logs as a precaution. To do this, edit your keep-balance startup script to use the flags @-commit-pulls=false -commit-trash=false@.
24
25 {% include 'notebox_end' %}
26
27 h2(#update-config). Update the cluster config
28
29 Edit the cluster config at @/etc/arvados/config.yml@ and set @Services.Keepbalance.InternalURLs@.  This port is only used to publish metrics.
30
31 <notextile>
32 <pre><code>    Services:
33       Keepbalance:
34         InternalURLs:
35           "http://keep.ClusterID.example.com:9005/": {}
36 </code></pre>
37 </notextile>
38
39 Ensure your cluster configuration has @Collections.BlobTrash: true@ (this is the default).
40
41 <notextile>
42 <pre><code># arvados-server config-dump | grep BlobTrash:
43       BlobTrash: true
44 </code></pre>
45 </notextile>
46
47 If BlobTrash is false, unneeded blocks will be counted and logged by keep-balance, but they will not be deleted.
48
49 h2(#install-packages). Install keep-balance package
50
51 Keep-balance can be installed anywhere with network access to Keep services. Typically it runs on the same host as keepproxy.
52
53 *A cluster should have only one instance of keep-balance running at a time.*
54
55 h3. Centos 7
56
57 <notextile>
58 <pre><code># <span class="userinput">yum install keep-balance</span>
59 </code></pre>
60 </notextile>
61
62 h3. Debian and Ubuntu
63
64 <notextile>
65 <pre><code># <span class="userinput">apt-get install keep-balance</span>
66 </code></pre>
67 </notextile>
68
69 h2(#start-service). Start the service
70
71 If your system uses systemd, the keep-balance service should already be set up. Start it and check its status:
72
73 <notextile>
74 <pre><code>~$ <span class="userinput">sudo systemctl restart keep-balance</span>
75 ~$ <span class="userinput">sudo systemctl status keep-balance</span>
76 &#x25cf; keep-balance.service - Arvados Keep Balance
77    Loaded: loaded (/lib/systemd/system/keep-balance.service; enabled)
78    Active: active (running) since Sat 2017-02-14 18:46:01 UTC; 3 days ago
79      Docs: https://doc.arvados.org/
80  Main PID: 541 (keep-balance)
81    CGroup: /system.slice/keep-balance.service
82            └─541 /usr/bin/keep-balance -commit-pulls -commit-trash
83
84 Feb 14 18:46:01 zzzzz.arvadosapi.com keep-balance[541]: 2017/02/14 18:46:01 starting up: will scan every 10m0s and on SIGUSR1
85 Feb 14 18:56:01 zzzzz.arvadosapi.com keep-balance[541]: 2017/02/14 18:56:01 Run: start
86 Feb 14 18:56:01 zzzzz.arvadosapi.com keep-balance[541]: 2017/02/14 18:56:01 skipping zzzzz-bi6l4-rbtrws2jxul6i4t with service type "proxy"
87 Feb 14 18:56:01 zzzzz.arvadosapi.com keep-balance[541]: 2017/02/14 18:56:01 clearing existing trash lists, in case the new rendezvous order differs from previous run
88 </code></pre>
89 </notextile>