bind public ip

2,125 views
Skip to first unread message

edison

unread,
Mar 8, 2016, 9:02:38 PM3/8/16
to Consul

Hey guys
I`m tring to test consul cluster through two different dc.
So consul should connect each other with public ip.
what should i do?
Can i just "-bind=public ip"?
I got a error "Error starting agent: Failed to start Consul server: Failed to start RPC layer: listen tcp xxxx:8300: bind: cannot assign requested address "

Thanks

James Phillips

unread,
Mar 9, 2016, 12:21:04 AM3/9/16
to consu...@googlegroups.com
Hi,

The -bind argument should allow Consul to listen on an external address. That error message looks like there's no interface on the machine with the address you've chosen. Can you double check the network interfaces on that machine?

-- James

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/af6c1f07-f65a-46a0-a14e-190e5310f20c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Adams

unread,
Mar 9, 2016, 9:44:26 AM3/9/16
to consu...@googlegroups.com
If you are on a cloud platform like AWS, your public IP may not be the same as your bind IP. In most cases you shouldn't need to specify a bind address, unless you have multiple network interfaces and you want to bind only to one of them. But if other members of your consul cluster will use a different IP address to connect to your consul server, you can specify that address using the "-advertise=public-ip" option or "-advertise-wan=public-ip" if it's *only* for WAN connectivity between datacenters.

In my case, using AWS with VPCs, we use just the -advertise-wan option, because local cluster clients in the same VPC will use the (automatically discovered) 10.x.x.x address to connect to the server, but WAN partners in other Consul datacenters use the instance's public IP address.

Hope that all makes sense.

-dave

--
Reply all
Reply to author
Forward
0 new messages