diff --git a/Documentation/v2/04_to_2_snapshot_migration.md b/Documentation/v2/04_to_2_snapshot_migration.md index e84dc38db..28e174957 100644 --- a/Documentation/v2/04_to_2_snapshot_migration.md +++ b/Documentation/v2/04_to_2_snapshot_migration.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Snapshot Migration You can migrate a snapshot of your data from a v0.4.9+ cluster into a new etcd 2.2 cluster using a snapshot migration. After snapshot migration, the etcd indexes of your data will change. Many etcd applications rely on these indexes to behave correctly. This operation should only be done while all etcd applications are stopped. diff --git a/Documentation/v2/README.md b/Documentation/v2/README.md index df39c4766..9ead8780c 100644 --- a/Documentation/v2/README.md +++ b/Documentation/v2/README.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # etcd2 [![Go Report Card](https://goreportcard.com/badge/github.com/coreos/etcd)](https://goreportcard.com/report/github.com/coreos/etcd) diff --git a/Documentation/v2/admin_guide.md b/Documentation/v2/admin_guide.md index 78cc120f4..f3f4431e2 100644 --- a/Documentation/v2/admin_guide.md +++ b/Documentation/v2/admin_guide.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Administration ## Data Directory @@ -8,7 +13,7 @@ When first started, etcd stores its configuration into a data directory specifie Configuration is stored in the write ahead log and includes: the local member ID, cluster ID, and initial cluster configuration. The write ahead log and snapshot files are used during member operation and to recover after a restart. -Having a dedicated disk to store wal files can improve the throughput and stabilize the cluster. +Having a dedicated disk to store wal files can improve the throughput and stabilize the cluster. It is highly recommended to dedicate a wal disk and set `--wal-dir` to point to a directory on that device for a production cluster deployment. If a member’s data directory is ever lost or corrupted then the user should [remove][remove-a-member] the etcd member from the cluster using `etcdctl` tool. @@ -51,7 +56,7 @@ $ curl -L http://127.0.0.1:2379/health You can also use etcdctl to check the cluster-wide health information. It will contact all the members of the cluster and collect the health information for you. ``` -$./etcdctl cluster-health +$./etcdctl cluster-health member 8211f1d0f64f3269 is healthy: got healthy result from http://127.0.0.1:12379 member 91bc3c398fb3c146 is healthy: got healthy result from http://127.0.0.1:22379 member fd422379fda50e48 is healthy: got healthy result from http://127.0.0.1:32379 diff --git a/Documentation/v2/api.md b/Documentation/v2/api.md index b808a48f2..367873df0 100644 --- a/Documentation/v2/api.md +++ b/Documentation/v2/api.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # etcd API ## Running a Single Machine Cluster @@ -318,7 +323,7 @@ The first terminal should get the notification and return with the same response However, the watch command can do more than this. Using the index, we can watch for commands that have happened in the past. -This is useful for ensuring you don't miss events between watch commands. +This is useful for ensuring you don't miss events between watch commands. Typically, we watch again from the `modifiedIndex` + 1 of the node we got. Let's try to watch for the set command of index 7 again: @@ -338,13 +343,13 @@ curl 'http://127.0.0.1:2379/v2/keys/foo?wait=true&waitIndex=8' Then even if etcd is on index 9 or 800, the first event to occur to the `/foo` key between 8 and the current index will be returned. -**Note**: etcd only keeps the responses of the most recent 1000 events across all etcd keys. +**Note**: etcd only keeps the responses of the most recent 1000 events across all etcd keys. It is recommended to send the response to another thread to process immediately -instead of blocking the watch while processing the result. +instead of blocking the watch while processing the result. #### Watch from cleared event index -If we miss all the 1000 events, we need to recover the current state of the +If we miss all the 1000 events, we need to recover the current state of the watching key space through a get and then start to watch from the `X-Etcd-Index` + 1. @@ -366,7 +371,7 @@ To start watch, first we need to fetch the current state of key `/foo`: curl 'http://127.0.0.1:2379/v2/keys/foo' -vv ``` -``` +``` < HTTP/1.1 200 OK < Content-Type: application/json < X-Etcd-Cluster-Id: 7e27652122e8b2ae @@ -375,7 +380,7 @@ curl 'http://127.0.0.1:2379/v2/keys/foo' -vv < X-Raft-Term: 2 < Date: Mon, 05 Jan 2015 18:54:43 GMT < Transfer-Encoding: chunked -< +< {"action":"get","node":{"key":"/foo","value":"bar","modifiedIndex":7,"createdIndex":7}} ``` diff --git a/Documentation/v2/api_v3.md b/Documentation/v2/api_v3.md index 0bbaec158..e59a04e75 100644 --- a/Documentation/v2/api_v3.md +++ b/Documentation/v2/api_v3.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # etcd3 API TODO: API doc diff --git a/Documentation/v2/auth_api.md b/Documentation/v2/auth_api.md index a1f8a8785..225ba3a63 100644 --- a/Documentation/v2/auth_api.md +++ b/Documentation/v2/auth_api.md @@ -1,13 +1,18 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # v2 Auth and Security -## etcd Resources +## etcd Resources There are three types of resources in etcd 1. permission resources: users and roles in the user store 2. key-value resources: key-value pairs in the key-value store 3. settings resources: security settings, auth settings, and dynamic etcd cluster settings (election/heartbeat) -### Permission Resources +### Permission Resources #### Users A user is an identity to be authenticated. Each user can have multiple roles. The user has a capability (such as reading or writing) on the resource if one of the roles has that capability. @@ -15,7 +20,7 @@ A user is an identity to be authenticated. Each user can have multiple roles. Th A user named `root` is required before authentication can be enabled, and it always has the ROOT role. The ROOT role can be granted to multiple users, but `root` is required for recovery purposes. #### Roles -Each role has exact one associated Permission List. An permission list exists for each permission on key-value resources. +Each role has exact one associated Permission List. An permission list exists for each permission on key-value resources. The special static ROOT (named `root`) role has a full permissions on all key-value resources, the permission to manage user resources and settings resources. Only the ROOT role has the permission to manage user resources and modify settings resources. The ROOT role is built-in and does not need to be created. @@ -30,8 +35,8 @@ A Permission List is a list of allowed patterns for that particular permission ( ### Key-Value Resources A key-value resource is a key-value pairs in the store. Given a list of matching patterns, permission for any given key in a request is granted if any of the patterns in the list match. -Only prefixes or exact keys are supported. A prefix permission string ends in `*`. -A permission on `/foo` is for that exact key or directory, not its children or recursively. `/foo*` is a prefix that matches `/foo` recursively, and all keys thereunder, and keys with that prefix (eg. `/foobar`. Contrast to the prefix `/foo/*`). `*` alone is permission on the full keyspace. +Only prefixes or exact keys are supported. A prefix permission string ends in `*`. +A permission on `/foo` is for that exact key or directory, not its children or recursively. `/foo*` is a prefix that matches `/foo` recursively, and all keys thereunder, and keys with that prefix (eg. `/foobar`. Contrast to the prefix `/foo/*`). `*` alone is permission on the full keyspace. ### Settings Resources @@ -66,7 +71,7 @@ An Error JSON corresponds to: } #### Enable and Disable Authentication - + **Get auth status** GET /v2/auth/enable @@ -215,8 +220,8 @@ PUT /v2/auth/users/charlie Sent Headers: Authorization: Basic Put Body: - JSON struct, above, matching the appropriate name - * Starting password and roles when creating. + JSON struct, above, matching the appropriate name + * Starting password and roles when creating. * Grant/Revoke/Password filled in when updating (to grant roles, revoke roles, or change the password). Possible Status Codes: 200 OK @@ -345,7 +350,7 @@ PUT /v2/auth/roles/rkt 401 Unauthorized 404 Not Found (update non-existent roles) 409 Conflict (when granting duplicated permission or revoking non-existent permission) - 200 Body: + 200 Body: JSON state of the role **Remove A Role** diff --git a/Documentation/v2/authentication.md b/Documentation/v2/authentication.md index d7e0a1114..05adf0600 100644 --- a/Documentation/v2/authentication.md +++ b/Documentation/v2/authentication.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Authentication Guide ## Overview @@ -14,7 +19,7 @@ There is one special user, `root`, and there are two special roles, `root` and ` ### User `root` -User `root` must be created before security can be activated. It has the `root` role and allows for the changing of anything inside etcd. The idea behind the `root` user is for recovery purposes -- a password is generated and stored somewhere -- and the root role is granted to the administrator accounts on the system. In the future, for troubleshooting and recovery, we will need to assume some access to the system, and future documentation will assume this root user (though anyone with the role will suffice). +User `root` must be created before security can be activated. It has the `root` role and allows for the changing of anything inside etcd. The idea behind the `root` user is for recovery purposes -- a password is generated and stored somewhere -- and the root role is granted to the administrator accounts on the system. In the future, for troubleshooting and recovery, we will need to assume some access to the system, and future documentation will assume this root user (though anyone with the role will suffice). ### Role `root` @@ -104,7 +109,7 @@ $ etcdctl role grant myrolename -path '/foo/bar' -write $ etcdctl role grant myrolename -path '/pub/*' -readwrite ``` -Beware that +Beware that ``` # Give full access to keys under /pub?? @@ -133,12 +138,12 @@ $ etcdctl role remove myrolename ## Enabling authentication -The minimal steps to enabling auth are as follows. The administrator can set up users and roles before or after enabling authentication, as a matter of preference. +The minimal steps to enabling auth are as follows. The administrator can set up users and roles before or after enabling authentication, as a matter of preference. Make sure the root user is created: ``` -$ etcdctl user add root +$ etcdctl user add root New password: ``` diff --git a/Documentation/v2/backward_compatibility.md b/Documentation/v2/backward_compatibility.md index c8fdf96f7..3704325e7 100644 --- a/Documentation/v2/backward_compatibility.md +++ b/Documentation/v2/backward_compatibility.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Backward Compatibility The main goal of etcd 2.0 release is to improve cluster safety around bootstrapping and dynamic reconfiguration. To do this, we deprecated the old error-prone APIs and provide a new set of APIs. diff --git a/Documentation/v2/benchmarks/README.md b/Documentation/v2/benchmarks/README.md index 897112f32..881641a79 100644 --- a/Documentation/v2/benchmarks/README.md +++ b/Documentation/v2/benchmarks/README.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../../docs.md#documentation + + # Benchmarks etcd benchmarks will be published regularly and tracked for each release below: diff --git a/Documentation/v2/benchmarks/etcd-2-1-0-alpha-benchmarks.md b/Documentation/v2/benchmarks/etcd-2-1-0-alpha-benchmarks.md index afa465e97..1fc808ec4 100644 --- a/Documentation/v2/benchmarks/etcd-2-1-0-alpha-benchmarks.md +++ b/Documentation/v2/benchmarks/etcd-2-1-0-alpha-benchmarks.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../../docs.md#documentation + + ## Physical machines GCE n1-highcpu-2 machine type diff --git a/Documentation/v2/benchmarks/etcd-2-2-0-benchmarks.md b/Documentation/v2/benchmarks/etcd-2-2-0-benchmarks.md index c15244e77..2989c1a7d 100644 --- a/Documentation/v2/benchmarks/etcd-2-2-0-benchmarks.md +++ b/Documentation/v2/benchmarks/etcd-2-2-0-benchmarks.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../../docs.md#documentation + + # Benchmarking etcd v2.2.0 ## Physical Machines diff --git a/Documentation/v2/benchmarks/etcd-2-2-0-rc-benchmarks.md b/Documentation/v2/benchmarks/etcd-2-2-0-rc-benchmarks.md index 9d30cc44a..9170a644b 100644 --- a/Documentation/v2/benchmarks/etcd-2-2-0-rc-benchmarks.md +++ b/Documentation/v2/benchmarks/etcd-2-2-0-rc-benchmarks.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../../docs.md#documentation + + ## Physical machines GCE n1-highcpu-2 machine type diff --git a/Documentation/v2/benchmarks/etcd-2-2-0-rc-memory-benchmarks.md b/Documentation/v2/benchmarks/etcd-2-2-0-rc-memory-benchmarks.md index a8d9f1408..40c220eaa 100644 --- a/Documentation/v2/benchmarks/etcd-2-2-0-rc-memory-benchmarks.md +++ b/Documentation/v2/benchmarks/etcd-2-2-0-rc-memory-benchmarks.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../../docs.md#documentation + + ## Physical machine GCE n1-standard-2 machine type diff --git a/Documentation/v2/benchmarks/etcd-3-demo-benchmarks.md b/Documentation/v2/benchmarks/etcd-3-demo-benchmarks.md index 16e941d47..cb59d173c 100644 --- a/Documentation/v2/benchmarks/etcd-3-demo-benchmarks.md +++ b/Documentation/v2/benchmarks/etcd-3-demo-benchmarks.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../../docs.md#documentation + + ## Physical machines GCE n1-highcpu-2 machine type diff --git a/Documentation/v2/benchmarks/etcd-3-watch-memory-benchmark.md b/Documentation/v2/benchmarks/etcd-3-watch-memory-benchmark.md index 46507772f..56ae1a239 100644 --- a/Documentation/v2/benchmarks/etcd-3-watch-memory-benchmark.md +++ b/Documentation/v2/benchmarks/etcd-3-watch-memory-benchmark.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../../docs.md#documentation + + # Watch Memory Usage Benchmark *NOTE*: The watch features are under active development, and their memory usage may change as that development progresses. We do not expect it to significantly increase beyond the figures stated below. @@ -5,10 +10,10 @@ A primary goal of etcd is supporting a very large number of watchers doing a massively large amount of watching. etcd aims to support O(10k) clients, O(100K) watch streams (O(10) streams per client) and O(10M) total watchings (O(100) watching per stream). The memory consumed by each individual watching accounts for the largest portion of etcd's overall usage, and is therefore the focus of current and future optimizations. -Three related components of etcd watch consume physical memory: each `grpc.Conn`, each watch stream, and each instance of the watching activity. `grpc.Conn` maintains the actual TCP connection and other gRPC connection state. Each `grpc.Conn` consumes O(10kb) of memory, and might have multiple watch streams attached. +Three related components of etcd watch consume physical memory: each `grpc.Conn`, each watch stream, and each instance of the watching activity. `grpc.Conn` maintains the actual TCP connection and other gRPC connection state. Each `grpc.Conn` consumes O(10kb) of memory, and might have multiple watch streams attached. -Each watch stream is an independent HTTP2 connection which consumes another O(10kb) of memory. -Multiple watchings might share one watch stream. +Each watch stream is an independent HTTP2 connection which consumes another O(10kb) of memory. +Multiple watchings might share one watch stream. Watching is the actual struct that tracks the changes on the key-value store. Each watching should only consume < O(1kb). diff --git a/Documentation/v2/benchmarks/etcd-storage-memory-benchmark.md b/Documentation/v2/benchmarks/etcd-storage-memory-benchmark.md index 3834a1922..3f75b7920 100644 --- a/Documentation/v2/benchmarks/etcd-storage-memory-benchmark.md +++ b/Documentation/v2/benchmarks/etcd-storage-memory-benchmark.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../../docs.md#documentation + + # Storage Memory Usage Benchmark @@ -60,7 +65,7 @@ GCE n1-standard-2 machine type In this test, we only benchmark the memory usage of the in-memory index. The goal is to find `c1` and `c2` mentioned above and to understand the hard limit of memory consumption of the storage. -We calculate the memory usage consumption via the Go runtime.ReadMemStats. We calculate the total allocated bytes difference before creating the index and after creating the index. It cannot perfectly reflect the memory usage of the in-memory index itself but can show the rough consumption pattern. +We calculate the memory usage consumption via the Go runtime.ReadMemStats. We calculate the total allocated bytes difference before creating the index and after creating the index. It cannot perfectly reflect the memory usage of the in-memory index itself but can show the rough consumption pattern. | N | versions | key size | memory usage | |------|----------|----------|--------------| diff --git a/Documentation/v2/branch_management.md b/Documentation/v2/branch_management.md index dcea5a36c..45b273542 100644 --- a/Documentation/v2/branch_management.md +++ b/Documentation/v2/branch_management.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Branch Management ## Guide diff --git a/Documentation/v2/clustering.md b/Documentation/v2/clustering.md index 1151ef122..f9c3e08f7 100644 --- a/Documentation/v2/clustering.md +++ b/Documentation/v2/clustering.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Clustering Guide ## Overview diff --git a/Documentation/v2/configuration.md b/Documentation/v2/configuration.md index 3960c7962..0cc146dc0 100644 --- a/Documentation/v2/configuration.md +++ b/Documentation/v2/configuration.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Configuration Flags etcd is configurable through command-line flags and environment variables. Options set on the command line take precedence over those from the environment. diff --git a/Documentation/v2/dev/release.md b/Documentation/v2/dev/release.md index 6db86a241..bbf061da7 100644 --- a/Documentation/v2/dev/release.md +++ b/Documentation/v2/dev/release.md @@ -1,8 +1,13 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../../docs.md#documentation + + # etcd release guide The guide talks about how to release a new version of etcd. -The procedure includes some manual steps for sanity checking but it can probably be further scripted. Please keep this document up-to-date if you want to make changes to the release process. +The procedure includes some manual steps for sanity checking but it can probably be further scripted. Please keep this document up-to-date if you want to make changes to the release process. ## Prepare Release diff --git a/Documentation/v2/discovery_protocol.md b/Documentation/v2/discovery_protocol.md index c78a4c616..b9479ac39 100644 --- a/Documentation/v2/discovery_protocol.md +++ b/Documentation/v2/discovery_protocol.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Discovery Service Protocol Discovery service protocol helps new etcd member to discover all other members in cluster bootstrap phase using a shared discovery URL. diff --git a/Documentation/v2/docker_guide.md b/Documentation/v2/docker_guide.md index 917268fae..74dd90688 100644 --- a/Documentation/v2/docker_guide.md +++ b/Documentation/v2/docker_guide.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Running etcd under Docker The following guide will show you how to run etcd under Docker using the [static bootstrap process](clustering.md#static). diff --git a/Documentation/v2/errorcode.md b/Documentation/v2/errorcode.md index 0078d7a04..4caf22a5b 100644 --- a/Documentation/v2/errorcode.md +++ b/Documentation/v2/errorcode.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Error Code ====== diff --git a/Documentation/v2/faq.md b/Documentation/v2/faq.md index 0e2a0ffc8..c0faa41e0 100644 --- a/Documentation/v2/faq.md +++ b/Documentation/v2/faq.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # FAQ ## 1) Why can an etcd client read an old version of data when a majority of the etcd cluster members are down? diff --git a/Documentation/v2/glossary.md b/Documentation/v2/glossary.md index e9ed840e8..70c2d40ee 100644 --- a/Documentation/v2/glossary.md +++ b/Documentation/v2/glossary.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Glossary This document defines the various terms used in etcd documentation, command line and source code. diff --git a/Documentation/v2/implementation-faq.md b/Documentation/v2/implementation-faq.md index d6d68d713..027c47aaf 100644 --- a/Documentation/v2/implementation-faq.md +++ b/Documentation/v2/implementation-faq.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # FAQ ## Initial Bootstrapping UX diff --git a/Documentation/v2/internal-protocol-versioning.md b/Documentation/v2/internal-protocol-versioning.md index 6df1fd402..68d716e5f 100644 --- a/Documentation/v2/internal-protocol-versioning.md +++ b/Documentation/v2/internal-protocol-versioning.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Versioning Goal: We want to be able to upgrade an individual peer in an etcd cluster to a newer version of etcd. diff --git a/Documentation/v2/libraries-and-tools.md b/Documentation/v2/libraries-and-tools.md index 3e51ca333..806a5d902 100644 --- a/Documentation/v2/libraries-and-tools.md +++ b/Documentation/v2/libraries-and-tools.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Libraries and Tools **Tools** diff --git a/Documentation/v2/members_api.md b/Documentation/v2/members_api.md index 9c52fe790..a9ff6a043 100644 --- a/Documentation/v2/members_api.md +++ b/Documentation/v2/members_api.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Members API * [List members](#list-members) diff --git a/Documentation/v2/metrics.md b/Documentation/v2/metrics.md index 857d1934e..596c14b64 100644 --- a/Documentation/v2/metrics.md +++ b/Documentation/v2/metrics.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Metrics etcd uses [Prometheus][prometheus] for metrics reporting. The metrics can be used for real-time monitoring and debugging. etcd does not persist its metrics; if a member restarts, the metrics will be reset. @@ -14,9 +19,9 @@ The metrics under the `etcd` prefix are for monitoring and alerting. They are st ### http requests -These metrics describe the serving of requests (non-watch events) served by etcd members in non-proxy mode: total +These metrics describe the serving of requests (non-watch events) served by etcd members in non-proxy mode: total incoming requests, request failures and processing latency (inc. raft rounds for storage). They are useful for tracking - user-generated traffic hitting the etcd cluster . + user-generated traffic hitting the etcd cluster . All these metrics are prefixed with `etcd_http_` @@ -28,20 +33,20 @@ All these metrics are prefixed with `etcd_http_` Example Prometheus queries that may be useful from these metrics (across all etcd members): - - * `sum(rate(etcd_http_failed_total{job="etcd"}[1m]) by (method) / sum(rate(etcd_http_events_received_total{job="etcd"})[1m]) by (method)` - + + * `sum(rate(etcd_http_failed_total{job="etcd"}[1m]) by (method) / sum(rate(etcd_http_events_received_total{job="etcd"})[1m]) by (method)` + Shows the fraction of events that failed by HTTP method across all members, across a time window of `1m`. - + * `sum(rate(etcd_http_received_total{job="etcd",method="GET})[1m]) by (method)` `sum(rate(etcd_http_received_total{job="etcd",method~="GET})[1m]) by (method)` - + Shows the rate of successful readonly/write queries across all servers, across a time window of `1m`. - + * `histogram_quantile(0.9, sum(rate(etcd_http_successful_duration_seconds{job="etcd",method="GET"}[5m]) ) by (le))` `histogram_quantile(0.9, sum(rate(etcd_http_successful_duration_seconds{job="etcd",method!="GET"}[5m]) ) by (le))` - - Show the 0.90-tile latency (in seconds) of read/write (respectively) event handling across all members, with a window of `5m`. + + Show the 0.90-tile latency (in seconds) of read/write (respectively) event handling across all members, with a window of `5m`. ### proxy @@ -56,21 +61,21 @@ All these metrics are prefixed with `etcd_proxy_` | requests_total | Total number of requests by this proxy instance. | Counter(method) | | handled_total | Total number of fully handled requests, with responses from etcd members. | Counter(method) | | dropped_total | Total number of dropped requests due to forwarding errors to etcd members.  | Counter(method,error) | -| handling_duration_seconds | Bucketed handling times by HTTP method, including round trip to member instances. | Histogram(method) | +| handling_duration_seconds | Bucketed handling times by HTTP method, including round trip to member instances. | Histogram(method) | Example Prometheus queries that may be useful from these metrics (across all etcd servers): * `sum(rate(etcd_proxy_handled_total{job="etcd"}[1m])) by (method)` - - Rate of requests (by HTTP method) handled by all proxies, across a window of `1m`. + + Rate of requests (by HTTP method) handled by all proxies, across a window of `1m`. * `histogram_quantile(0.9, sum(rate(handling_duration_seconds{job="etcd",method="GET"}[5m])) by (le))` `histogram_quantile(0.9, sum(rate(handling_duration_seconds{job="etcd",method!="GET"}[5m])) by (le))` - - Show the 0.90-tile latency (in seconds) of handling of user requests across all proxy machines, with a window of `5m`. - + + Show the 0.90-tile latency (in seconds) of handling of user requests across all proxy machines, with a window of `5m`. + * `sum(rate(etcd_proxy_dropped_total{job="etcd"}[1m])) by (proxying_error)` - + Number of failed request on the proxy. This should be 0, spikes here indicate connectivity issues to the etcd cluster. ## etcd_debugging namespace metrics diff --git a/Documentation/v2/other_apis.md b/Documentation/v2/other_apis.md index 29866a445..339d9f8e5 100644 --- a/Documentation/v2/other_apis.md +++ b/Documentation/v2/other_apis.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Miscellaneous APIs * [Getting the etcd version](#getting-the-etcd-version) diff --git a/Documentation/v2/platforms/freebsd.md b/Documentation/v2/platforms/freebsd.md index c84ac5a19..891ea6f53 100644 --- a/Documentation/v2/platforms/freebsd.md +++ b/Documentation/v2/platforms/freebsd.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../../docs.md#documentation + + # FreeBSD Starting with version 0.1.2 both etcd and etcdctl have been ported to FreeBSD and can diff --git a/Documentation/v2/production-users.md b/Documentation/v2/production-users.md index 893fe66c2..addef2a92 100644 --- a/Documentation/v2/production-users.md +++ b/Documentation/v2/production-users.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Production Users This document tracks people and use cases for etcd in production. By creating a list of production use cases we hope to build a community of advisors that we can reach out to with experience using various etcd applications, operation environments, and cluster sizes. The etcd development team may reach out periodically to check-in on your experience and update this list. diff --git a/Documentation/v2/proxy.md b/Documentation/v2/proxy.md index af6a47733..1489b0152 100644 --- a/Documentation/v2/proxy.md +++ b/Documentation/v2/proxy.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Proxy etcd can run as a transparent proxy. Doing so allows for easy discovery of etcd within your infrastructure, since it can run on each machine as a local service. In this mode, etcd acts as a reverse proxy and forwards client requests to an active etcd cluster. The etcd proxy does not participate in the consensus replication of the etcd cluster, thus it neither increases the resilience nor decreases the write performance of the etcd cluster. diff --git a/Documentation/v2/reporting_bugs.md b/Documentation/v2/reporting_bugs.md index f632632e0..1f5880faa 100644 --- a/Documentation/v2/reporting_bugs.md +++ b/Documentation/v2/reporting_bugs.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Reporting Bugs If you find bugs or documentation mistakes in the etcd project, please let us know by [opening an issue][etcd-issue]. We treat bugs and mistakes very seriously and believe no issue is too small. Before creating a bug report, please check that an issue reporting the same problem does not already exist. diff --git a/Documentation/v2/rfc/v3api.md b/Documentation/v2/rfc/v3api.md index c082e3fde..18567d36b 100644 --- a/Documentation/v2/rfc/v3api.md +++ b/Documentation/v2/rfc/v3api.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../../docs.md#documentation + + # Overview The etcd v3 API is designed to give users a more efficient and cleaner abstraction compared to etcd v2. There are a number of semantic and protocol changes in this new API. For an overview [see Xiang Li's video](https://youtu.be/J5AioGtEPeQ?t=211). diff --git a/Documentation/v2/runtime-configuration.md b/Documentation/v2/runtime-configuration.md index c15a4896b..a6b57b916 100644 --- a/Documentation/v2/runtime-configuration.md +++ b/Documentation/v2/runtime-configuration.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Runtime Reconfiguration etcd comes with support for incremental runtime reconfiguration, which allows users to update the membership of the cluster at run time. @@ -61,9 +66,9 @@ A wrongly updated client URL will not affect the health of the etcd cluster. #### Update advertise peer URLs -If you would like to update the advertise peer URLs of a member, you have to first update +If you would like to update the advertise peer URLs of a member, you have to first update it explicitly via member command and then restart the member. The additional action is required -since updating peer URLs changes the cluster wide configuration and can affect the health of the etcd cluster. +since updating peer URLs changes the cluster wide configuration and can affect the health of the etcd cluster. To update the peer URLs, first, we need to find the target member's ID. You can list all members with `etcdctl`: diff --git a/Documentation/v2/runtime-reconf-design.md b/Documentation/v2/runtime-reconf-design.md index d57727865..8232d11d2 100644 --- a/Documentation/v2/runtime-reconf-design.md +++ b/Documentation/v2/runtime-reconf-design.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Design of Runtime Reconfiguration Runtime reconfiguration is one of the hardest and most error prone features in a distributed system, especially in a consensus based system like etcd. @@ -26,21 +31,21 @@ We think runtime reconfiguration should be a low frequent operation. We made the If a cluster permanently loses a majority of its members, a new cluster will need to be started from an old data directory to recover the previous state. -It is entirely possible to force removing the failed members from the existing cluster to recover. However, we decided not to support this method since it bypasses the normal consensus committing phase, which is unsafe. If the member to remove is not actually dead or you force to remove different members through different members in the same cluster, you will end up with diverged cluster with same clusterID. This is very dangerous and hard to debug/fix afterwards. +It is entirely possible to force removing the failed members from the existing cluster to recover. However, we decided not to support this method since it bypasses the normal consensus committing phase, which is unsafe. If the member to remove is not actually dead or you force to remove different members through different members in the same cluster, you will end up with diverged cluster with same clusterID. This is very dangerous and hard to debug/fix afterwards. If you have a correct deployment, the possibility of permanent majority lose is very low. But it is a severe enough problem that worth special care. We strongly suggest you to read the [disaster recovery documentation][disaster-recovery] and prepare for permanent majority lose before you put etcd into production. ## Do Not Use Public Discovery Service For Runtime Reconfiguration -The public discovery service should only be used for bootstrapping a cluster. To join member into an existing cluster, you should use runtime reconfiguration API. +The public discovery service should only be used for bootstrapping a cluster. To join member into an existing cluster, you should use runtime reconfiguration API. Discovery service is designed for bootstrapping an etcd cluster in the cloud environment, when you do not know the IP addresses of all the members beforehand. After you successfully bootstrap a cluster, the IP addresses of all the members are known. Technically, you should not need the discovery service any more. -It seems that using public discovery service is a convenient way to do runtime reconfiguration, after all discovery service already has all the cluster configuration information. However relying on public discovery service brings troubles: +It seems that using public discovery service is a convenient way to do runtime reconfiguration, after all discovery service already has all the cluster configuration information. However relying on public discovery service brings troubles: 1. it introduces external dependencies for the entire life-cycle of your cluster, not just bootstrap time. If there is a network issue between your cluster and public discovery service, your cluster will suffer from it. - -2. public discovery service must reflect correct runtime configuration of your cluster during it life-cycle. It has to provide security mechanism to avoid bad actions, and it is hard. + +2. public discovery service must reflect correct runtime configuration of your cluster during it life-cycle. It has to provide security mechanism to avoid bad actions, and it is hard. 3. public discovery service has to keep tens of thousands of cluster configurations. Our public discovery service backend is not ready for that workload. diff --git a/Documentation/v2/security.md b/Documentation/v2/security.md index 86871dda7..2fd196fd0 100644 --- a/Documentation/v2/security.md +++ b/Documentation/v2/security.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Security Model etcd supports SSL/TLS as well as authentication through client certificates, both for clients to server as well as peer (server to server / cluster) communication. diff --git a/Documentation/v2/tuning.md b/Documentation/v2/tuning.md index 8513b5206..290e887cd 100644 --- a/Documentation/v2/tuning.md +++ b/Documentation/v2/tuning.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Tuning The default settings in etcd should work well for installations on a local network where the average network latency is low. diff --git a/Documentation/v2/upgrade_2_1.md b/Documentation/v2/upgrade_2_1.md index 8c83db953..07ce35776 100644 --- a/Documentation/v2/upgrade_2_1.md +++ b/Documentation/v2/upgrade_2_1.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Upgrade etcd to 2.1 In the general case, upgrading from etcd 2.0 to 2.1 can be a zero-downtime, rolling upgrade: @@ -12,11 +17,11 @@ Before [starting an upgrade](#upgrade-procedure), read through the rest of this To upgrade an existing etcd deployment to 2.1, you must be running 2.0. If you’re running a version of etcd before 2.0, you must upgrade to [2.0][v2.0] before upgrading to 2.1. -Also, to ensure a smooth rolling upgrade, your running cluster must be healthy. You can check the health of the cluster by using `etcdctl cluster-health` command. +Also, to ensure a smooth rolling upgrade, your running cluster must be healthy. You can check the health of the cluster by using `etcdctl cluster-health` command. -### Preparedness +### Preparedness -Before upgrading etcd, always test the services relying on etcd in a staging environment before deploying the upgrade to the production environment. +Before upgrading etcd, always test the services relying on etcd in a staging environment before deploying the upgrade to the production environment. You might also want to [backup your data directory][backup-datastore] for a potential [downgrade](#downgrade). @@ -38,7 +43,7 @@ If you have even more data, this might take more time. If you have a data size l ### Downgrade -If all members have been upgraded to v2.1, the cluster will be upgraded to v2.1, and downgrade is **not possible**. If any member is still v2.0, the cluster will remain in v2.0, and you can go back to use v2.0 binary. +If all members have been upgraded to v2.1, the cluster will be upgraded to v2.1, and downgrade is **not possible**. If any member is still v2.0, the cluster will remain in v2.0, and you can go back to use v2.0 binary. Please [backup your data directory][backup-datastore] of all etcd members if you want to downgrade the cluster, even if it is upgraded. @@ -96,7 +101,7 @@ member 924e2e83e93f2560 is healthy member a8266ecf031671f3 is healthy ``` -#### 4. Repeat step 2 to step 3 for all other members +#### 4. Repeat step 2 to step 3 for all other members #### 5. Finish diff --git a/Documentation/v2/upgrade_2_2.md b/Documentation/v2/upgrade_2_2.md index 2f3edb005..76fcf811e 100644 --- a/Documentation/v2/upgrade_2_2.md +++ b/Documentation/v2/upgrade_2_2.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + # Upgrade etcd from 2.1 to 2.2 In the general case, upgrading from etcd 2.1 to 2.2 can be a zero-downtime, rolling upgrade: @@ -13,11 +18,11 @@ Before [starting an upgrade](#upgrade-procedure), read through the rest of this To upgrade an existing etcd deployment to 2.2, you must be running 2.1. If you’re running a version of etcd before 2.1, you must upgrade to [2.1][v2.1] before upgrading to 2.2. -Also, to ensure a smooth rolling upgrade, your running cluster must be healthy. You can check the health of the cluster by using `etcdctl cluster-health` command. +Also, to ensure a smooth rolling upgrade, your running cluster must be healthy. You can check the health of the cluster by using `etcdctl cluster-health` command. -### Preparedness +### Preparedness -Before upgrading etcd, always test the services relying on etcd in a staging environment before deploying the upgrade to the production environment. +Before upgrading etcd, always test the services relying on etcd in a staging environment before deploying the upgrade to the production environment. You might also want to [backup the data directory][backup-datastore] for a potential [downgrade]. @@ -31,11 +36,11 @@ Internally, etcd members negotiate with each other to determine the overall etcd If you have a data size larger than 100MB you should contact us before upgrading, so we can make sure the upgrades work smoothly. -Every etcd 2.2 member will do health checking across the cluster periodically. etcd 2.1 member does not support health checking. During the upgrade, etcd 2.2 member will log warning about the unhealthy state of etcd 2.1 member. You can ignore the warning. +Every etcd 2.2 member will do health checking across the cluster periodically. etcd 2.1 member does not support health checking. During the upgrade, etcd 2.2 member will log warning about the unhealthy state of etcd 2.1 member. You can ignore the warning. ### Downgrade -If all members have been upgraded to v2.2, the cluster will be upgraded to v2.2, and downgrade is **not possible**. If any member is still v2.1, the cluster will remain in v2.1, and you can go back to use v2.1 binary. +If all members have been upgraded to v2.2, the cluster will be upgraded to v2.2, and downgrade is **not possible**. If any member is still v2.1, the cluster will remain in v2.1, and you can go back to use v2.1 binary. Please [backup the data directory][backup-datastore] of all etcd members if you want to downgrade the cluster, even if it is upgraded. @@ -112,7 +117,7 @@ member a8266ecf031671f3 is healthy: got healthy result from http://localhost:123 cluster is healthy ``` -#### 4. Repeat step 2 to step 3 for all other members +#### 4. Repeat step 2 to step 3 for all other members #### 5. Finish diff --git a/Documentation/v2/upgrade_2_3.md b/Documentation/v2/upgrade_2_3.md index 34d948e6a..95ddbbf41 100644 --- a/Documentation/v2/upgrade_2_3.md +++ b/Documentation/v2/upgrade_2_3.md @@ -1,3 +1,8 @@ +**This is the documentation for etcd2 releases. Read [etcd3 doc][v3-docs] for etcd3 releases.** + +[v3-docs]: ../docs.md#documentation + + ## Upgrade etcd from 2.2 to 2.3 In the general case, upgrading from etcd 2.2 to 2.3 can be a zero-downtime, rolling upgrade: