Skip to content
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

docker swarm some times register eth0 other eth1 #652

Closed
viest opened this issue Apr 30, 2019 · 12 comments
Closed

docker swarm some times register eth0 other eth1 #652

viest opened this issue Apr 30, 2019 · 12 comments

Comments

@viest
Copy link

viest commented Apr 30, 2019

/ # ifconfig
eth0      Link encap:Ethernet  HWaddr 02:42:0A:00:07:97
          inet addr:10.0.7.151  Bcast:10.0.7.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1450  Metric:1
          RX packets:835 errors:0 dropped:0 overruns:0 frame:0
          TX packets:817 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:473052 (461.9 KiB)  TX bytes:97115 (94.8 KiB)

eth1      Link encap:Ethernet  HWaddr 02:42:0A:FF:06:F7
          inet addr:10.255.6.247  Bcast:10.255.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1450  Metric:1
          RX packets:67 errors:0 dropped:0 overruns:0 frame:0
          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:9171 (8.9 KiB)  TX bytes:23480 (22.9 KiB)

eth2      Link encap:Ethernet  HWaddr 02:42:AC:12:00:04
          inet addr:172.18.0.4  Bcast:172.18.255.255  Mask:255.255.0.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

fabio output:

 [INFO] consul: Registered fabio as "fabio"
 [INFO] consul: Registered fabio with id "fabio-ba36cab4e60d-9998"
 [INFO] consul: Registered fabio with address "10.255.6.247"
 [INFO] consul: Registered fabio with tags ""

consul check

Service 'fabio' check
Output
Get http://[10.255.6.247]:9998/health: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

I'm gonna use the eth0 network. What am I supposed to do?

@aaronhurt
Copy link
Member

You can set the registry.consul.register.addr explicitly.

# registry.consul.register.addr configures the address for the service registration.
#
# Fabio registers itself in consul with this host:port address.
# It must point to the UI/API endpoint configured by ui.addr and defaults to its
# value.
#
# The default is
#
# registry.consul.register.addr = :9998

@aaronhurt
Copy link
Member

We could possibly introduce go-sockaddr parsing of the addresses to make that a bit more dynamic.

https://github.com/hashicorp/go-sockaddr

@viest
Copy link
Author

viest commented Apr 30, 2019

@leprechau Before the container starts, I don't know about Ip.

@viest
Copy link
Author

viest commented Apr 30, 2019

Or like consul -advertise={{ GetInterfaceIP "eth0" }}

@aaronhurt
Copy link
Member

@viest that's what consul, nomad and other HashiCorp products use ... that's the go-sockaddr project.

@viest
Copy link
Author

viest commented Apr 30, 2019

Yes, I'm looking forward to joining this feature.

@aaronhurt
Copy link
Member

Would you be open to submitting a PR to handle go-sockaddr parsing of the various places ip:port strings are interpreted?

@viest
Copy link
Author

viest commented Apr 30, 2019

Clusters rely on this feature.

aaronhurt pushed a commit to myENA/fabio that referenced this issue Apr 30, 2019
@aaronhurt
Copy link
Member

I created #653 to address this issue.

@viest
Copy link
Author

viest commented May 1, 2019

It's so cool.

@magiconair @pschultz please merge master, thanks.

@aaronhurt
Copy link
Member

@viest we're just waiting on a review.

@viest
Copy link
Author

viest commented May 1, 2019

I need this new feature so much, in my cluster.

But I think the main line was the latest merger 7 days ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants