Git Product home page Git Product logo

Comments (11)

progrium avatar progrium commented on May 28, 2024

Consul overrides the IP, so that option doesn't work with that backend. Key
value works though. Consul should fix this soon.

On Wednesday, September 17, 2014, Daniel Schierbeck <
[email protected]> wrote:

I'm having trouble forcing the IP address of the services to be the host's
address rather than the consul container's. I'm launching the registrator
container like this:

docker run --rm -v /var/run/docker.sock:/tmp/docker.sock --name registrator.1 --link consul.1:consul progrium/registrator -ip 192.168.140.2 consul://consul:8500

... yet all the services are defined with the consule container's IP
anyway. It actually took me a while to realize that the IP and port of the
services corresponded to the host rather than the containers themselves.

Am I doing something wrong?


Reply to this email directly or view it on GitHub
https://github.com/progrium/registrator/issues/23.

Jeff Lindsay
http://progrium.com

from registrator.

pfcarrier avatar pfcarrier commented on May 28, 2024

@dasch : If it can help, for now, I mitigate that issue by starting progrium/docker-consul using the -net=host switch. This cause consul to bind to the host IP.

Which end up with registrator registering it's service under the (host) IP you are expecting. This also make starting consul a bit more straigtforward, ex:

docker run --net=host --name consul progrium/consul-docker -server -bootstrap

from registrator.

dasch avatar dasch commented on May 28, 2024

@pfcarrier that worked, thanks! I had to run registrator on the host net as well.

from registrator.

HelloGrayson avatar HelloGrayson commented on May 28, 2024

Is there a link to the issue on the consul repo?

from registrator.

progrium avatar progrium commented on May 28, 2024

hashicorp/consul#229

from registrator.

saidimu avatar saidimu commented on May 28, 2024

Is there a way to force a service IP address to be the service container's IP?

It seems the only options with consul are service-IP==consul-IP or service-IP==host-IP

from registrator.

thomaschristory avatar thomaschristory commented on May 28, 2024

I fixed this by running -advertise PUBLICIP when launching your docker consul container.

from registrator.

fmahnke avatar fmahnke commented on May 28, 2024

Can this be fixed yet? The -advertise trick works fine as long as all the service containers are running on the same Docker host as the Consul container.

But if you're running registrator on a different Docker host than the one Consul is on, the IP is wrong again.

HTTP API supports setting a custom IP per service now, so is it possible? Thanks!

from registrator.

progrium avatar progrium commented on May 28, 2024

You can force the IP with -ip. And yes it works with Consul now. I think only in master though.

from registrator.

fmahnke avatar fmahnke commented on May 28, 2024

Aha. Yes, after switching to master -ip works fine. This is great.

from registrator.

mattatcha avatar mattatcha commented on May 28, 2024

Fixed by #91 (Currently only in master.)

from registrator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.