elastic: Problems With Sniffing

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! 👍

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 2
  • Comments: 32 (15 by maintainers)

Most upvoted comments

@email2liyang You can read about all of this in the documentation.

@email2liyang It does use the publish_address (as all other official clients) which is still "publish_address" : "172.17.0.3:9200".

I just ran the testsuite on Docker for Mac with 5.2.1, which you can do too with run-5.2.1.sh. The configuration file is ./config/elasticsearch.yml.

Added configuration for system_call_filter to false and it works bootstrap.system_call_filter: false

That did it, thanks for your help! Here’s the steps I took to get it to work:

  1. If you’re using Boot2Docker, get the ip address of the virtual machine (boot2docker ip). If you are not using Boot2Docker, get the IP address of the machine running the Docker daemon.
  2. Grab an elasticsearch.yml config from the Elasticsearch release archive.
  3. Update the config file to set network.publish_host to the IP address from step one.
  4. Start an Elasticsearch container using your custom config file by mounting the directory containing the config file:
    docker run -d -v "$PWD/config":/usr/share/elasticsearch/config elasticsearch
  5. Verify that publish_address is the IP address from step one when you run
    curl -XGET http://<IPAddress>:9200/_nodes/http?pretty