Skip to content

Commit

Permalink
Use highly load preferrable fluent-plugin-elasticsearch configuration
Browse files Browse the repository at this point in the history
fluent-plugin-elasticsearch reloads connection after 10000 requests. (Not correspond to events counts because ES plugin uses bulk API.)

This functionality which is originated from elasticsearch-ruby gem is enabled by default.

Sometimes this reloading functionality bothers users to send events with ES plugin.

On k8s platform, users sometimes shall specify the following settings:

```aconf
reload_connections false
reconnect_on_error true
reload_on_failure true
```

This is originally reported at
uken/fluent-plugin-elasticsearch#525.

On k8s, Fluentd sometimes handles flood of events.
This is a pitfall to use fluent-plugin-elasticsearch on k8s.
So, this parameter set should be default.

Signed-off-by: Hiroshi Hatake <hatake@clear-code.com>
  • Loading branch information
cosmo0920 committed Apr 12, 2019
1 parent d7d3152 commit 71a8a61
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

IMAGE_NAME := fluent/fluentd-kubernetes
ALL_IMAGES := \
v1.3/debian-elasticsearch:v1.3.3-debian-elasticsearch-1.6,v1.3-debian-elasticsearch-1 \
v1.3/debian-elasticsearch:v1.3.3-debian-elasticsearch-1.7,v1.3-debian-elasticsearch-1 \
v1.3/debian-loggly:v1.3.3-debian-loggly-1.3,v1.3-debian-loggly-1 \
v1.3/debian-logentries:v1.3.3-debian-logentries-1.3,v1.3-debian-logentries-1 \
v1.3/debian-cloudwatch:v1.3.3-debian-cloudwatch-1.4,v1.3-debian-cloudwatch-1 \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ See also dockerhub tags page: https://hub.docker.com/r/fluent/fluentd-kubernetes

### Debian

- `v1.3.3-debian-elasticsearch-1.6,v1.3-debian-elasticsearch-1` [docker-image/v1.3/debian-elasticsearch/Dockerfile](docker-image/v1.3/debian-elasticsearch/Dockerfile)
- `v1.3.3-debian-elasticsearch-1.7,v1.3-debian-elasticsearch-1` [docker-image/v1.3/debian-elasticsearch/Dockerfile](docker-image/v1.3/debian-elasticsearch/Dockerfile)
- `v1.3.3-debian-loggly-1.3,v1.3-debian-loggly-1` [docker-image/v1.3/debian-loggly/Dockerfile](docker-image/v1.3/debian-loggly/Dockerfile)
- `v1.3.3-debian-logentries-1.3,v1.3-debian-logentries-1` [docker-image/v1.3/debian-logentries/Dockerfile](docker-image/v1.3/debian-logentries/Dockerfile)
- `v1.3.3-debian-cloudwatch-1.4,v1.3-debian-cloudwatch-1` [docker-image/v1.3/debian-cloudwatch/Dockerfile](docker-image/v1.3/debian-cloudwatch/Dockerfile)
Expand Down
10 changes: 5 additions & 5 deletions docker-image/v1.3/debian-elasticsearch/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ GEM
dig_rb (1.0.1)
domain_name (0.5.20180417)
unf (>= 0.0.5, < 1.0.0)
elasticsearch (6.2.0)
elasticsearch-api (= 6.2.0)
elasticsearch-transport (= 6.2.0)
elasticsearch-api (6.2.0)
elasticsearch (6.3.0)
elasticsearch-api (= 6.3.0)
elasticsearch-transport (= 6.3.0)
elasticsearch-api (6.3.0)
multi_json
elasticsearch-transport (6.2.0)
elasticsearch-transport (6.3.0)
faraday
multi_json
excon (0.62.0)
Expand Down
6 changes: 3 additions & 3 deletions docker-image/v1.3/debian-elasticsearch/conf/fluent.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
ssl_version "#{ENV['FLUENT_ELASTICSEARCH_SSL_VERSION'] || 'TLSv1'}"
user "#{ENV['FLUENT_ELASTICSEARCH_USER']}"
password "#{ENV['FLUENT_ELASTICSEARCH_PASSWORD']}"
reload_connections "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_CONNECTIONS'] || 'true'}"
reconnect_on_error "#{ENV['FLUENT_ELASTICSEARCH_RECONNECT_ON_ERROR'] || 'false'}"
reload_on_failure "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_ON_FAILURE'] || 'false'}"
reload_connections "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_CONNECTIONS'] || 'false'}"
reconnect_on_error "#{ENV['FLUENT_ELASTICSEARCH_RECONNECT_ON_ERROR'] || 'true'}"
reload_on_failure "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_ON_FAILURE'] || 'true'}"
logstash_prefix "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_PREFIX'] || 'logstash'}"
logstash_format "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_FORMAT'] || 'true'}"
index_name "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_INDEX_NAME'] || 'logstash'}"
Expand Down
2 changes: 1 addition & 1 deletion docker-image/v1.3/debian-elasticsearch/hooks/post_push
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tagStart=$(expr index "$IMAGE_NAME" :)
repoName=${IMAGE_NAME:0:tagStart-1}

# Tag and push image for each additional tag
for tag in {v1.3.3-debian-elasticsearch-1.6,v1.3-debian-elasticsearch-1}; do
for tag in {v1.3.3-debian-elasticsearch-1.7,v1.3-debian-elasticsearch-1}; do
docker tag $IMAGE_NAME ${repoName}:${tag}
docker push ${repoName}:${tag}
done
6 changes: 3 additions & 3 deletions templates/conf/fluent.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
ssl_version "#{ENV['FLUENT_ELASTICSEARCH_SSL_VERSION'] || 'TLSv1'}"
user "#{ENV['FLUENT_ELASTICSEARCH_USER']}"
password "#{ENV['FLUENT_ELASTICSEARCH_PASSWORD']}"
reload_connections "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_CONNECTIONS'] || 'true'}"
reconnect_on_error "#{ENV['FLUENT_ELASTICSEARCH_RECONNECT_ON_ERROR'] || 'false'}"
reload_on_failure "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_ON_FAILURE'] || 'false'}"
reload_connections "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_CONNECTIONS'] || 'false'}"
reconnect_on_error "#{ENV['FLUENT_ELASTICSEARCH_RECONNECT_ON_ERROR'] || 'true'}"
reload_on_failure "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_ON_FAILURE'] || 'true'}"
logstash_prefix "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_PREFIX'] || 'logstash'}"
logstash_format "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_FORMAT'] || 'true'}"
index_name "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_INDEX_NAME'] || 'logstash'}"
Expand Down

0 comments on commit 71a8a61

Please sign in to comment.