etcd icon indicating copy to clipboard operation
etcd copied to clipboard

etcd publishing localhost in a discovery setup

Open AlessandroEmm opened this issue 12 years ago • 3 comments

Hey there

I currently have an OpenStack setup where i start two nodes and want them build a cluster through an external discovery node. I use cloud-init to configure the nodes, which goes like: etcd: name: node002 discovery: http://192.168.122.160:4001/v2/keys/_etcd/registry/Test

The Problem is that etcd seems to always publish localhost when there is no overriding peer-addr configured - why is that? I can't think of a scenario where localhost would make possibly sense in a discovery setup. Is there another workaround to have the machine grab its own IP instead of configuring it in the cloud-init configuration?

(Full configuration + logs can be seen at https://gist.github.com/anonymous/893d4c96803a0cf4c203)

Thanks! Alessandro

AlessandroEmm avatar Nov 18 '14 09:11 AlessandroEmm

The default is localhost. You have to provide configuration since it is impossible for etcd to know what the public IP of a host is. In etcd 0.5.0-alpha we let you publish multiple IPs so we could say publish all interfaces as an option. That might be a good feature to add.

philips avatar Nov 19 '14 05:11 philips

I am going to close this for now. Please re-open if that doesn't sufficiently answer your question.

philips avatar Nov 19 '14 05:11 philips

@philips I can see your point, but rather than using localhost wouldn't you just rather not start at all? This behaviour is rather confusing as publishing localhost almost never makes sense in a discovery/cluster setup as far as I can see. Not starting and giving an appropriate message would further ease the configuration imho.

AlessandroEmm avatar Nov 19 '14 06:11 AlessandroEmm