9395: Add CollectionBuffers config to keep-balance.
[arvados.git] / services / keep-balance / usage.go
1 package main
2
3 import (
4         "flag"
5         "fmt"
6         "os"
7 )
8
9 var exampleConfigFile = []byte(`
10     {
11         "Client": {
12             "APIHost": "zzzzz.arvadosapi.com:443",
13             "AuthToken": "xyzzy",
14             "Insecure": false
15         },
16         "KeepServiceTypes": [
17             "disk"
18         ],
19         "RunPeriod": "600s",
20         "CollectionBatchSize": 100000,
21         "CollectionBuffers": 1000
22     }`)
23
24 func usage() {
25         fmt.Fprintf(os.Stderr, `
26
27 keep-balance rebalances a set of keepstore servers. It creates new
28 copies of underreplicated blocks, deletes excess copies of
29 overreplicated and unreferenced blocks, and moves blocks to better
30 positions (according to the rendezvous hash algorithm) so clients find
31 them faster.
32
33 Usage: keep-balance -config path/to/config.json [options]
34
35 Options:
36 `)
37         flag.PrintDefaults()
38         fmt.Fprintf(os.Stderr, `
39 Example config file:
40 %s
41
42     Client.AuthToken must be recognized by Arvados as an admin token,
43     and must be recognized by all Keep services as a "data manager
44     key".
45
46     Client.Insecure should be true if your Arvados API endpoint uses
47     an unverifiable SSL/TLS certificate.
48
49 Periodic scanning:
50
51     By default, keep-balance operates periodically, i.e.: do a
52     scan/balance operation, sleep, repeat.
53
54     RunPeriod determines the interval between start times of
55     successive scan/balance operations. If a scan/balance operation
56     takes longer than RunPeriod, the next one will follow it
57     immediately.
58
59     If SIGUSR1 is received during an idle period between operations,
60     the next operation will start immediately.
61
62 One-time scanning:
63
64     Use the -once flag to do a single operation and then exit. The
65     exit code will be zero if the operation was successful.
66
67 Committing:
68
69     By default, keep-service computes and reports changes but does not
70     implement them by sending pull and trash lists to the Keep
71     services.
72
73     Use the -commit-pull and -commit-trash flags to implement the
74     computed changes.
75
76 Limitations:
77
78     keep-balance does not attempt to discover whether committed pull
79     and trash requests ever get carried out -- only that they are
80     accepted by the Keep services. If some services are full, new
81     copies of underreplicated blocks might never get made, only
82     repeatedly requested.
83
84 `, exampleConfigFile)
85 }