github / brubeck

A Statsd-compatible metrics aggregator
MIT License
1.19k stars 94 forks source link

Cannot use hostnames in config #19

Closed dinoshauer closed 9 years ago

dinoshauer commented 9 years ago

Trying to set up a local cluster using docker-compose and to link containers together you should use the hostname, however it seems that brubeck cannot connect to the containers using hostnames defined in /etc/hosts. I've attached the error I get from the log, the backends snippet that is relevant to the issues and the contents of /etc/hosts.

If I use the ip address from /etc/hosts brubeck connects fine.

Let me know if you need more info :)

EDIT: I can ofcourse telnet carbon 2004 Log:

instance=brubeck_debug backend=carbon event=failed_to_connect errno=101 msg="Network is unreachable"

Config:

  "backends" : [
    {
      "type" : "carbon",
      "address" : "carbon",
      "port" : 2004,
      "frequency" : 10,
      "pickle": true
    }
  ],

/etc/hosts:

$ cat /etc/hosts
172.17.0.155    93c76038bc47
127.0.0.1       localhost
::1     localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.150    carbon 087e1b0d7be2 statsdocker_carbon_1
dinoshauer commented 9 years ago

Works beautifully! Thanks!