help.go 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. "strconv"
  17. "github.com/coreos/etcd/embed"
  18. )
  19. var (
  20. usageline = `usage: etcd [flags]
  21. start an etcd server
  22. etcd --version
  23. show the version of etcd
  24. etcd -h | --help
  25. show the help information about etcd
  26. etcd --config-file
  27. path to the server configuration file
  28. `
  29. flagsline = `
  30. member flags:
  31. --name 'default'
  32. human-readable name for this member.
  33. --data-dir '${name}.etcd'
  34. path to the data directory.
  35. --wal-dir ''
  36. path to the dedicated wal directory.
  37. --snapshot-count '10000'
  38. number of committed transactions to trigger a snapshot to disk.
  39. --heartbeat-interval '100'
  40. time (in milliseconds) of a heartbeat interval.
  41. --election-timeout '1000'
  42. time (in milliseconds) for an election to timeout. See tuning documentation for details.
  43. --initial-election-tick-advance 'true'
  44. whether to fast-forward initial election ticks on boot for faster election.
  45. --listen-peer-urls 'http://localhost:2380'
  46. list of URLs to listen on for peer traffic.
  47. --listen-client-urls 'http://localhost:2379'
  48. list of URLs to listen on for client traffic.
  49. --max-snapshots '` + strconv.Itoa(embed.DefaultMaxSnapshots) + `'
  50. maximum number of snapshot files to retain (0 is unlimited).
  51. --max-wals '` + strconv.Itoa(embed.DefaultMaxWALs) + `'
  52. maximum number of wal files to retain (0 is unlimited).
  53. --cors ''
  54. comma-separated whitelist of origins for CORS (cross-origin resource sharing).
  55. --quota-backend-bytes '0'
  56. raise alarms when backend size exceeds the given quota (0 defaults to low space quota).
  57. clustering flags:
  58. --initial-advertise-peer-urls 'http://localhost:2380'
  59. list of this member's peer URLs to advertise to the rest of the cluster.
  60. --initial-cluster 'default=http://localhost:2380'
  61. initial cluster configuration for bootstrapping.
  62. --initial-cluster-state 'new'
  63. initial cluster state ('new' or 'existing').
  64. --initial-cluster-token 'etcd-cluster'
  65. initial cluster token for the etcd cluster during bootstrap.
  66. Specifying this can protect you from unintended cross-cluster interaction when running multiple clusters.
  67. --advertise-client-urls 'http://localhost:2379'
  68. list of this member's client URLs to advertise to the public.
  69. 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.
  70. --discovery ''
  71. discovery URL used to bootstrap the cluster.
  72. --discovery-fallback 'proxy'
  73. expected behavior ('exit' or 'proxy') when discovery services fails.
  74. "proxy" supports v2 API only.
  75. --discovery-proxy ''
  76. HTTP proxy to use for traffic to discovery service.
  77. --discovery-srv ''
  78. dns srv domain used to bootstrap the cluster.
  79. --strict-reconfig-check
  80. reject reconfiguration requests that would cause quorum loss.
  81. --auto-compaction-retention '0'
  82. auto compaction retention in hour. 0 means disable auto compaction.
  83. proxy flags:
  84. "proxy" supports v2 API only.
  85. --proxy 'off'
  86. proxy mode setting ('off', 'readonly' or 'on').
  87. --proxy-failure-wait 5000
  88. time (in milliseconds) an endpoint will be held in a failed state.
  89. --proxy-refresh-interval 30000
  90. time (in milliseconds) of the endpoints refresh interval.
  91. --proxy-dial-timeout 1000
  92. time (in milliseconds) for a dial to timeout.
  93. --proxy-write-timeout 5000
  94. time (in milliseconds) for a write to timeout.
  95. --proxy-read-timeout 0
  96. time (in milliseconds) for a read to timeout.
  97. security flags:
  98. --ca-file '' [DEPRECATED]
  99. path to the client server TLS CA file. '-ca-file ca.crt' could be replaced by '-trusted-ca-file ca.crt -client-cert-auth' and etcd will perform the same.
  100. --cert-file ''
  101. path to the client server TLS cert file.
  102. --key-file ''
  103. path to the client server TLS key file.
  104. --client-cert-auth 'false'
  105. enable client cert authentication.
  106. --trusted-ca-file ''
  107. path to the client server TLS trusted CA key file.
  108. --auto-tls 'false'
  109. client TLS using generated certificates.
  110. --peer-ca-file '' [DEPRECATED]
  111. path to the peer server TLS CA file. '-peer-ca-file ca.crt' could be replaced by '-peer-trusted-ca-file ca.crt -peer-client-cert-auth' and etcd will perform the same.
  112. --peer-cert-file ''
  113. path to the peer server TLS cert file.
  114. --peer-key-file ''
  115. path to the peer server TLS key file.
  116. --peer-client-cert-auth 'false'
  117. enable peer client cert authentication.
  118. --peer-trusted-ca-file ''
  119. path to the peer server TLS trusted CA file.
  120. --peer-auto-tls 'false'
  121. peer TLS using self-generated certificates if --peer-key-file and --peer-cert-file are not provided.
  122. logging flags
  123. --debug 'false'
  124. enable debug-level logging for etcd.
  125. --log-package-levels ''
  126. specify a particular log level for each etcd package (eg: 'etcdmain=CRITICAL,etcdserver=DEBUG').
  127. --log-output 'default'
  128. specify 'stdout' or 'stderr' to skip journald logging even when running under systemd.
  129. unsafe flags:
  130. Please be CAUTIOUS when using unsafe flags because it will break the guarantees
  131. given by the consensus protocol.
  132. --force-new-cluster 'false'
  133. force to create a new one-member cluster.
  134. profiling flags:
  135. --enable-pprof 'false'
  136. Enable runtime profiling data via HTTP server. Address is at client URL + "/debug/pprof/"
  137. --metrics 'basic'
  138. Set level of detail for exported metrics, specify 'extensive' to include histogram metrics.
  139. `
  140. )