title: Kibana can't reach elasticsearch
body: <p>Using docker-compose v3 and deploying to a swarm:</p>
  
  <pre><code>version: '3'
  services:
  
    elasticsearch:
      image: docker.elastic.co/elasticsearch/elasticsearch:5.4.1
      deploy:
        replicas: 1
      ports:
       - "9200:9200"
      tty: true
  
  
    kibana:
      image: docker.elastic.co/kibana/kibana:5.4.1
      deploy:
        mode: global
      ports:
       - "5601:5601"
      depends_on:
        - elasticsearch
      tty: true
  </code></pre>
  
  <p>I see this in the kibana service log:</p>
  
  <blockquote>
    <p>Unable to revive connection: <a href="http://elasticsearch:9200/" rel="nofollow noreferrer">http://elasticsearch:9200/</a></p>
  </blockquote>
  
  <p>Elasticsearch service is running and can be reached.
  Swarm consists of 3 nodes.</p>
  
  <p>What am I missing?</p>
  
  <p><strong>Update:</strong> 
  I turns out that if I try to access kibana on the same swarm node where elasticsearch is running, it works. All other nodes either have a network problem or cannot resolve the elasticsearch name.</p>