From 0e49a0a3efe8f4a0739ba36ab683412cc6ebb7da Mon Sep 17 00:00:00 2001 From: Spencer Brown Date: Wed, 13 May 2015 16:47:13 -0500 Subject: [PATCH] docs: add client flags to examples in clustering.md to make it a complete functional example --- Documentation/clustering.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Documentation/clustering.md b/Documentation/clustering.md index b10738acc..261def5cd 100644 --- a/Documentation/clustering.md +++ b/Documentation/clustering.md @@ -43,6 +43,8 @@ On each machine you would start etcd with these flags: ``` $ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \ -listen-peer-urls http://10.0.1.10:2380 \ + -listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.10:2379 \ -initial-cluster-token etcd-cluster-1 \ -initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \ -initial-cluster-state new @@ -50,6 +52,8 @@ $ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \ ``` $ etcd -name infra1 -initial-advertise-peer-urls http://10.0.1.11:2380 \ -listen-peer-urls http://10.0.1.11:2380 \ + -listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.11:2379 \ -initial-cluster-token etcd-cluster-1 \ -initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \ -initial-cluster-state new @@ -57,6 +61,8 @@ $ etcd -name infra1 -initial-advertise-peer-urls http://10.0.1.11:2380 \ ``` $ etcd -name infra2 -initial-advertise-peer-urls http://10.0.1.12:2380 \ -listen-peer-urls http://10.0.1.12:2380 \ + -listen-client-urls http://10.0.1.12:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.12:2379 \ -initial-cluster-token etcd-cluster-1 \ -initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \ -initial-cluster-state new @@ -71,6 +77,8 @@ In the following example, we have not included our new host in the list of enume ``` $ etcd -name infra1 -initial-advertise-peer-urls http://10.0.1.11:2380 \ -listen-peer-urls https://10.0.1.11:2380 \ + -listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.11:2379 \ -initial-cluster infra0=http://10.0.1.10:2380 \ -initial-cluster-state new etcd: infra1 not listed in the initial cluster config @@ -82,6 +90,8 @@ In this example, we are attempting to map a node (infra0) on a different address ``` $ etcd -name infra0 -initial-advertise-peer-urls http://127.0.0.1:2380 \ -listen-peer-urls http://10.0.1.10:2380 \ + -listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.10:2379 \ -initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra2=http://10.0.1.12:2380 \ -initial-cluster-state=new etcd: error setting up initial cluster: infra0 has different advertised URLs in the cluster and advertised peer URLs list @@ -93,6 +103,8 @@ If you configure a peer with a different set of configuration and attempt to joi ``` $ etcd -name infra3 -initial-advertise-peer-urls http://10.0.1.13:2380 \ -listen-peer-urls http://10.0.1.13:2380 \ + -listen-client-urls http://10.0.1.13:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.13:2379 \ -initial-cluster infra0=http://10.0.1.10:2380,infra1=http://10.0.1.11:2380,infra3=http://10.0.1.13:2380 \ -initial-cluster-state=new etcd: conflicting cluster ID to the target cluster (c6ab534d07e8fcc4 != bc25ea2a74fb18b0). Exiting. @@ -137,16 +149,22 @@ Now we start etcd with those relevant flags for each member: ``` $ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \ -listen-peer-urls http://10.0.1.10:2380 \ + -listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.10:2379 \ -discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83 ``` ``` $ etcd -name infra1 -initial-advertise-peer-urls http://10.0.1.11:2380 \ -listen-peer-urls http://10.0.1.11:2380 \ + -listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.11:2379 \ -discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83 ``` ``` $ etcd -name infra2 -initial-advertise-peer-urls http://10.0.1.12:2380 \ -listen-peer-urls http://10.0.1.12:2380 \ + -listen-client-urls http://10.0.1.12:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.12:2379 \ -discovery https://myetcd.local/v2/keys/discovery/6c007a14875d53d9bf0ef5a6fc0257c817f0fb83 ``` @@ -181,16 +199,22 @@ Now we start etcd with those relevant flags for each member: ``` $ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \ -listen-peer-urls http://10.0.1.10:2380 \ + -listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.10:2379 \ -discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de ``` ``` $ etcd -name infra1 -initial-advertise-peer-urls http://10.0.1.11:2380 \ -listen-peer-urls http://10.0.1.11:2380 \ + -listen-client-urls http://10.0.1.11:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.11:2379 \ -discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de ``` ``` $ etcd -name infra2 -initial-advertise-peer-urls http://10.0.1.12:2380 \ -listen-peer-urls http://10.0.1.12:2380 \ + -listen-client-urls http://10.0.1.12:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.12:2379 \ -discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de ``` @@ -206,6 +230,8 @@ You can use the environment variable `ETCD_DISCOVERY_PROXY` to cause etcd to use ``` $ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \ -listen-peer-urls http://10.0.1.10:2380 \ + -listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.10:2379 \ -discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de etcd: error: the cluster doesn’t have a size configuration value in https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de/_config exit 1 @@ -218,6 +244,8 @@ This error will occur if the discovery cluster already has the configured number ``` $ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \ -listen-peer-urls http://10.0.1.10:2380 \ + -listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.10:2379 \ -discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de \ -discovery-fallback exit etcd: discovery: cluster is full @@ -232,6 +260,8 @@ ignored on this machine. ``` $ etcd -name infra0 -initial-advertise-peer-urls http://10.0.1.10:2380 \ -listen-peer-urls http://10.0.1.10:2380 \ + -listen-client-urls http://10.0.1.10:2379,http://127.0.0.1:2379 \ + -advertise-client-urls http://10.0.1.10:2379 \ -discovery https://discovery.etcd.io/3e86b59982e49066c5d813af1c2e2579cbf573de etcdserver: discovery token ignored since a cluster has already been initialized. Valid log found at /var/lib/etcd ```