blacktop / docker-elastic-stack

ELK Stack Dockerfile
MIT License
190 stars 75 forks source link

Unable to connect to Elasticsearch at http://localhost:9200. #10

Closed FrederikBrinckTruelsen closed 6 years ago

FrederikBrinckTruelsen commented 7 years ago

I get the above error in Kibana at localhost:80. I recieve the following log file from docker logs of the image then I try and spin up the cointaner.

2017-06-16 12:51:51,999 CRIT Supervisor running as root (no user in config file) 2017-06-16 12:51:52,001 INFO supervisord started with pid 6 2017-06-16 12:51:53,004 INFO spawned: 'nginx' with pid 9 2017-06-16 12:51:53,005 INFO spawned: 'elasticsearch' with pid 10 2017-06-16 12:51:53,006 INFO spawned: 'logstash' with pid 11 2017-06-16 12:51:53,007 INFO spawned: 'kibana' with pid 12 2017-06-16 12:51:54,527 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-06-16 12:51:54,650 INFO success: elasticsearch entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-06-16 12:51:54,652 INFO success: logstash entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-06-16 12:51:58,723 INFO success: kibana entered RUNNING state, process has stayed up for > than 5 seconds (startsecs) 2017-06-16 12:52:00,796 INFO exited: elasticsearch (exit status 1; not expected) 2017-06-16 12:52:01,855 INFO spawned: 'elasticsearch' with pid 82 2017-06-16 12:52:03,886 INFO success: elasticsearch entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-06-16 12:52:10,927 INFO exited: elasticsearch (exit status 1; not expected) 2017-06-16 12:52:11,624 INFO spawned: 'elasticsearch' with pid 138 2017-06-16 12:52:12,625 INFO success: elasticsearch entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-06-16 12:52:27,410 INFO exited: elasticsearch (exit status 1; not expected) 2017-06-16 12:52:27,962 INFO spawned: 'elasticsearch' with pid 194 2017-06-16 12:52:28,858 INFO success: elasticsearch entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-06-16 12:52:41,573 INFO exited: elasticsearch (exit status 1; not expected) 2017-06-16 12:52:42,148 INFO spawned: 'elasticsearch' with pid 250 2017-06-16 12:52:43,153 INFO success: elasticsearch entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-06-16 12:52:55,206 INFO exited: elasticsearch (exit status 1; not expected) 2017-06-16 12:52:56,299 INFO spawned: 'elasticsearch' with pid 306 2017-06-16 12:52:57,355 INFO success: elasticsearch entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-06-16 12:53:10,543 INFO exited: elasticsearch (exit status 1; not expected) 2017-06-16 12:53:10,632 INFO spawned: 'elasticsearch' with pid 362 2017-06-16 12:53:11,635 INFO success: elasticsearch entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-06-16 12:53:23,833 INFO exited: elasticsearch (exit status 1; not expected) 2017-06-16 12:53:24,771 INFO spawned: 'elasticsearch' with pid 418 2017-06-16 12:53:25,776 INFO success: elasticsearch entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

blacktop commented 7 years ago

Have you done this? https://github.com/blacktop/docker-elastic-stack#known-issues-warning

blacktop commented 7 years ago

Also please see #5

FrederikBrinckTruelsen commented 7 years ago

Environment is windows 10 pro running docker with hyperv and I have increased the docker memory to 4096 and 8192 and checked that the virtuel machine also gain the increased memory.

I ran these commands inside in the docker image as the root user

echo "vm.max_map_count=262144" | tee -a /etc/sysctl.conf vm.max_map_count=262144

bash-4.3# sysctl -w vm.max_map_count=262144 sysctl: error setting key 'vm.max_map_count': Read-only file system

docker exec elstack head -n30 /var/log/elasticsearch.stdout.log [2017-06at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:114) ~[elasticsearch-5.4.0.jar:5.4.0] org.elasat org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:67) ~[elasticsearch-5.4.0.jar:5.4.0]sticsearch/data/elasticsearch]] with lock id [0]; maybe these locations are not writable or multiple nodes wer e starteat org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.4.0.jar:5.4.0] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:91) ~[elasticsearch-5.4.0.jar:5.4.0] at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:260) ~[elasticsearch-5.4.0.jar:5.4.0] Caused bat org.elasticsearch.node.Node.(Node.java:262) ~[elasticsearch-5.4.0.jar:5.4.0]lasticsearch/data/elasticse arch]] wat org.elasticsearch.node.Node.(Node.java:242) ~[elasticsearch-5.4.0.jar:5.4.0]d without increasing [node. max_locaat org.elasticsearch.bootstrap.Bootstrap$6.(Bootstrap.java:242) ~[elasticsearch-5.4.0.jar:5.4.0] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:360) ~[elasticsearch-5.4.0.jar:5.4.0]] ... 6 moresticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.4.0.jar:5.4.0] Caused bat org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:239) ~[elasticsearch-5.4.0.jar:5.4.0] at org.elasticsearch.node.Node.(Node.java:242) ~[elasticsearch-5.4.0.jar:5.4.0] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:242) ~[elasticsearch-5.4.0.jar:5.4.0].0] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:123) ~[elasticsearch-5.4.0.jar:5.4.0] at sun.nio.fs.LinuxFileStore.findMountEntry(LinuxFileStore.java:91) ~[?:?] Caused by: java.io.IOException: Mount point not found

blacktop commented 7 years ago

Ah that is interesting. I am seeing the same thing on Docker for Mac and have asked for help in the docker and elasticsearch forums and with this issue https://github.com/docker/for-mac/issues/1687

FrederikBrinckTruelsen commented 7 years ago

I started running the image with docker-machine and your image ran on a colleagues computer without, I don't know if that makes a difference. I have cleaned my installation for docker-engine and still no success.

blacktop commented 7 years ago

yeah it works great on a linux host so if you use docker-machine then it will use VirtualBox under-the-covers which uses a TinyLinux VM to run docker on. Docker for Windows uses HyperV and I think they (docker) are excluding some syscalls in the creation of those VMs that my docker image uses?

blacktop commented 7 years ago

I hope that I get an answer for my issue docker/for-mac#1687 and can get to the bottom of this. The other option is to build a DAB (docker application bundle) instead of running all the processes in a single container. I think it is nice to have a single command get you up and running with an ElasticStack though 😞

FrederikBrinckTruelsen commented 7 years ago

I was perhaps a bit too implicit. I started off with trying with a weird mix of using hypertV and docker-mahcine changed it to purely using hyperv . The colleague that sucessfully ran the image with docker using hyperv and on same type of machine and operating system.

blacktop commented 6 years ago

this appears to be related to https://github.com/elastic/elasticsearch/issues/23710 and to https://bugs.openjdk.java.net/browse/JDK-8165852

blacktop commented 6 years ago

this also https://discuss.elastic.co/t/cant-create-lock-file-when-sharing-data-path-folder-between-docker-and-host/81617/5

blacktop commented 6 years ago

seems to be working in Docker for Mac edge now docker 17.07.0