fabric8io / docker-kibana4

4 stars 7 forks source link

Can not use docker vars / hostnames to link to the ES container #1

Closed mikehaertl closed 9 years ago

mikehaertl commented 9 years ago

I try to use your image with fig in a simple setup like this:

elk:
    image: pblittle/docker-logstash:latest
    volumes:
        - ./logstash/:/opt/logstash/conf.d
    ports:
        - "9292:9292"
        - "9200:9200"
    expose:
        - "9292"
        - "9200"
kibana:
    image: jimmidyson/kibana4:latest
    ports:
        - "5601:5601"
    links:
        - elk
    environment:
        ELASTICSEARCH_URL: "http://elk:9200"

Unfortunately this doesn't work. It fails with this error:

kibana_1 | {"@timestamp":"2015-02-24T18:53:36.173Z","level":"error","node_env":"production","error":"Request error, retrying -- connect ECONNREFUSED"}
kibana_1 | {"@timestamp":"2015-02-24T18:53:36.179Z","level":"warn","message":"Unable to revive connection: http://elk:9200/","node_env":"production"}
kibana_1 | {"@timestamp":"2015-02-24T18:53:36.179Z","level":"warn","message":"No living connections","node_env":"production"}
kibana_1 | {"@timestamp":"2015-02-24T18:53:36.184Z","level":"fatal","message":"No Living connections","node_env":"production","error":{"message":"No Living connections","name":"Error","stack":"Error: No Living connections\n  at sendReqWithConnection (/opt/kibana-4.0.0-linux-x64/src/node_modules/elasticsearch/src/lib/transport.js:174:15)\n  at next (/opt/kibana-4.0.0-linux-x64/src/node_modules/elasticsearch/src/lib/connection_pool.js:213:7)\n  at process._tickCallback (node.js:442:13)\n"}}

I can't use a static IP either, as docker uses another IP on each fig up for the elk container.

Any hints how to make this work with fig?

mikehaertl commented 9 years ago

I've also checked, whether the elk entry is there in the /etc/hosts. It is:

$ fig run --rm kibana cat /etc/hosts
Starting elk_elk_1...
172.17.0.54     9a3d5e539c16
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.53     elk
172.17.0.53     elk_1
172.17.0.53     elk_elk_1
Removing elk_kibana_run_3..

$ fig run --rm kibana ping elk
PING elk (172.17.0.53): 48 data bytes
56 bytes from 172.17.0.53: icmp_seq=0 ttl=64 time=0.152 ms
56 bytes from 172.17.0.53: icmp_seq=1 ttl=64 time=0.102 ms
56 bytes from 172.17.0.53: icmp_seq=2 ttl=64 time=0.099 ms
^C--- elk ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max/stddev = 0.099/0.118/0.152/0.024 ms
Removing elk_kibana_run_3...
mikehaertl commented 9 years ago

The URL is also working fine from inside the kibana container:

$ fig run --rm kibana bash -c 'wget http://elk:9200; cat index.html'
--2015-02-24 18:58:32--  http://elk:9200/
Resolving elk (elk)... 172.17.0.53
Connecting to elk (elk)|172.17.0.53|:9200... connected.
HTTP request sent, awaiting response... 200 OK
Length: 296 [application/json]
Saving to: `index.html'

100%[======================================>] 296         --.-K/s   in 0s      

2015-02-24 18:58:32 (34.0 MB/s) - `index.html' saved [296/296]

{
  "status" : 200,
  "name" : "Hangman",
  "version" : {
    "number" : "1.1.1",
    "build_hash" : "f1585f096d3f3985e73456debdc1a0745f512bbc",
    "build_timestamp" : "2014-04-16T14:27:12Z",
    "build_snapshot" : false,
    "lucene_version" : "4.7"
  },
  "tagline" : "You Know, for Search"
}
Removing elk_kibana_run_4...

So it seems like kibana somehow doesn't resolve elk correctly via /etc/hosts

mikehaertl commented 9 years ago

Nevermind, the image above uses Elasticsearch 1.1.1 so it's incompatible with this image anyway.