-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Problems With Sniffing #57
Comments
@blachniet Thank's for using Elastic. Yes, Docker seems to be a problem because (I assume) running ES inside a container is returning IP addresses that are not available from outside. There was a discussion about this in #42 IIRC. Can you post the results of |
Ah, that makes sense. It makes me feel better knowing I wasn't the only one seeing this. I'm perfectly fine leaving the sniffing disabled.
|
Unfortunately, this is what happens here: Elastic will query I haven't found a solution to this other than (somehow) getting the ES in Docker to return the external IP. I guess other clients have the same problem. If you have an idea how to solve this (or a document describing the way to configure Docker), let me know :-) |
Okay. Let me know if I can do anything here. Closing for now. |
Hi,
This occurs sometimes... not always...
|
@DasHaus and @blachniet, can you guys please share some details about your configuration? I will try to reproduce the issue. You are both using Docker, are you? How many ES instances do you use? What's your typical load? When and how often do you get errors? @DasHaus The stack trace seems odd. According to the log the error occurs in line 543 of client.go, which just does a HTTP request: res, err := c.c.Do((*http.Request)(req)) I cannot see what could go wrong here. It doesn't look like you're using a custom transport, do you? When I know your configuration, I can at least try to set up a similar environment and run the cluster test. Maybe I will get similar errors. Thanks in advance. |
I don't use Docker, I have installed it manually. I use only one instance. The load is very low (just me with the application that i'am creating). The error occurs when the server restarts by fresh (sometimes the error is raised, other not). I create the connection like this (I don't use a custom transport): u := elastic.SetURL("127.0.0.1:9200")
m, err := elastic.NewClient(u) Thanks! |
Is it just a typo, or are you using the URL without the scheme? When I use it like that, I'll get the same error as you do. When I change it to ... u := elastic.SetURL("http://127.0.0.1:9200") ... everything is okay. |
Yes, is a typo, really I have It is strange because not always occurs the error... |
I've tried 2 different Docker configurations. Below is the common details between the 2.
I ran the Elasticsearch container on Boot2Docker, on the same device as the application interacting with it. When that failed due to the problem described in the original post, I tried running the Elasticsearch container on a separate Ubuntu server with Docker installed. I ran into the same issue with this approach. I'm fairly new to Docker, so I'm not sure if there is some way I can configure my Docker containers or daemon to address this problem. In the meantime, I have disabled sniffing. |
According this post from 2012, it sounds like there should be a |
Thank you, guys. I think we have two separate issues here: 1) Docker and 2) Problems while connecting. I don't think they are related. So I started #58 for the connection issue, and keep the Docker stuff here. |
@blachniet I'm new to Docker, too. But AFAIU the option to change is
I found this article here that comes with a script that sets |
That did it, thanks for your help! Here's the steps I took to get it to work:
|
Thanks for your time! I made a wiki page for self-reference. |
It worked for me! Thanks 👍 |
1 similar comment
It worked for me! Thanks 👍 |
this way seems not work with latest elastic search image 5.2.1 I have tried both ways
if I override network.host to 127.0.0.1, we could not communicate with es from host anymore
|
@email2liyang It does use the I just ran the testsuite on Docker for Mac with 5.2.1, which you can do too with |
@olivere , thanks for your prompt response, i works with your config file, I think the key thing is that the docker instance should still bind to multiple address so that the host can communicate with es inside docker
|
by the way what's local and site means in your config file? |
@email2liyang You can read about all of this in the documentation. |
@olivere
Below is response of http://localhost:9200/_nodes/http?pretty
Below is java-config: I am not getting any error while initialising the client. Whenever i perform a search query like
, i am getting below response: |
@Sarvesh-D This repository is a Go client of Elasticsearch, not a Java client. So I cannot help you, but the people over at the ES discussion groups are sure to help. |
I am unable to start elastic search with the given configuration in your git repo. ES Version 5.5.0 [2017-07-17T09:20:27,840][INFO ][o.e.n.Node ] initialized |
@mayankdevapplift Please read this Wiki page. IP addresses are probably wrong. |
@mayankdevapplift Also, the above snippet shows that ES couldn't be started due to a failed bootstrap check... |
Thanks for the response bootstrap.ignore_system_bootstrap_checks: truediscovery.zen.minimum_master_nodes: 1 network.host:
network.publish_host: local Enable scripting as described here: https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.htmlscript.inline: true Also the bootstrap check is getting failed if I keep the above configuration but if i Keep this configuration, everything works fine but I used to get NoNodeAvailableException discovery.zen.minimum_master_nodes: 1 network.host: 127.0.0.1 |
@mayankdevapplift Which configuration are you referring to? This works fine. |
I am referring the same configuration bootstrap.ignore_system_bootstrap_checks: truediscovery.zen.minimum_master_nodes: 1 network.host:
network.publish_host: local Enable scripting as described here: https://www.elastic.co/guide/en/elasticsearch/reference/master/modules-scripting.htmlscript.inline: true And the file that I am running |
Then there's something wrong with your configuration. I just ran that script and it successfully ran ES 5.5.0 in a container. That's what I use for testing different versions here for quite some time.
|
Added configuration for system_call_filter to false and it works |
I'm running Elasticsearch v1.4.4 in a Docker container. I kept having trouble getting the client to work properly. I was trying to run the sample in the README (obviously pointing to my Docker container instead of localhost). It was taking ~30 seconds to create the client, and then would fail to create the index with the error:
no Elasticsearch node available
.As soon as I set turned off sniffing when creating the client (
elastic.SetSniff(false)
), everything worked perfectly. It doesn't really bother me that I have to turn sniffing off, but I wanted to put this issue out to see if anyone else had seen an issue like this.P.S. @olivere - The documentation is awesome! 👍
The text was updated successfully, but these errors were encountered: