github.com/ghodss/etcd@v0.3.1-0.20140417172404-cc329bfa55cb/Documentation/configuration.md (about) 1 # Etcd Configuration 2 3 Configuration options can be set in three places: 4 5 1. Command line flags 6 2. Environment variables 7 3. Configuration file 8 9 Options set on the command line take precedence over all other sources. 10 Options set in environment variables take precedence over options set in 11 configuration files. 12 13 ## Command Line Flags 14 15 ### Required 16 17 * `-name` - The node name. Defaults to the hostname. 18 19 ### Optional 20 21 * `-addr` - The advertised public hostname:port for client communication. Defaults to `127.0.0.1:4001`. 22 * `-discovery` - A URL to use for discovering the peer list. (i.e `"https://discovery.etcd.io/your-unique-key"`). 23 * `-bind-addr` - The listening hostname for client communication. Defaults to advertised IP. 24 * `-peers` - A comma separated list of peers in the cluster (i.e `"203.0.113.101:7001,203.0.113.102:7001"`). 25 * `-peers-file` - The file path containing a comma separated list of peers in the cluster. 26 * `-ca-file` - The path of the client CAFile. Enables client cert authentication when present. 27 * `-cert-file` - The cert file of the client. 28 * `-key-file` - The key file of the client. 29 * `-config` - The path of the etcd configuration file. Defaults to `/etc/etcd/etcd.conf`. 30 * `-cors` - A comma separated white list of origins for cross-origin resource sharing. 31 * `-cpuprofile` - The path to a file to output CPU profile data. Enables CPU profiling when present. 32 * `-data-dir` - The directory to store log and snapshot. Defaults to the current working directory. 33 * `-max-result-buffer` - The max size of result buffer. Defaults to `1024`. 34 * `-max-cluster-size` - The max size of the cluster. Defaults to `9`. 35 * `-max-retry-attempts` - The max retry attempts when trying to join a cluster. Defaults to `3`. 36 * `-peer-addr` - The advertised public hostname:port for server communication. Defaults to `127.0.0.1:7001`. 37 * `-peer-bind-addr` - The listening hostname for server communication. Defaults to advertised IP. 38 * `-peer-ca-file` - The path of the CAFile. Enables client/peer cert authentication when present. 39 * `-peer-cert-file` - The cert file of the server. 40 * `-peer-key-file` - The key file of the server. 41 * `-peer-election-timeout` - The number of milliseconds to wait before the leader is declared unhealthy. 42 * `-snapshot=false` - Disable log snapshots. Defaults to `true`. 43 * `-v` - Enable verbose logging. Defaults to `false`. 44 * `-vv` - Enable very verbose logging. Defaults to `false`. 45 * `-version` - Print the version and exit. 46 47 ## Configuration File 48 49 The etcd configuration file is written in [TOML](https://github.com/mojombo/toml) 50 and read from `/etc/etcd/etcd.conf` by default. 51 52 ```TOML 53 addr = "127.0.0.1:4001" 54 bind_addr = "127.0.0.1:4001" 55 ca_file = "" 56 cert_file = "" 57 cors = [] 58 cpu_profile_file = "" 59 data_dir = "." 60 discovery = "http://etcd.local:4001/v2/keys/_etcd/registry/examplecluster" 61 key_file = "" 62 peers = [] 63 peers_file = "" 64 max_cluster_size = 9 65 max_result_buffer = 1024 66 max_retry_attempts = 3 67 name = "default-name" 68 snapshot = false 69 verbose = false 70 very_verbose = false 71 72 [peer] 73 addr = "127.0.0.1:7001" 74 bind_addr = "127.0.0.1:7001" 75 ca_file = "" 76 cert_file = "" 77 key_file = "" 78 ``` 79 80 ## Environment Variables 81 82 * `ETCD_ADDR` 83 * `ETCD_BIND_ADDR` 84 * `ETCD_CA_FILE` 85 * `ETCD_CERT_FILE` 86 * `ETCD_CORS_ORIGINS` 87 * `ETCD_CONFIG` 88 * `ETCD_CPU_PROFILE_FILE` 89 * `ETCD_DATA_DIR` 90 * `ETCD_DISCOVERY` 91 * `ETCD_KEY_FILE` 92 * `ETCD_PEERS` 93 * `ETCD_PEERS_FILE` 94 * `ETCD_MAX_CLUSTER_SIZE` 95 * `ETCD_MAX_RESULT_BUFFER` 96 * `ETCD_MAX_RETRY_ATTEMPTS` 97 * `ETCD_NAME` 98 * `ETCD_SNAPSHOT` 99 * `ETCD_VERBOSE` 100 * `ETCD_VERY_VERBOSE` 101 * `ETCD_PEER_ADDR` 102 * `ETCD_PEER_BIND_ADDR` 103 * `ETCD_PEER_CA_FILE` 104 * `ETCD_PEER_CERT_FILE` 105 * `ETCD_PEER_KEY_FILE` 106 * `ETCD_PEER_ELECTION_TIMEOUT`