gliderlabs / registrator

Service registry bridge for Docker with pluggable adapters
http://gliderlabs.com/registrator
MIT License
4.66k stars 912 forks source link

About registrator use --net = host mode questions #272

Open wangfakang opened 8 years ago

wangfakang commented 8 years ago

I have some question that when i use --net=host for docker run registrator. I get services ip is 127.0.1.1 from consul. Thx. some results: curl "127.0.0.1:8500/v1/catalog/service/redis" | jq .

[
  {
    "ServicePort": 49153,
    "ServiceAddress": "127.0.1.1",
    "ServiceTags": null,
    "ServiceName": "redis",
    "ServiceID": "sky:redis_1:6379",
    "Address": "10.207.70.12",
    "Node": "sky"
  },
  {
    "ServicePort": 83,
    "ServiceAddress": "127.0.1.1",
    "ServiceTags": null,
    "ServiceName": "redis",
    "ServiceID": "sky:redis_2:80",
    "Address": "10.207.70.12",
    "Node": "sky"
  }
]

registrator image from: gliderlabs/registrator:latest consul image from: gliderlabs/consul-server

poblin-orange commented 8 years ago

same issue here, with consul backend. I get 127.0.0.1 even when specifying --net host. Should i try a previous version ? Anyway to get troubleshootings logs for local ip discovery ?

drmikecrowe commented 8 years ago

Ditto

drmikecrowe commented 8 years ago

related to https://github.com/gliderlabs/registrator/issues/185? and https://github.com/gliderlabs/registrator/issues/159

MBuffenoir commented 8 years ago

Did someone found the solution to this ?

wangfakang commented 8 years ago

@MBuffenoir Because useing --net=host and registrator default flag -internal=0(it's will register service ip is 'registrator' host ip adds to consul or etcd), and you can use -internal=1.

MBuffenoir commented 8 years ago

OK my mistake I was placing the -internal argument after the consul: argument and it was not interpreted correctly. All functionning properly now.

rickalm commented 8 years ago

https://github.com/gliderlabs/registrator/issues/320