Commit Graph

114 Commits (06f89cc4f8b7e9920abaff794145ceb790b2795d)

Author SHA1 Message Date
cfc4n d507ab4aad auth: Customize simpleTokenTTL settings.
see https://github.com/etcd-io/etcd/issues/11978 for more detail.
2020-06-11 17:15:42 +08:00
David Crawshaw 66cb045d47 etcdserver, et al: add --unsafe-no-fsync flag
This makes it possible to run an etcd node for testing and development
without placing lots of load on the file system.

Fixes #11930.

Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
2020-05-26 09:21:49 +10:00
Brandon Philips 96cce208c2 go.mod: use go.etcd.io/etcd/v3 versioning
This change makes the etcd package compatible with the existing Go
ecosystem for module versioning.

Used this tool to update package imports:
  https://github.com/KSubedi/gomove
2020-04-28 00:57:35 +00:00
jingyih 725e09023a *: set zap as default logger, remove capnslog
Set zap as default logger. Remove capnslog and deprecated logging
flags.
2020-02-04 04:57:49 -08:00
Joe Betz 9b51febaf5 *: Add experimental-compaction-batch-limit flag 2019-08-15 11:47:23 -07:00
Jingyi Hu e67b9829b6 *: enable lease checkpoint via experimental flag
Primary lessor persist lease remainingTTL only if experimental flag
"--experimental-enable-lease-checkpoint" is set.
2019-06-05 15:30:03 -07:00
Gyuho Lee 34bd797e67 *: revert module import paths
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2019-05-28 15:39:35 -07:00
shivaramr 9150bf52d6 go modules: Fix module path version to include version number 2019-04-26 15:29:50 -07:00
WizardCXY e6c6d8492e *: add flag to let etcd use the new boltdb freelistType feature 2019-02-14 11:07:08 +08:00
Hitoshi Mitake 72dd4a18c5 *: add a new option --enable-grpc-gateway for enabling/disabling grpc gateway 2019-01-23 03:26:34 +09:00
Xiang Li 3faed211e5 *: add flags to setup backend related config 2018-11-26 15:50:26 -08:00
Shin'ya Ueoka aa4313a55a *: fix github links 2018-11-10 11:14:18 +09:00
Gyuho Lee 1399bc69ce etcdserver: update import paths to "go.etcd.io/etcd"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 17:47:55 -07:00
Joe Betz 2edb954bce
lease: Checkpoint lease TTLs to prevent indefinite auto-renewal of long lived leases 2018-07-23 16:12:34 -07:00
Gyuho Lee ddf45cb958 etcdserver: remove configuration print methods
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-07-09 11:26:23 -07:00
Gyuho Lee 52ffe9f79a etcdserver: clean up election tick timeout log output
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-06-15 13:35:25 -07:00
Gyuho Lee 49d672ff9b etcdserver: rename "SnapshotCount", add "SnapshotCatchUpEntries"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-05-18 14:37:50 -07:00
Jiang Xuan bf432648ae *: make bcrypt-cost configurable 2018-05-03 11:43:32 -07:00
Gyuho Lee 0e565c8960 etcdserver: use structured logging in "advertiseMatchesCluster"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-27 11:40:30 -07:00
Gyuho Lee 3ea7a5d0bd etcdserver: add "LoggerCore" field for Raft logger
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-25 10:16:54 -07:00
Gyuho Lee 4f45f5d9dd
Merge pull request #9591 from gyuho/election
*: add --initial-election-tick-advance to configure election fast-forward on bootstrap
2018-04-23 10:17:49 -07:00
Gyuho Lee 83f7f174da etcdserver: print server configuration duration fields in string
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-20 13:11:11 -07:00
Gyuho Lee 5f8abdc227 etcdserver: log auto compaction on server start
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-20 11:58:36 -07:00
Gyuho Lee 21d2e2ab6e etcdserver: add more tick fast-forward logs
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-19 17:45:23 -07:00
Gyuho Lee 4bec0d7d67 etcdserver: add "InitialElectionTickAdvance"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-19 17:45:23 -07:00
Gyuho Lee a47c18ff5b embed: clean up initial server start logs
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-17 14:24:08 -07:00
Gyuho Lee 041b9069a2 *: configure server logger
- Add/Document "logger" to support structured logging.
  - This makes functional tests run easier, since zap logger
    provides built-in log redirect to files.
  - "etcd --logger-option=zap" to enable structured logging.
- Current "capnslog" will still be used as "default".
  - We may switch the default or deprecate "capnslog" in v3.5.
  - Either way, will clearly be documented.

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-04-16 17:36:00 -07:00
Gyuho Lee c841de1f62 etcdserver: add "CORS" field to "ServerConfig"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-27 06:25:44 -07:00
Gyuho Lee 9af05a45d4 etcdserver: move "unsafe" flags to bottom
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-23 19:44:24 -07:00
Gyuho Lee 78918848bd etcdserver: support Raft Pre-Vote
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-03-06 09:55:55 -08:00
Gyuho Lee 3648649277 etcdserver: add "HostWhitelist" to "ServerConfig"
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-02-28 18:25:28 -08:00
Gyuho Lee 2b10bcccee etcdserver: add error details on DNS resolution failure on advertise URLs
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-25 10:35:36 -08:00
Gyuho Lee 9e11ef3ad5 etcdserver,embed: discard gRPC info logs when debug is off
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
2018-01-02 09:29:07 -08:00
Gyu-Ho Lee 3db5ad8d57 embed,etcdmain: add "--experimental-initial-corrupt-check"
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-11-22 15:27:14 -08:00
fanmin shi 733de98cfb *: modify etcd flags to support finner compaction retention 2017-09-28 17:22:44 -07:00
Xiang 35e285674b etcdserver: make tick duration calculation clear 2017-09-23 15:43:12 -07:00
Xiang 230323255a etcdserver: make dial timeout longer 2017-09-22 14:56:41 -07:00
Gyu-Ho Lee f65aee0759 *: replace 'golang.org/x/net/context' with 'context'
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-09-07 13:39:42 -07:00
Anthony Romano 31381da53a etcdserver: raise alarm on cluster corruption
Fixes #7125
2017-08-22 09:59:59 -07:00
Iwasaki Yudai a3f8f47422 *: add Revision compactor 2017-06-21 15:41:07 -07:00
Anthony Romano 7ff5b05004 etcdserver: better warning when initial-cluster doesn't match advertise urls
The old error was not clear about what URLs needed to be added, sometimes
truncating the list. To make it clearer, print out the missing entries
for --initial-cluster and print the full list of initial advertise peers.

