help.go 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. // Copyright 2015 The etcd Authors
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package etcdmain
  15. import (
  16. "fmt"
  17. "strconv"
  18. "go.etcd.io/etcd/embed"
  19. "golang.org/x/crypto/bcrypt"
  20. )
  21. var (
  22. usageline = `Usage:
  23. etcd [flags]
  24. Start an etcd server.
  25. etcd --version
  26. Show the version of etcd.
  27. etcd -h | --help
  28. Show the help information about etcd.
  29. etcd --config-file
  30. Path to the server configuration file. Note that if a configuration file is provided, other command line flags and environment variables will be ignored.
  31. etcd gateway
  32. Run the stateless pass-through etcd TCP connection forwarding proxy.
  33. etcd grpc-proxy
  34. Run the stateless etcd v3 gRPC L7 reverse proxy.
  35. `
  36. flagsline = `
  37. Member:
  38. --name 'default'
  39. Human-readable name for this member.
  40. --data-dir '${name}.etcd'
  41. Path to the data directory.
  42. --wal-dir ''
  43. Path to the dedicated wal directory.
  44. --snapshot-count '100000'
  45. Number of committed transactions to trigger a snapshot to disk.
  46. --heartbeat-interval '100'
  47. Time (in milliseconds) of a heartbeat interval.
  48. --election-timeout '1000'
  49. Time (in milliseconds) for an election to timeout. See tuning documentation for details.
  50. --initial-election-tick-advance 'true'
  51. Whether to fast-forward initial election ticks on boot for faster election.
  52. --listen-peer-urls 'http://localhost:2380'
  53. List of URLs to listen on for peer traffic.
  54. --listen-client-urls 'http://localhost:2379'
  55. List of URLs to listen on for client traffic.
  56. --max-snapshots '` + strconv.Itoa(embed.DefaultMaxSnapshots) + `'
  57. Maximum number of snapshot files to retain (0 is unlimited).
  58. --max-wals '` + strconv.Itoa(embed.DefaultMaxWALs) + `'
  59. Maximum number of wal files to retain (0 is unlimited).
  60. --quota-backend-bytes '0'
  61. Raise alarms when backend size exceeds the given quota (0 defaults to low space quota).
  62. --backend-batch-interval ''
  63. BackendBatchInterval is the maximum time before commit the backend transaction.
  64. --backend-batch-limit '0'
  65. BackendBatchLimit is the maximum operations before commit the backend transaction.
  66. --max-txn-ops '128'
  67. Maximum number of operations permitted in a transaction.
  68. --max-request-bytes '1572864'
  69. Maximum client request size in bytes the server will accept.
  70. --grpc-keepalive-min-time '5s'
  71. Minimum duration interval that a client should wait before pinging server.
  72. --grpc-keepalive-interval '2h'
  73. Frequency duration of server-to-client ping to check if a connection is alive (0 to disable).
  74. --grpc-keepalive-timeout '20s'
  75. Additional duration of wait before closing a non-responsive connection (0 to disable).
  76. Clustering:
  77. --initial-advertise-peer-urls 'http://localhost:2380'
  78. List of this member's peer URLs to advertise to the rest of the cluster.
  79. --initial-cluster 'default=http://localhost:2380'
  80. Initial cluster configuration for bootstrapping.
  81. --initial-cluster-state 'new'
  82. Initial cluster state ('new' or 'existing').
  83. --initial-cluster-token 'etcd-cluster'
  84. Initial cluster token for the etcd cluster during bootstrap.
  85. Specifying this can protect you from unintended cross-cluster interaction when running multiple clusters.
  86. --advertise-client-urls 'http://localhost:2379'
  87. List of this member's client URLs to advertise to the public.
  88. The client URLs advertised should be accessible to machines that talk to etcd cluster. etcd client libraries parse these URLs to connect to the cluster.
  89. --discovery ''
  90. Discovery URL used to bootstrap the cluster.
  91. --discovery-fallback 'proxy'
  92. Expected behavior ('exit' or 'proxy') when discovery services fails.
  93. "proxy" supports v2 API only.
  94. --discovery-proxy ''
  95. HTTP proxy to use for traffic to discovery service.
  96. --discovery-srv ''
  97. DNS srv domain used to bootstrap the cluster.
  98. --discovery-srv-name ''
  99. Suffix to the dns srv name queried when bootstrapping.
  100. --strict-reconfig-check '` + strconv.FormatBool(embed.DefaultStrictReconfigCheck) + `'
  101. Reject reconfiguration requests that would cause quorum loss.
  102. --pre-vote 'false'
  103. Enable to run an additional Raft election phase.
  104. --auto-compaction-retention '0'
  105. Auto compaction retention length. 0 means disable auto compaction.
  106. --auto-compaction-mode 'periodic'
  107. Interpret 'auto-compaction-retention' one of: periodic|revision. 'periodic' for duration based retention, defaulting to hours if no time unit is provided (e.g. '5m'). 'revision' for revision number based retention.
  108. --enable-v2 '` + strconv.FormatBool(embed.DefaultEnableV2) + `'
  109. Accept etcd V2 client requests.
  110. Security:
  111. --cert-file ''
  112. Path to the client server TLS cert file.
  113. --key-file ''
  114. Path to the client server TLS key file.
  115. --client-cert-auth 'false'
  116. Enable client cert authentication.
  117. --client-crl-file ''
  118. Path to the client certificate revocation list file.
  119. --client-cert-allowed-hostname ''
  120. Allowed TLS hostname for client cert authentication.
  121. --trusted-ca-file ''
  122. Path to the client server TLS trusted CA cert file.
  123. --auto-tls 'false'
  124. Client TLS using generated certificates.
  125. --peer-cert-file ''
  126. Path to the peer server TLS cert file.
  127. --peer-key-file ''
  128. Path to the peer server TLS key file.
  129. --peer-client-cert-auth 'false'
  130. Enable peer client cert authentication.
  131. --peer-trusted-ca-file ''
  132. Path to the peer server TLS trusted CA file.
  133. --peer-cert-allowed-cn ''
  134. Required CN for client certs connecting to the peer endpoint.
  135. --peer-cert-allowed-hostname ''
  136. Allowed TLS hostname for inter peer authentication.
  137. --peer-auto-tls 'false'
  138. Peer TLS using self-generated certificates if --peer-key-file and --peer-cert-file are not provided.
  139. --peer-crl-file ''
  140. Path to the peer certificate revocation list file.
  141. --cipher-suites ''
  142. Comma-separated list of supported TLS cipher suites between client/server and peers (empty will be auto-populated by Go).
  143. --cors '*'
  144. Comma-separated whitelist of origins for CORS, or cross-origin resource sharing, (empty or * means allow all).
  145. --host-whitelist '*'
  146. Acceptable hostnames from HTTP client requests, if server is not secure (empty or * means allow all).
  147. Auth:
  148. --auth-token 'simple'
  149. Specify a v3 authentication token type and its options ('simple' or 'jwt').
  150. --bcrypt-cost ` + fmt.Sprintf("%d", bcrypt.DefaultCost) + `
  151. Specify the cost / strength of the bcrypt algorithm for hashing auth passwords. Valid values are between ` + fmt.Sprintf("%d", bcrypt.MinCost) + ` and ` + fmt.Sprintf("%d", bcrypt.MaxCost) + `.
  152. Profiling and Monitoring:
  153. --enable-pprof 'false'
  154. Enable runtime profiling data via HTTP server. Address is at client URL + "/debug/pprof/"
  155. --metrics 'basic'
  156. Set level of detail for exported metrics, specify 'extensive' to include server side grpc histogram metrics.
  157. --listen-metrics-urls ''
  158. List of URLs to listen on for the metrics and health endpoints.
  159. Logging:
  160. --logger 'capnslog'
  161. Specify 'zap' for structured logging or 'capnslog'. [WARN] 'capnslog' will be deprecated in v3.5.
  162. --log-outputs 'default'
  163. Specify 'stdout' or 'stderr' to skip journald logging even when running under systemd, or list of comma separated output targets.
  164. --log-level 'info'
  165. Configures log level. Only supports debug, info, warn, error, panic, or fatal.
  166. v2 Proxy (to be deprecated in v4):
  167. --proxy 'off'
  168. Proxy mode setting ('off', 'readonly' or 'on').
  169. --proxy-failure-wait 5000
  170. Time (in milliseconds) an endpoint will be held in a failed state.
  171. --proxy-refresh-interval 30000
  172. Time (in milliseconds) of the endpoints refresh interval.
  173. --proxy-dial-timeout 1000
  174. Time (in milliseconds) for a dial to timeout.
  175. --proxy-write-timeout 5000
  176. Time (in milliseconds) for a write to timeout.
  177. --proxy-read-timeout 0
  178. Time (in milliseconds) for a read to timeout.
  179. Experimental feature:
  180. --experimental-initial-corrupt-check 'false'
  181. Enable to check data corruption before serving any client/peer traffic.
  182. --experimental-corrupt-check-time '0s'
  183. Duration of time between cluster corruption check passes.
  184. --experimental-enable-v2v3 ''
  185. Serve v2 requests through the v3 backend under a given prefix.
  186. --experimental-backend-bbolt-freelist-type 'array'
  187. ExperimentalBackendFreelistType specifies the type of freelist that boltdb backend uses(array and map are supported types).
  188. --experimental-enable-lease-checkpoint 'false'
  189. ExperimentalEnableLeaseCheckpoint enables primary lessor to persist lease remainingTTL to prevent indefinite auto-renewal of long lived leases.
  190. --experimental-compaction-batch-limit 1000
  191. ExperimentalCompactionBatchLimit sets the maximum revisions deleted in each compaction batch.
  192. --experimental-peer-skip-client-san-verification 'false'
  193. Skip verification of SAN field in client certificate for peer connections.
  194. Unsafe feature:
  195. --force-new-cluster 'false'
  196. Force to create a new one-member cluster.
  197. CAUTIOUS with unsafe flag! It may break the guarantees given by the consensus protocol!
  198. TO BE DEPRECATED:
  199. --debug 'false'
  200. Enable debug-level logging for etcd. [WARN] Will be deprecated in v3.5. Use '--log-level=debug' instead.
  201. --log-package-levels ''
  202. Specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG').
  203. `
  204. )