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

DNS lookup error in docker-compose #2214

Closed
sigoden opened this Issue Nov 23, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@sigoden
Copy link

sigoden commented Nov 23, 2016

prometheus fail to dail server with name domain in docker-compose.

when navigate to http://<promdash_host>/targets page, it show errors: Get http://nodeexporter:9100/metrics: dial tcp 127.0.53.53:9100: getsockopt: connection refused

I ping the server docker-compose exec prometheus ping nodeexporter, it works

PING nodeexporter (172.19.0.2): 56 data bytes
64 bytes from 172.19.0.2: seq=0 ttl=64 time=0.101 ms
64 bytes from 172.19.0.2: seq=1 ttl=64 time=0.077 ms
^C
--- nodeexporter ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.077/0.089/0.101 ms

this is my docker-compose.yaml file

version: "2.0"
services:
    nodeexporter:
        image: prom/node-exporter
        ports: 
            - '9100:9100'
    prometheus:
        image: prom/prometheus
        volumes:
            - ./prometheus.yml:/etc/prometheus/prometheus.yml
            - ./data/prom:/prometheus
        command:
            - '-config.file=/etc/prometheus/prometheus.yml'
            - '-storage.local.path=/prometheus'
        ports:
            - '9090:9090'
        depends_on:
            - nodeexporter

this is my prometheus.ymal file

global:
    scrape_interval: 5s
    external_labels:
        monitor: 'saas'
scrape_configs:
    - job_name: 'default'
      static_configs:
          - targets: ['localhost:9090', 'nodeexporter:9100']
@by-erik

This comment has been minimized.

Copy link

by-erik commented Nov 29, 2016

I have exactly the same problem. Did you solve the problem in the meantime?
As a workaround i put the ip address of the node-exporter container in the prometheus.yml and it works as expected. But this is a very bad workaround and no solution.

@by-erik

This comment has been minimized.

Copy link

by-erik commented Nov 29, 2016

I disabled dnsmasq in NetworkManager and the problem is gone.
See:
https://docs.docker.com/engine/installation/linux/ubuntulinux/#specify-dns-servers-for-docker

@grobie grobie closed this Mar 5, 2017

@lock

This comment has been minimized.

Copy link

lock bot commented Mar 23, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 23, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.