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