Comments (20)
It seems to be the issue that AWS Elasticsearch is not 100% compatible with native ES when it comes to reloading connections to ES. Reloading connections happens every 10,000 requests by default. This can be useful when you've multiple hosts configure, but in the case of AWS ES there is only a single (HA) endpoint.
For the compatibility issue, see: https://forums.aws.amazon.com/thread.jspa?threadID=222600
In our case preventing fluentd from reloading the host configuration as a workaround (add output plugin part of fluentd-config) seems to work:
# Prevent reloading connections to AWS ES
reload_on_failure false
reload_connections false
Note: reload_connections
is false by default.
Prior to applying this workaround the connection was lost every ~3 hours (~10,800 seconds), which makes sense since we are flushing our data every 1s to ES.
I think this should be fixed in the Ruby Elasticsearch Client since will not only affect Fluentd, but potentially every Ruby/AWS ES implementation
from fluent-plugin-aws-elasticsearch-service.
The upstream PR is merged and now released. Are there any chance to grab the new version into this plugin?
from fluent-plugin-aws-elasticsearch-service.
@malford Yes, may have to specify reload_connections false
as I intended to inherit the parent plugin settings and it's true by default.
https://github.com/uken/fluent-plugin-elasticsearch/blob/v1.9.3/lib/fluent/plugin/out_elasticsearch.rb#L41
from fluent-plugin-aws-elasticsearch-service.
@mpas Those options are part of the 'parent' plugin that this plugin uses.
https://github.com/uken/fluent-plugin-elasticsearch#reload_on_failure
The https://github.com/uken/fluent-plugin-elasticsearch#usage section shows where to put it (in the match block).
from fluent-plugin-aws-elasticsearch-service.
@vendrov I forked and uploaded the gem, could you test it? I have poor knowledge of ruby gems versioning.
https://rubygems.org/gems/fluent-plugin-aws-elasticsearch-service-hotfix
@atomita I'll turn down my hotfix gems, once you release a new version. There's no need to update any file. Just build a new gem again is required.
from fluent-plugin-aws-elasticsearch-service.
Hi @darwin67 ,
Thank you for report.
Maybe it had expired of the credentials.
I'm sorry, but it takes a long time to fix...
from fluent-plugin-aws-elasticsearch-service.
There's a similar issue with the plain elasticsearch plugin + aws-es-proxy... :(
from fluent-plugin-aws-elasticsearch-service.
I'm seeing this issue also. My credentials are OK. Logging works for a few days then dies.
2016-08-13 21:20:01 +0000 [warn]: temporarily failed to flush the buffer. next_retry=2016-08-13 21:20:02 +0000 error_class="Elasticsearch::Transport::Transport::Error" error="Cannot get new connection from pool." plugin_id="object:3f859d6ae4a8"
2016-08-13 21:20:01 +0000 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/elasticsearch-transport-2.0.0/lib/elasticsearch/transport/transport/base.rb:249:in `perform_request'
2016-08-13 21:20:01 +0000 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/elasticsearch-transport-2.0.0/lib/elasticsearch/transport/transport/http/faraday.rb:20:in `perform_request'
2016-08-13 21:20:01 +0000 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/elasticsearch-transport-2.0.0/lib/elasticsearch/transport/client.rb:128:in `perform_request'
2016-08-13 21:20:01 +0000 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/elasticsearch-api-2.0.0/lib/elasticsearch/api/actions/bulk.rb:93:in `bulk'
2016-08-13 21:20:01 +0000 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluent-plugin-elasticsearch-1.5.0/lib/fluent/plugin/out_elasticsearch.rb:278:in `send'
2016-08-13 21:20:01 +0000 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluent-plugin-elasticsearch-1.5.0/lib/fluent/plugin/out_elasticsearch.rb:271:in `write'
2016-08-13 21:20:01 +0000 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.26/lib/fluent/buffer.rb:354:in `write_chunk'
2016-08-13 21:20:01 +0000 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.26/lib/fluent/buffer.rb:333:in `pop'
2016-08-13 21:20:01 +0000 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.26/lib/fluent/output.rb:338:in `try_flush'
2016-08-13 21:20:01 +0000 [warn]: /opt/td-agent/embedded/lib/ruby/gems/2.1.0/gems/fluentd-0.12.26/lib/fluent/output.rb:149:in `run'
2016-08-13 21:20:02 +0000 [warn]: temporarily failed to flush the buffer. next_retry=2016-08-13 21:20:04 +0000 error_class="Elasticsearch::Transport::Transport::Error" error="Cannot get new connection from pool." plugin_id="object:3f859d6ae4a8"
2016-08-13 21:20:02 +0000 [warn]: suppressed same stacktrace
2016-08-13 21:20:04 +0000 [warn]: temporarily failed to flush the buffer. next_retry=2016-08-13 21:20:08 +0000 error_class="Elasticsearch::Transport::Transport::Error" error="Cannot get new connection from pool." plugin_id="object:3f859d6ae4a8"
2016-08-13 21:20:04 +0000 [warn]: suppressed same stacktrace
2016-08-13 21:20:08 +0000 [warn]: temporarily failed to flush the buffer. next_retry=2016-08-13 21:20:16 +0000 error_class="Elasticsearch::Transport::Transport::Error" error="Cannot get new connection from pool." plugin_id="object:3f859d6ae4a8"
2016-08-13 21:20:08 +0000 [warn]: suppressed same stacktrace
2016-08-13 21:20:16 +0000 [warn]: temporarily failed to flush the buffer. next_retry=2016-08-13 21:20:33 +0000 error_class="Elasticsearch::Transport::Transport::Error" error="Cannot get new connection from pool." plugin_id="object:3f859d6ae4a8"
2016-08-13 21:20:16 +0000 [warn]: suppressed same stacktrace
2016-08-13 21:20:33 +0000 [warn]: temporarily failed to flush the buffer. next_retry=2016-08-13 21:21:02 +0000 error_class="Elasticsearch::Transport::Transport::Error" error="Cannot get new connection from pool." plugin_id="object:3f859d6ae4a8"
2016-08-13 21:20:33 +0000 [warn]: suppressed same stacktrace
2016-08-13 21:21:02 +0000 [warn]: temporarily failed to flush the buffer. next_retry=2016-08-13 21:22:14 +0000 error_class="Elasticsearch::Transport::Transport::Error" error="Cannot get new connection from pool." plugin_id="object:3f859d6ae4a8"
2016-08-13 21:21:02 +0000 [warn]: suppressed same stacktrace
2016-08-13 21:22:14 +0000 [warn]: temporarily failed to flush the buffer. next_retry=2016-08-13 21:24:25 +0000 error_class="Elasticsearch::Transport::Transport::Error" error="Cannot get new connection from pool." plugin_id="object:3f859d6ae4a8"
2016-08-13 21:22:14 +0000 [warn]: suppressed same stacktrace
from fluent-plugin-aws-elasticsearch-service.
+1
The same problem here
from fluent-plugin-aws-elasticsearch-service.
@steynovich Thank you for the research.
My current work around is to have a cron job to restart td-agent
everyday.
That works fine so far, but I'll like to check on what you suggested too once I have the time.
from fluent-plugin-aws-elasticsearch-service.
+1 Experiencing the same issue
@steynovich We are experiencing the same issue, can you please give some more info where to place the mentioned work around..
from fluent-plugin-aws-elasticsearch-service.
Hi, I'm afraid specifying "reload_connections false" won't work due to type mismatching.
reload_connections false
The parent plugin handles "reload_connections" options as a string type.
https://github.com/uken/fluent-plugin-elasticsearch/blob/v1.9.0/lib/fluent/plugin/out_elasticsearch_dynamic.rb#L15
https://github.com/uken/fluent-plugin-elasticsearch/blob/v1.9.0/lib/fluent/plugin/out_elasticsearch_dynamic.rb#L222
However, Elasticsearch Ruby client handles "reload_connections" as a FixNum or Boolean.
https://github.com/elastic/elasticsearch-ruby/blob/v2.0.0/elasticsearch-transport/lib/elasticsearch/transport/transport/base.rb#L51-L52
https://github.com/elastic/elasticsearch-ruby/blob/v2.0.0/elasticsearch-transport/lib/elasticsearch/transport/transport/base.rb#L70
elastic/elasticsearch-ruby#164
And the parent plugin set "reload_connections" true as default.
from fluent-plugin-aws-elasticsearch-service.
from fluent-plugin-aws-elasticsearch-service.
I don't think there's a fix yet. The current workaround is to restart fluentd regularly (we use monit). :(
from fluent-plugin-aws-elasticsearch-service.
After I looked into this issue, I found it won't happen if you don't use Dynamic configuration:
https://github.com/uken/fluent-plugin-elasticsearch/blob/master/lib/fluent/plugin/out_elasticsearch.rb#L41-L42
Also, I think we must modify parent plugin code. I forked the plugin and made some modification:
tanaka-takayoshi/fluent-plugin-elasticsearch@646fe26
I'm now testing this code and will feedback the result.
from fluent-plugin-aws-elasticsearch-service.
After running 24hours, there're no connection errors tough I usually get errors after 16hours without this fix. I'll make PR to the parent plugin repository.
from fluent-plugin-aws-elasticsearch-service.
@tanaka-takayoshi If the repo owner isn't available, do you mind to fork it and create another plugin? This issue is extremely critical, and it's waiting for more then 26 days for the owner response
from fluent-plugin-aws-elasticsearch-service.
@vendrov It's good that repo owner releases the new version to fix this issue. I think any code change is unnecessary because it refers the latest version plugin when it builds.
https://github.com/atomita/fluent-plugin-aws-elasticsearch-service/blob/master/fluent-plugin-aws-elasticsearch-service.gemspec#L27
However, repo owner will not response, I will be able to do it.
from fluent-plugin-aws-elasticsearch-service.
@tanaka-takayoshi with your hotfix plugin is it still necessary to specify reload_connections false
in the config?
from fluent-plugin-aws-elasticsearch-service.
haven't taken a look at this for a while.
looks like it's solved now so i'm closing this issue.
from fluent-plugin-aws-elasticsearch-service.
Related Issues (20)
- emit transaction failed: error_class=NoMethodError error="undefined method `full_pack' HOT 3
- Query : Aws elastic search plugin will support multiple outputs(i.e s3) HOT 4
- Unable to send logs to s3 using aws-elasticsearch-plugin - Help! HOT 3
- Unable to activate faraday_middleware-aws-sigv4-0.2.5, because faraday-0.15.4 conflicts with faraday (< 0.15, >= 0.9) (Gem::ConflictError) HOT 3
- Fluentd can't work with Signature Version 4 HOT 8
- Please release latest version HOT 3
- specifying aws-es index name HOT 2
- Is shard configuration possible while creating index HOT 2
- unable to sign request without credentials set when role-arn is provided to plugin HOT 2
- Error starting FluentD HOT 2
- Unable to start fluentd using this plugin w/ prefer_oj_serializer enabled HOT 1
- Error Starting Fluentd HOT 5
- Can We Have Weekly Index creation?
- Change fluent-plugin-elasticsearch dependency to fluent-plugin-opensearch HOT 1
- This plugin is not compatible with other plugins using the latest elasticsearch gems
- Unable to connect to opensearch using "aws-elasticsearch-service" plugin
- Please add log_400_event or log_level (debug) options HOT 9
- Need to be able to specify session duration properly
- Can i suppress type name for OpenSearchservice v2.3 HOT 2
- Fluentd Pod giving error "C:/ruby31/lib/ruby/gems/3.1.0/gems/fluent-plugin-aws-elasticsearch-service-2.4.1/lib/fluent/plugin/out_aws-elasticsearch-service.rb:144:in `include': wrong argument type Class (expected Module) (TypeError)" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fluent-plugin-aws-elasticsearch-service.