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

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

Open
pcouas opened this issue Jul 29, 2017 · 7 comments
Open

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

pcouas opened this issue Jul 29, 2017 · 7 comments

Comments

@pcouas
Copy link

pcouas commented Jul 29, 2017

Hi

I have started your docker and i could connect to kibana on 5601 port but, i have following error message
Unable to connect to Elasticsearch at http://elasticsearch:9200.
I use dockertoolbox on windows10

$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
df751a8eb963 el5_nginx "/usr/local/bin/st..." 4 minutes ago Up 4 minutes 0.0.0.0:8080->80/tcp el5_nginx_1
81ab3cb3f9f9 el5_logstash "/bin/sh -c 'logst..." 4 minutes ago Up 4 minutes 0.0.0.0:5000->5000/tcp el5_logstash_1
5afdf7299d8b el5_kibana "/bin/sh -c kibana..." 4 minutes ago Up 4 minutes 0.0.0.0:5601->5601/tcp el5_kibana_1

docker ps -a
d96527b13c5f el5_elasticsearch "/bin/sh -c elasti..." 4 minutes ago Exited (1) 4 minutes ago el5_elasticsearch_1

Regards
Phil

@aboullaite
Copy link
Owner

Can you pleas past the log of the elasticsaerch container! You cannot connect to it because it's down

@pcouas
Copy link
Author

pcouas commented Jul 30, 2017

$ docker logs 42513c041b78
[2017-07-30T06:59:42,292][INFO ][o.e.n.Node ] [docker-node-1] initializing ...
[2017-07-30T06:59:42,378][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [docker-node-1] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Failed to created node environment
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:122) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.cli.Command.main(Command.java:88) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) ~[elasticsearch-5.2.1.jar:5.2.1]
Caused by: java.lang.IllegalStateException: Failed to created node environment
at org.elasticsearch.node.Node.(Node.java:255) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.node.Node.(Node.java:232) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Bootstrap$6.(Bootstrap.java:241) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:241) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.2.1.jar:5.2.1]
... 6 more
Caused by: java.nio.file.AccessDeniedException: /home/esuser/data/nodes
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:84) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) ~[?:?]
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) ~[?:?]
at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384) ~[?:?]
at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_141]
at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_141]
at java.nio.file.Files.createDirectories(Files.java:767) ~[?:1.8.0_141]
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:221) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.node.Node.(Node.java:252) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.node.Node.(Node.java:232) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Bootstrap$6.(Bootstrap.java:241) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:241) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-5.2.1.jar:5.2.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.2.1.jar:5.2.1]
... 6 more


$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
7f118fb95963 el5b_nginx "/usr/local/bin/st..." About an hour ago Up About an hour 0.0.0.0:8080->80/tcp el5b_nginx_1
8a408033d9e3 el5b_logstash "/bin/sh -c 'logst..." About an hour ago Up About an hour 0.0.0.0:5000->5000/tcp el5b_logstash_1
89b27ebb33c6 el5b_kibana "/bin/sh -c kibana..." About an hour ago Up About an hour 0.0.0.0:5601->5601/tcp el5b_kibana_1
819d137f7b79 el5b_elasticsearch "/bin/sh -c elasti..." About an hour ago Up About an hour 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp elasticsearch

C@PCSALIENWARE MINGW64 /c/zpoubelle/dockerfiles/elk/el5b
$ curl "$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' elasticsearch):9200"
curl: (7) Failed to connect to port 9200: Connection refused

I use dockertoolbox on window

@pcouas
Copy link
Author

pcouas commented Jul 30, 2017

Hi,

I have replaced /home/esuser with /usr/share in dockerFile elasticksearch
and add RUN echo 'vm.max_map_count=262144' >> /etc/sysctl.conf
and i have too docker-machine ssh sudo sysctl -w vm.max_map_count=262144

BUT now there still an network problem on Kibana .
docker ps show elasticksearch started
curl -GET http://127.0.0.1:9200
curl: (7) Failed to connect to 127.0.0.1 port 9200: Connection refused

Regards

