Closed tobegit3hub closed 7 years ago
I have also try etcd_client.write(etcd_master_key, socket.gethostname(), ttl=10, prevExist=False, refresh=True)
but get same result.
Seems that it's related to https://github.com/coreos/etcd/issues/5651 and have fixed in etcd 3.0
.
Not the bug of python-etcd
and upgrading etcd
works like a charm.
Now we use
etcd
andpython-etcd
for leader election.We want to write the ip or hostname into master key to become the master. Once it's successfully, it will refresh the key periodically. But if I call
refresh
with TTL, it flushes the value of the master key and I don't know who's the master now.The way to re-produce the result. We can get the value after step 4 but no value after step 5.