bprodoehl / docker-log-collector

A Docker container with fluentd
MIT License
32 stars 4 forks source link

Could not contact Elasticsearch at http://. Please ensure that Elasticsearch is reachable from your system #1

Open ambatigan opened 9 years ago

ambatigan commented 9 years ago

Followed the launch script... i got stuck up with the "Could not contact Elasticsearch at http://172.22.59.154:32797. Please ensure that Elasticsearch is reachable from your system"

first of all, i was able to view kibana webapp on my local browser by adding the "--publish-all and -p 32799:80" options to the 'docker run'

later i understood that kibana is resolving the elasticsearch's ip address at the browser side, i ran the elasticsearch container with the options " -p 32797:9200 and -p 32798:9300"

Then i tried the kibana url using, http://172.22.59.154:32799/index.html#/dashboard, where 172.22.59.154 is my docker host and where all these containers are running. But i see that error in the browser, "Could not contact Elasticsearch at http://172.22.59.154:32797. Please ensure that Elasticsearch is reachable from your system"

But if i run http://172.22.59.154:32797 in my browser, i'm getting the following output -

{ "status" : 200, "name" : "Antiphon the Overseer", "cluster_name" : "elasticsearch", "version" : { "number" : "1.4.4", "build_hash" : "c88f77ffc81301dfa9dfd81ca2232f09588bd512", "build_timestamp" : "2015-02-19T13:05:36Z", "build_snapshot" : false, "lucene_version" : "4.10.3" }, "tagline" : "You Know, for Search" }

pl let me know where i was doing wrong...

Another thing, i did is - i've gone to the config.js of kibana and modified

cat /var/lib/docker/devicemapper/mnt/b5e85f173fde81750e0c1a488dddffed3bc8a6fd138178cb3701b0aa06ecd73e/rootfs/opt/kibana-3.1.0/config.js|grep elasticsearch|grep 32797 elasticsearch: "http://"+window.location.hostname+":32797",

Thanks. Ganga

ambatigan commented 9 years ago

One more info - If i go through the response headers and other..i see that it is querying http://172.22.59.154:32797/_nodes which has the following response:

{"cluster_name":"elasticsearch","nodes":{"N-de4IPtT9S3HzPEX1Wk_g":{"name":"Antiphon the Overseer","transport_address":"inet[/172.17.0.27:9300]","host":"elasticsearch","ip":"172.17.0.27","version":"1.4.4","build":"c88f77f","http_address":"inet[/172.17.0.27:9200]","settings":{"name":"Antiphon the Overseer","path":{"logs":"/opt/elasticsearch/logs","home":"/opt/elasticsearch"},"cluster":{"name":"elasticsearch"},"client":{"type":"node"},"foreground":"yes","script":{"disable_dynamic":"true"}},"os":{"refresh_interval_in_millis":1000,"available_processors":32,"cpu":{"vendor":"Intel","model":"Xeon","mhz":2600,"total_cores":32,"total_sockets":1,"cores_per_socket":32,"cache_size_in_bytes":20480},"mem":{"total_in_bytes":33763864576},"swap":{"total_in_bytes":103588909056}},"process":{"refresh_interval_in_millis":1000,"id":12,"max_file_descriptors":4096,"mlockall":false},"jvm":{"pid":12,"version":"1.8.0_40-internal","vm_name":"OpenJDK 64-Bit Server VM","vm_version":"25.40-b25","vm_vendor":"Oracle Corporation","start_time_in_millis":1436074698669,"mem":{"heap_init_in_bytes":268435456,"heap_max_in_bytes":1037959168,"non_heap_init_in_bytes":2555904,"non_heap_max_in_bytes":0,"direct_max_in_bytes":1037959168},"gc_collectors":["ParNew","ConcurrentMarkSweep"],"memory_pools":["Code Cache","Metaspace","Compressed Class Space","Par Eden Space","Par Survivor Space","CMS Old Gen"]},"thread_pool":{"percolate":{"type":"fixed","min":32,"max":32,"queue_size":"1k"},"bench":{"type":"scaling","min":1,"max":5,"keep_alive":"5m","queue_size":-1},"listener":{"type":"fixed","min":10,"max":10,"queue_size":-1},"index":{"type":"fixed","min":32,"max":32,"queue_size":"200"},"refresh":{"type":"scaling","min":1,"max":10,"keep_alive":"5m","queue_size":-1},"suggest":{"type":"fixed","min":32,"max":32,"queue_size":"1k"},"generic":{"type":"cached","keep_alive":"30s","queue_size":-1},"warmer":{"type":"scaling","min":1,"max":5,"keep_alive":"5m","queue_size":-1},"search":{"type":"fixed","min":96,"max":96,"queue_size":"1k"},"flush":{"type":"scaling","min":1,"max":5,"keep_alive":"5m","queue_size":-1},"optimize":{"type":"fixed","min":1,"max":1,"queue_size":-1},"management":{"type":"scaling","min":1,"max":5,"keep_alive":"5m","queue_size":-1},"get":{"type":"fixed","min":32,"max":32,"queue_size":"1k"},"merge":{"type":"scaling","min":1,"max":5,"keep_alive":"5m","queue_size":-1},"bulk":{"type":"fixed","min":32,"max":32,"queue_size":"50"},"snapshot":{"type":"scaling","min":1,"max":5,"keep_alive":"5m","queue_size":-1}},"network":{"refresh_interval_in_millis":5000,"primary_interface":{"address":"172.17.0.27","name":"eth0","mac_address":"02:42:AC:11:00:1B"}},"transport":{"bound_address":"inet[/0:0:0:0:0:0:0:0:9300]","publish_address":"inet[/172.17.0.27:9300]"},"http":{"bound_address":"inet[/0:0:0:0:0:0:0:0:9200]","publish_address":"inet[/172.17.0.27:9200]","max_content_length_in_bytes":104857600},"plugins":[{"name":"cloud-aws","version":"2.4.1","description":"Cloud AWS Plugin","jvm":true,"site":false}]}}}

Here, 172.17.0.27 is elasticsearch's container IP because,

docker inspect --format '{{ .NetworkSettings.IPAddress }}' elasticsearch

172.17.0.27

arr0n commented 8 years ago

same issue

arr0n commented 8 years ago

This is what i ended up doing;

docker run -d \ -e KIBANA_SECURE=false \ -e ELASTICSEARCH_URL=http://elasticsearch:9200 \ --link elasticsearch:es \ --publish 5601:5601 \ --name kibana \ --hostname kibana \ kibana

As you can see i went for the docker-library version of it. My guess is that when they built this particular image they hand thought about the "ELASTICSEARCH_URL" variable. Know this is old but i thought i'd share