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
ETCD_MY_FLAG. It applies to all flags.
The official etcd ports are 2379 for client requests, and 2380 for peer communication. Some legacy code and documentation still references ports 4001 and 7001, but all new etcd use and discussion should adopt the assigned ports.
To start etcd automatically using custom settings at startup in Linux, using a systemd unit is highly recommended.
default=http://localhost:2380,default=http://localhost:7001). This needs to match the key used in the flag if you're using static bootstrapping. When using discovery, each member must have a unique name.
machine-idcan be a good choice.
--discovery prefix flags need to be set when using discovery service.
--nameflag for each node provided. The default uses
defaultfor the key because this is the default for the
newfor 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.
The security flags help to build a secure etcd cluster.
--ca-file ca.crtcould be replaced by
--trusted-ca-file ca.crt --client-cert-authand etcd will perform the same.
--peer-ca-file ca.crtcould be replaced by
--peer-trusted-ca-file ca.crt --peer-client-cert-authand etcd will perform the same.
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.