Git Product home page Git Product logo

Comments (20)

steynovich avatar steynovich commented on July 18, 2024 12

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.

tanaka-takayoshi avatar tanaka-takayoshi commented on July 18, 2024 7

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.

tanaka-takayoshi avatar tanaka-takayoshi commented on July 18, 2024 4

@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.

aerickson avatar aerickson commented on July 18, 2024 1

@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.

tanaka-takayoshi avatar tanaka-takayoshi commented on July 18, 2024 1

@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.

atomita avatar atomita commented on July 18, 2024

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.

therc avatar therc commented on July 18, 2024

There's a similar issue with the plain elasticsearch plugin + aws-es-proxy... :(

from fluent-plugin-aws-elasticsearch-service.

aerickson avatar aerickson commented on July 18, 2024

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.

vendrov avatar vendrov commented on July 18, 2024

+1
The same problem here

from fluent-plugin-aws-elasticsearch-service.

darwin67 avatar darwin67 commented on July 18, 2024

@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.

mpas avatar mpas commented on July 18, 2024

+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.

tanaka-takayoshi avatar tanaka-takayoshi commented on July 18, 2024

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.

mpas avatar mpas commented on July 18, 2024

from fluent-plugin-aws-elasticsearch-service.

aerickson avatar aerickson commented on July 18, 2024

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.

tanaka-takayoshi avatar tanaka-takayoshi commented on July 18, 2024

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.

tanaka-takayoshi avatar tanaka-takayoshi commented on July 18, 2024

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.

vendrov avatar vendrov commented on July 18, 2024

@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.

tanaka-takayoshi avatar tanaka-takayoshi commented on July 18, 2024

@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.

malford avatar malford commented on July 18, 2024

@tanaka-takayoshi with your hotfix plugin is it still necessary to specify reload_connections false in the config?

from fluent-plugin-aws-elasticsearch-service.

darwin67 avatar darwin67 commented on July 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.