etcd is configurable through command-line flags and environment variables. Options set on the command line take precedence over those from the environment.
The format of environment variable for flag --my-flag
is ETCD_MY_FLAG
. It applies to all flags.
The official etcd ports are 2379 for client requests and 2380 for peer communication. The etcd ports can be set to accept TLS traffic, non-TLS traffic, or both TLS and non-TLS traffic.
To start etcd automatically using custom settings at startup in Linux, using a systemd unit is highly recommended.
--initial-cluster
flag (e.g., default=http://localhost:2380
). This needs to match the key used in the flag if using static bootstrapping. When using discovery, each member must have a unique name. Hostname
or machine-id
can be a good choice.--initial
prefix flags are used in bootstrapping (static bootstrap, discovery-service bootstrap or runtime reconfiguration) a new member, and ignored when restarting an existing member.
--discovery
prefix flags need to be set when using discovery service.
--name
flag for each node provided. The default uses default
for the key because this is the default for the --name
flag.new
for all members present during initial static or DNS bootstrapping. If this option is set to existing
, etcd will attempt to join the existing cluster. If the wrong value is set, etcd will attempt to start but fail safely.--proxy
prefix flags configures etcd to run in proxy mode. "proxy" supports v2 API only.
The security flags help to build a secure etcd cluster.
DEPRECATED
--ca-file ca.crt
could be replaced by --trusted-ca-file ca.crt --client-cert-auth
and etcd will perform the same.DEPRECATED
--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.etcdserver=WARNING,security=DEBUG
Please be CAUTIOUS when using unsafe flags because it will break the guarantees given by the consensus protocol. For example, it may panic if other members in the cluster are still alive. Follow the instructions when using these flags.