But there is an network error
[2017-07-30T08:49:29,239][INFO ][o.e.n.Node ] [] initializing ...
[2017-07-30T08:49:29,457][INFO ][o.e.e.NodeEnvironment ] [xbuquOs] using [1] data paths, mounts [[/ (none)]], net usable_space [15gb], net total_space [17.8gb], spins? [possibly], types [aufs]
[2017-07-30T08:49:29,462][INFO ][o.e.e.NodeEnvironment ] [xbuquOs] heap size [1015.6mb], compressed ordinary object pointers [true]
[2017-07-30T08:49:29,463][INFO ][o.e.n.Node ] node name [xbuquOs] derived from node ID [xbuquOsnQW6LI0NOdN67GA]; set [node.name] to override
[2017-07-30T08:49:29,466][INFO ][o.e.n.Node ] version[5.2.1], pid[5], build[db0d481/2017-02-09T22:05:32.386Z], OS[Linux/4.4.73-boot2docker/amd64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/1.8.0_141/25.141-b15]
[2017-07-30T08:49:32,032][INFO ][o.e.p.PluginsService ] [xbuquOs] loaded module [aggs-matrix-stats]
[2017-07-30T08:49:32,033][INFO ][o.e.p.PluginsService ] [xbuquOs] loaded module [ingest-common]
[2017-07-30T08:49:32,033][INFO ][o.e.p.PluginsService ] [xbuquOs] loaded module [lang-expression]
[2017-07-30T08:49:32,033][INFO ][o.e.p.PluginsService ] [xbuquOs] loaded module [lang-groovy]
[2017-07-30T08:49:32,034][INFO ][o.e.p.PluginsService ] [xbuquOs] loaded module [lang-mustache]
[2017-07-30T08:49:32,034][INFO ][o.e.p.PluginsService ] [xbuquOs] loaded module [lang-painless]
[2017-07-30T08:49:32,034][INFO ][o.e.p.PluginsService ] [xbuquOs] loaded module [percolator]
[2017-07-30T08:49:32,034][INFO ][o.e.p.PluginsService ] [xbuquOs] loaded module [reindex]
[2017-07-30T08:49:32,038][INFO ][o.e.p.PluginsService ] [xbuquOs] loaded module [transport-netty3]
[2017-07-30T08:49:32,038][INFO ][o.e.p.PluginsService ] [xbuquOs] loaded module [transport-netty4]
[2017-07-30T08:49:32,038][INFO ][o.e.p.PluginsService ] [xbuquOs] no plugins loaded
[2017-07-30T08:49:39,570][INFO ][o.e.n.Node ] initialized
[2017-07-30T08:49:39,601][INFO ][o.e.n.Node ] [xbuquOs] starting ...
[2017-07-30T08:49:39,959][WARN ][i.n.u.i.MacAddressUtil ] Failed to find a usable hardware address from the network interfaces; using random bytes: 75:43:c3:fd:d2:72:ca:a2
[2017-07-30T08:49:40,303][INFO ][o.e.t.TransportService ] [xbuquOs] publish_address {127.0.0.1:9300}, bound_addresses {127.0.0.1:9300}
[2017-07-30T08:49:43,467][INFO ][o.e.c.s.ClusterService ] [xbuquOs] new_master {xbuquOs}{xbuquOsnQW6LI0NOdN67GA}{J3TSGUi2Q16h-hmsKByRjQ}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-elected-as-master ([0] nodes joined)
[2017-07-30T08:49:43,550][INFO ][o.e.h.HttpServer ] [xbuquOs] publish_address {127.0.0.1:9200}, bound_addresses {127.0.0.1:9200}
[2017-07-30T08:49:43,552][INFO ][o.e.n.Node ] [xbuquOs] started
[2017-07-30T08:49:43,564][INFO ][o.e.g.GatewayService ] [xbuquOs] recovered [0] indices into cluster_state

@aboullaite
Copy link
Owner

There are many unformatted logs + text!!! please try to be more specific and format your text ;)

@pcouas
Copy link
Author

pcouas commented Jul 31, 2017

there is an network problem
[2017-07-30T08:49:39,959][WARN ][i.n.u.i.MacAddressUtil ] Failed to find a usable hardware address from the network interfaces; using random bytes: 75:43:c3:fd:d2:72:ca:a2

@aboullaite
Copy link
Owner

This is just a warning! not the actual error ;) try to put the whole logs please (and format them using markdown)

@kentonbmax
Copy link

I have this same error trying to use and run the graylog2/server docker container.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants