Consul: translate_wan_addrs issue

Created on 18 Jul 2016  路  5Comments  路  Source: hashicorp/consul

Hello,
i use consul for service discovery and i try to advertise a service with its publique ip address in remote datacenters i aded :
"translate_wan_addrs":true,
"advertise_addr_wan" : "public_ip",
in the consul agent config file of my service, but it still not working
Any ideas ? or suggestions ?

All 5 comments

More infos :
in the local datacenter : curl 127.0.0.1:8500/v1/catalog/node/MYNODE shows :
"Node": {
"Node": "MYNODE",
"Address": "PRIVATE_IP",
"TaggedAddresses": {
"wan": "PUBLIC_IP"
}
in the remote datacenter : curl 127.0.0.1:8500/v1/catalog/node/MYNODE?dc=dc-2 shows :
"Node": {
"Node": "MYNODE",
"Address": "PRIVATE_IP",
"TaggedAddresses": {
"wan": "PUBLIC_IP"
}
but when i ping from a remote datacenter node : ping MyService.service.dc-2.consul i get

PING MyService.service.dc-2.consul (PRIVATE_IP) 56(84) bytes of data.
^C
--- MyService.service.dc-2.consul ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 2017ms

Hi @Kenovo the translate_wan_addrs setting needs to be set in the _remote_ datacenter for this feature to work - that's where the decision is made.

Ah okey ! and it will treat only remote services with advertise_addr_wan ?

That's right - if that is set to true then its logic is "if the node is outside my DC use its WAN address if one is given".

Thank you, thats work perfectly !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aravind picture aravind  路  3Comments

wargamez picture wargamez  路  4Comments

satheeshCharles picture satheeshCharles  路  3Comments

slackpad picture slackpad  路  3Comments

philsttr picture philsttr  路  3Comments