Fixes #8079 and #7927
2017-06-12 14:14:16 -07:00
fanmin shi 9e7740011b etcdserver: add --max-request-bytes flag 2017-05-25 11:01:38 -07:00
fanmin shi ae7ddfb483 etcdserver: add --max-txn-ops flag
--max-txn-ops allows users to define the maximum transaction operations
for each txn request. it defaults at 128.

Fixes #7826
2017-05-24 10:32:32 -07:00
Anthony Romano f6cd4d4f5b snap, etcdserver: tighten up snapshot path handling
Computing the snapshot file path is error prone; snapshot recovery was
constructing file paths missing a path separator so the snapshot
would never be loaded. Instead, refactor the backend path handling
to use helper functions where possible.
2017-05-11 13:46:59 -07:00
Anthony Romano 2f1542c06d *: use filepath.Join for files 2017-03-16 07:46:06 -07:00
Hitoshi Mitake f8a290e7ca *: support jwt token in v3 auth API
This commit adds jwt token support in v3 auth API.

Remaining major ToDos:
- Currently token type isn't hidden from etcdserver. In the near
  future the information should be completely invisible from
  etcdserver package.
- Configurable expiration of token. Currently tokens can be valid
  until keys are changed.

How to use:
1. generate keys for signing and verfying jwt tokens:
 $ openssl genrsa -out app.rsa 1024
 $ openssl rsa -in app.rsa -pubout > app.rsa.pub
2.  add command line options to etcd like below:
--auth-token-type jwt \
--auth-jwt-pub-key app.rsa.pub --auth-jwt-priv-key app.rsa \
--auth-jwt-sign-method RS512
3. launch etcd cluster

Below is a performance comparison of serializable read w/ and w/o jwt
token. Every (3) etcd node is executed on a single machine. Signing
method is RS512 and key length is 1024 bit. As the results show, jwt
based token introduces a performance overhead but it would be
acceptable for a case that requires authentication.

w/o jwt token auth (no auth):

Summary:
  Total:        1.6172 secs.
  Slowest:      0.0125 secs.
  Fastest:      0.0001 secs.
  Average:      0.0002 secs.
  Stddev:       0.0004 secs.
  Requests/sec: 6183.5877

Response time histogram:
  0.000 [1]     |
  0.001 [9982]  |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.003 [1]     |
  0.004 [1]     |
  0.005 [0]     |
  0.006 [0]     |
  0.008 [6]     |
  0.009 [0]     |
  0.010 [1]     |
  0.011 [5]     |
  0.013 [3]     |

Latency distribution:
  10% in 0.0001 secs.
  25% in 0.0001 secs.
  50% in 0.0001 secs.
  75% in 0.0001 secs.
  90% in 0.0002 secs.
  95% in 0.0002 secs.
  99% in 0.0003 secs.

w/ jwt token auth:

Summary:
  Total:        2.5364 secs.
  Slowest:      0.0182 secs.
  Fastest:      0.0002 secs.
  Average:      0.0003 secs.
  Stddev:       0.0005 secs.
  Requests/sec: 3942.5185

Response time histogram:
  0.000 [1]     |
  0.002 [9975]  |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.004 [0]     |
  0.006 [1]     |
  0.007 [11]    |
  0.009 [2]     |
  0.011 [4]     |
  0.013 [5]     |
  0.015 [0]     |
  0.016 [0]     |
  0.018 [1]     |

Latency distribution:
  10% in 0.0002 secs.
  25% in 0.0002 secs.
  50% in 0.0002 secs.
  75% in 0.0002 secs.
  90% in 0.0003 secs.
  95% in 0.0003 secs.
  99% in 0.0004 secs.
2017-03-06 19:46:03 -08:00
Anthony Romano 29c30b2387 etcdserver: retry for 30s on advertise url check 2016-12-14 15:56:22 -08:00
Anthony Romano 2c06def8ca etcdserver, embed, v2http: move pprof setup to embed
Seems like a better place for prof setup since it's not specific to v2.
2016-12-09 12:37:35 -08:00
sharat 1fec4ba127 etcdserver: optimized veryfying local member
moved the code for perparing and sorting of advertising peer urls and
sorting of peer urls only when strict verification needs to be done.
This is done to avoid this processing when strict verification is not
required like in case of VerifyJoinExisting function.

#6165
2016-08-13 06:17:21 +05:30
Gyu-Ho Lee 9510bd6036 etcdserver: add 'ClientCertAuthEnabled' option 2016-07-20 16:22:59 -07:00