Open-Source Wikis

/

etcd

/

Reference

/

Configuration

etcd-io/etcd

Configuration

The full source of truth for every flag is server/embed/config.go (Config struct + Validate/parse). The companion etcd.conf.yml.sample at the repo root demonstrates every option in YAML form.

Where to look

  • server/embed/config.go — the Config struct and all defaults (DefaultName, DefaultMaxSnapshots, ...).
  • server/embed/config_logging.go, config_tracing.go — logging and tracing parsing.
  • server/etcdmain/help.go — the long-form --help text.
  • etcd.conf.yml.sample — annotated YAML.
  • server/embed/etcd.goembed.StartEtcd(cfg) validates and starts.
  • server/etcdmain/grpc_proxy.go and gateway.go — separate flag sets for those modes.

Headline flags (member mode)

Identity and bootstrap

Flag Default Notes
--name default Human name for this member
--data-dir ${name}.etcd Where WAL + bbolt + snapshots live
--wal-dir <data-dir>/member/wal Override WAL location for performance
--initial-cluster empty Static topology spec
--initial-cluster-state new new or existing
--initial-cluster-token etcd-cluster Disambiguates clusters with overlapping member IDs
--discovery empty Legacy v2 discovery URL
--discovery-srv empty DNS SRV-based discovery domain
--discovery-fallback proxy exit or proxy if discovery fails

Networking

Flag Default Notes
--listen-peer-urls http://localhost:2380 Peer-to-peer transport URLs
--listen-client-urls http://localhost:2379 Client gRPC + REST URLs
--initial-advertise-peer-urls matches --listen-peer-urls Advertised to peers
--advertise-client-urls matches --listen-client-urls Advertised to clients
--max-request-bytes ~1.5 MiB Server-side request size cap
--grpc-keepalive-min-time / -interval / -timeout 5s / 2h / 20s gRPC keepalive
--max-concurrent-streams unlimited gRPC MaxConcurrentStreams

Storage

Flag Default Notes
--quota-backend-bytes 0 (= 2 GiB) NOSPACE alarm threshold
--snapshot-count 10000 Raft snapshot every N committed entries
--max-snapshots 5 Snapshot file retention
--max-wals 5 WAL file retention
--auto-compaction-mode periodic periodic or revision
--auto-compaction-retention 0 (off) Duration or revision count
--backend-batch-interval 100 ms bbolt commit cadence
--backend-batch-limit 10000 Ops per commit
--backend-bbolt-freelist-type array bbolt freelist type

TLS

Flag Default Notes
--cert-file, --key-file empty Client-facing TLS material
--client-cert-auth false Require client cert
--trusted-ca-file empty CA used to validate client certs
--auto-tls false Self-sign on first start (dev only)
--peer-cert-file, --peer-key-file, --peer-trusted-ca-file, --peer-client-cert-auth, --peer-auto-tls empty/false Peer counterparts
--cipher-suites empty Allowed cipher suites
--tls-min-version TLS1.2 Floor TLS version

Auth / RBAC

Flag Default Notes
--auth-token simple simple,ttl=... or jwt,pub-key=...,priv-key=...,sign-method=...,ttl=...

Logging

Flag Default Notes
--logger zap Only zap is supported in current versions
--log-level info One of debug, info, warn, error, dpanic, panic, fatal
--log-outputs default Comma-separated; values include stderr, stdout, file paths, systemd/journal
--log-format json json or console
--log-rotation-config-json empty Lumberjack-style rotation

Tracing

Flag Default Notes
--experimental-enable-distributed-tracing false Toggle OTLP exporter
--experimental-distributed-tracing-address localhost:4317 Collector endpoint
--experimental-distributed-tracing-service-name etcd Resource attribute
--experimental-distributed-tracing-sampling-rate-per-million 0 0 = follow parent decision

Feature gates

Flag Default Notes
--feature-gates empty Foo=true,Bar=false overrides; gates declared in server/features/etcd_features.go

Debug / health

Flag Default Notes
--enable-pprof false Mount /debug/pprof/* on the client port
--metrics basic basic or extensive
--strict-reconfig-check true Reject reconfigs that lose quorum

Environment variables

Most flags also accept an ETCD_<FLAG_UPPERCASE_WITH_UNDERSCORES> env var. The translation is implemented in server/etcdmain/config.go::parse. Where flags conflict, the YAML config file takes precedence over flags, which take precedence over env vars; the actual order is documented in --help.

YAML config file

Use --config-file=etcd.conf.yml. The file is parsed by sigs.k8s.io/yaml into the same Config struct.

A documented sample sits at etcd.conf.yml.sample.

Gateway and grpc-proxy modes

These have their own flag sets (smaller, no storage). See server/etcdmain/gateway.go and server/etcdmain/grpc_proxy.go. Flags are documented in server/etcdmain/help.go.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Configuration – etcd wiki | Factory