etcd icon indicating copy to clipboard operation
etcd copied to clipboard

New nodes can't join, after snapshot and joins and empty data directories

Open dliebreich opened this issue 12 years ago • 2 comments

@fraenkel and I found another problem.

  1. start etcd single node: bin/etcd -data-dir=$HOME/etcd_data/1 -addr=127.0.0.1:4001 -peer-addr=127.0.0.1:7001 -v -name=m1 -peer-election-timeout=1000 -peer-heartbeat-timeout=100
  2. add 11000 key/value pairs (enough to cause a snapshot) (/v2/keys/test1/messageN = "Hello World N"
  3. add a second node to the cluster: bin/etcd -data-dir=$HOME/etcd_data/2 -addr=127.0.0.1:4002 -peer-addr=127.0.0.1:7002 -v -peers=127.0.0.1:7001 -name=m2 -peer-election-timeout=1000 -peer-heartbeat-timeout=100
  4. when second node completes snapshot, kill it
  5. delete data dir for second node, then restart second node

second node fails to join cluster. Also, no new nodes can join the cluster.

here's the error output:

[deprecated] use -peer-heartbeat-interval, not -peer-heartbeat-timeout [etcd] Feb 25 11:56:34.148 DEBUG | open /Users/pivotal/etcd_data/2/snapshot: no such file or directory [etcd] Feb 25 11:56:34.148 INFO | m2: state changed from 'stopped' to 'follower'. [etcd] Feb 25 11:56:34.148 INFO | URLs: / m2 () [etcd] Feb 25 11:56:34.149 DEBUG | Send Join Request to http://127.0.0.1:7001/join [etcd] Feb 25 11:56:35.449 WARNING | Attempt to join via 127.0.0.1:7001 failed: Unable to join: Post http://127.0.0.1:7001/join: net/http: timeout awaiting response headers [etcd] Feb 25 11:56:35.449 WARNING | No living peers are found! [etcd] Feb 25 11:56:35.449 CRITICAL | No available peers in backup list, and no log data

etcd at 4c17dc3

dliebreich avatar Feb 25 '14 19:02 dliebreich

This should work fine if you get your cluster up to 3 nodes. The problem is that once you have two nodes you have set quorum to 2. If one dies it impossible to make a quorum write and let new members join. This document will help: https://github.com/coreos/etcd/blob/master/Documentation/optimal-cluster-size.md

I am going to close this for now. If you can reproduce with a three node cluster killing one of the nodes then let me know! Thanks.

philips avatar Mar 05 '14 22:03 philips

thanks. I have not been able to reproduce with 3 nodes, which is consistent with your explanation

dliebreich avatar Mar 08 '14 20:03 dliebreich