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