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

Expose configuration for elastic client option elastic.SetSniff(false) #28

Closed
megastef opened this issue Feb 22, 2018 · 3 comments
Closed

Comments

@megastef
Copy link

megastef commented Feb 22, 2018

Please use the following questions as a guideline for an easier understanding of the issue without further inquiry. Thank you.

Docker version

17.12

Elasticsearch version

5 / Sematext Cloud

Operation System architecture

Max OS X

Expected behavior

Connect to Elasticsearch for bulk indexing

Actual behavior

Exit with error "

Steps to reproduce the behavior

Set elasticsearch-url: http://logsene-receiver.sematext.com

docker: Error response from daemon: failed to initialize logging driver: error creating logger: elasticsearch: cannot create a client: elasticsearch: cannot connect to the endpoint: http://logsene-receiver.sematext.com:80
sniff timeout: no Elasticsearch node available.
Stefans-MBP-3:~ stefan$ curl http://logsene-receiver.sematext.com:80/_nodes/http?pretty
{"error":"Request not authorized","errorId":"1590317784350","status":"400"}

SaaS services might not expose _nodes API (same case for AWS Elastic) for security reasons and use typically a load balancer in front of Elasticsearch.

Solution:
Initialize client with elastic.SetSniff(false), see olivere/elastic#387

@rchicoli
Copy link
Owner

cool, good to know, I will add an elasticsearch option for enable/disable the sniff. Thank you.

@rchicoli
Copy link
Owner

@megastef thanks for helping again. This issue should be fixed with this PR #29 (410f72a).
Well, I guess I should have created a separated PR for this. Anyways, hopefully I can finish it tomorrow.

@rchicoli
Copy link
Owner

@megastef the related PR is merged to master. You can use elasticsearch-sniff=false for disabling this feature. In the future versions I could build a retry, if sniff fails to connect, then try without it, something like that.
Could you please try again and let me know if the problem persists? I haven't created an acceptance criteria yet for this feature.

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

2 participants