I removed a node from a CoreOS cluster and brought up a fresh one in its place. Unfortunately, it picked up the same IP as the old machine.
This stopped etcd from discovering the rest of the cluster, with messages like this in the journal: "failed: fail on join request: Peer address has existed"
How can I remove the old node from discovery.etcd.io?
Best Answer
Short answer if you know the machine id
Send an HTTP DELETE request to
https://discovery.etcd.io/<cluster-id>/<machine-id>
e.g.
Longer answer - how to find the machine id to delete
First, fetch the JSON object from your discovery URL, e.g.
It will look a bit like this:
Let's say our reused IP is
10.132.47.218
- we want to identify the machine id which corresponds to that. We can see from the key this is6148dbb812a44dbe8773bebf329634e7
Now we can delete this simply using a DELETE verb