make single-point etcd service become multi-point service failed when want keep the old data
At the beginning I have only one host run etcd like this(/etc/etcd/etcd.conf):
ETCD_NAME=default
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379,http://0.0.0.0:4001"
ETCD_ADVERTISE_CLIENT_URLS="http://127.0.0.1:2379,http://10.1.1.1:4001"
Then I want add two other host in that cluster meanwhile keep the etcd's old data.
So firstly cp -ra /var/lib/etcd/default.etcd/* /search/test/ to keep the old data . Secondly change the etdcd config file like this:
ETCD_NAME=node1
ETCD_DATA_DIR="/search/test"
ETCD_LISTEN_PEER_URLS="http://0.0.0.0:2380"
ETCD_LISTEN_CLIENT_URLS="http://0.0.0.0:2379,http://0.0.0.0:4001"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.1.1.1:2380"
ETCD_INITIAL_CLUSTER="node1=http://10.1.1.1:2380,node2=http://10.1.1.2:2380,node3=http://10.1.1.3:2380"
ETCD_INITIAL_CLUSTER_STATE="existing"
ETCD_INITIAL_CLUSTER_TOKEN="kube-etcd-cluster1"
ETCD_ADVERTISE_CLIENT_URLS="http://10.1.1.1:2379"
systemctl start etcd then etcdctl member list output as below:
ce2a822cea30bfca: name=node1 peerURLs=http://localhost:2380,http://localhost:7001 clientURLs=http://10.1.1.1:2379
This is obviously wrong! It seems that if I use old data the config file doesn't work anymore.Wrong log as below:
Jun 08 20:17:19 mesos-78-12 etcd[38063]: request sent was ignored (cluster ID mismatch: remote[f18051b329e62a36]=2e20aefc0938965...f4849c) Jun 08 20:17:19 mesos-78-12 etcd[38063]: request sent was ignored (cluster ID mismatch: remote[f18051b329e62a36]=2e20aefc0938965...f4849c) Jun 08 20:17:19 mesos-78-12 etcd[38063]: streaming request ignored (cluster ID mismatch got 2e20aefc0938965 want 987cde7c4bf4849c) Jun 08 20:17:19 mesos-78-12 etcd[38063]: streaming request ignored (cluster ID mismatch got 2e20aefc0938965 want 987cde7c4bf4849c) Jun 08 20:17:19 mesos-78-12 etcd[38063]: request sent was ignored (cluster ID mismatch: remote[f18051b329e62a36]=2e20aefc0938965...f4849c) Jun 08 20:17:19 mesos-78-12 etcd[38063]: request sent was ignored (cluster ID mismatch: remote[f18051b329e62a36]=2e20aefc0938965...f4849c) Jun 08 20:17:19 mesos-78-12 etcd[38063]: streaming request ignored (cluster ID mismatch got 2e20aefc0938965 want 987cde7c4bf4849c) Jun 08 20:17:19 mesos-78-12 etcd[38063]: streaming request ignored (cluster ID mismatch got 2e20aefc0938965 want 987cde7c4bf4849c) Jun 08 20:17:19 mesos-78-12 etcd[38063]: request sent was ignored (cluster ID mismatch: remote[f18051b329e62a36]=2e20aefc0938965...f4849c) Jun 08 20:17:19 mesos-78-12 etcd[38063]: request sent was ignored (cluster ID mismatch: remote[f18051b329e62a36]=2e20aefc0938965...f4849c)
So how can I fix this problem? Thanks!
@workhardcc What etcd does is expected. It protects you from corrupting your cluster. Please use the configuration API to add/remove members: see https://github.com/coreos/etcd/blob/release-2.3/Documentation/runtime-configuration.md#add-a-new-member
Thanks for your reply! You know my cluster start with static config file. I want to know that if I use API to update members, didn't I need to manual update the configure file ?