9956: Load volume config from YAML file
[arvados.git] / services / keepstore / usage.go
1 package main
2
3 import (
4         "flag"
5         "fmt"
6         "os"
7
8         "github.com/ghodss/yaml"
9 )
10
11 func usage() {
12         c := DefaultConfig()
13         for _, vt := range VolumeTypes {
14                 c.Volumes = append(c.Volumes, vt().Examples()...)
15         }
16         exampleConfigFile, err := yaml.Marshal(c)
17         if err != nil {
18                 panic(err)
19         }
20         fmt.Fprintf(os.Stderr, `
21
22 keepstore provides a content-addressed data store backed by a local filesystem or networked storage.
23
24 Usage: keepstore -config path/to/keepstore.yml
25        keepstore [OPTIONS] -dump-config
26
27 NOTE: All options (other than -config) are deprecated in favor of YAML
28       configuration. Use -dump-config to translate existing
29       configurations to YAML format.
30
31 Options:
32 `)
33         flag.PrintDefaults()
34         fmt.Fprintf(os.Stderr, `
35 Example config file:
36
37 %s
38
39 Listen:
40
41     Local port to listen on. Can be "address", "address:port", or
42     ":port", where "address" is a host IP address or name and "port"
43     is a port number or name.
44
45 PIDFile:
46
47    Path to write PID file during startup. This file is kept open and
48    locked with LOCK_EX until keepstore exits, so "fuser -k pidfile" is
49    one way to shut down. Exit immediately if there is an error
50    opening, locking, or writing the PID file.
51
52 MaxBuffers:
53
54     Maximum RAM to use for data buffers, given in multiples of block
55     size (64 MiB). When this limit is reached, HTTP requests requiring
56     buffers (like GET and PUT) will wait for buffer space to be
57     released.
58
59 MaxRequests:
60
61     Maximum concurrent requests. When this limit is reached, new
62     requests will receive 503 responses. Note: this limit does not
63     include idle connections from clients using HTTP keepalive, so it
64     does not strictly limit the number of concurrent connections. If
65     omitted or zero, the default is 2 * MaxBuffers.
66
67 BlobSigningKeyFile:
68
69     Local file containing the secret blob signing key (used to
70     generate and verify blob signatures).  This key should be
71     identical to the API server's blob_signing_key configuration
72     entry.
73
74 RequireSignatures:
75
76     Honor read requests only if a valid signature is provided.  This
77     should be true, except for development use and when migrating from
78     a very old version.
79
80 BlobSignatureTTL:
81
82     Duration for which new permission signatures (returned in PUT
83     responses) will be valid.  This should be equal to the API
84     server's blob_signature_ttl configuration entry.
85
86 SystemAuthTokenFile:
87
88     Local file containing the Arvados API token used by keep-balance
89     or data manager.  Delete, trash, and index requests are honored
90     only for this token.
91
92 EnableDelete:
93
94     Enable trash and delete features. If false, trash lists will be
95     accepted but blocks will not be trashed or deleted.
96
97 TrashLifetime:
98
99     Time duration after a block is trashed during which it can be
100     recovered using an /untrash request.
101
102 TrashCheckInterval:
103
104     How often to check for (and delete) trashed blocks whose
105     TrashLifetime has expired.
106
107 Volumes:
108
109     List of storage volumes. If omitted or empty, the default is to
110     use all directories named "keep" that exist in the top level
111     directory of a mount point at startup time.
112
113 `, exampleConfigFile)
114 }