-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
etcd should use default values for advertised client and peer URLs. #2858
Comments
I think the real problem is the fact that clients call sync cluster which means I really need to use valid IPs for etcd, even for single node clusters. |
@kelseyhightower You have to know the valid IPs. For the most common use case (multi member setup), each member needs to publish its own clientURLs to the cluster. So clients can find other members through one member. If we allow unknown clientURLs, it will introduce issues like the one you mentioned. |
@xiang90 What about a flag so the user can ask etcd to grab the default IPv4 address like we do in fleet. For example, fleet does the following: https://github.com/coreos/fleet/blob/b298bbefa0f6334344e5ef3ba08f789faf8c02ad/machine/coreos.go#L109 |
@kelseyhightower Sure. Let us try that approach for clientURLs. |
The fatal is used to avoid unset advertise-client-urls when bootstrap. This can be bypassed by setting Another possible thought to solve the issue is to grab all interface IPs first and run etcd using them by shell scripts, given the fact that this is only used for single node cluster. |
@yichengq I think @kelseyhightower want to make cloud config or something pre-boot works... |
@xiang90 @kelseyhightower If it uses cloudinit, $private_ipv4 and $public_ipv4 could be used to set the flag. I may lack of some context/environment here. |
I don't understand why the listening addresses need to be bound to a specific IP. From my perspective, the advertised listening URL needs to be a valid IP so that other cluster members can contact it, but why can't I listen on all interfaces so that my clients can point to either 127.0.0.1 if localhost OR the machine's actual IP? If the advertised URL isn't the one being sent to the cluster, what's the point of having it? Shouldn't I be able to do:
Doing so gives me an
|
@colebrumley You definitely can listen on all interfaces. Thie error indicates that the cluster info fetched from discovery token conflicts with the configuration that you give in the flags. You can check the cluster info in discovery token by opening it in the browser. One possibility for this error is that you reused discovery token for cluster creation, which is not allowed. If this is still a problem, feel free to open an issue to discuss. |
I find the same problem. And even if I use this flag Here is my start command:
And this output:
Hope to get some help. cc @wonderflow |
How to assign the peer addr automatically ? it seems the error: my etcd version is 2.0.9 Hope to get some help ! Thank you ! |
@wangzhezhe You also need to set |
I tried configuring etcd v2.010 with the following settings:
I got the following error:
How I expect this to work:
I'm currently trying to bootstrap a single node etcd cluster, and don't know the IP address ahead of time. Ideally I want to listen to all interfaces and allow clients such as Kubernetes and etcdctl to interact with etcd.
The text was updated successfully, but these errors were encountered: