Open zhangxingdeppon opened 4 years ago
Try reload_connections false reload_on_failure false reconnect_on_error false
Try reload_connections false reload_on_failure false reconnect_on_error false
why? are not these options help fluend to failover and ressurect? why you are recommend to disable them? looks like fluentd's plugin cant reach host? but i goes inside pod installed curl and tried to connect to ES cluster and it available from the pod.
Hi,
I got the same issue after updating to 7.10.1. errogaht have you got any updates?
Shuaib
@errogaht My problem was too many threads in fluentd. So I reduced the number of threads to 2 & it started working.
our problem here elastic search was not (ready) because the PVCs were full...
I'm also encountered similar issue but it seems that ES plugin should be succeeeded retry:
2021-03-05 02:25:26 +0000 [warn]: #0 [out_es] failed to flush the buffer. retry_time=0 next_retry_seconds=2021-03-05 02:25:27 +0000 chunk="5bcc0c96ba71af38afee74ed360b1dc5" error_class=Fluent::Plugin::ElasticsearchOutput::RecoverableRequestFailure error="could not push logs to Elasticsearch cluster ({:host=>\"elasticsearch-master.default.svc\", :port=>9200, :scheme=>\"http\", :user=>\"elastic\", :password=>\"obfuscated\", :path=>\"\"}): read timeout reached"
2021-03-05 02:25:26 +0000 [warn]: #0 suppressed same stacktrace
2021-03-05 02:25:26 +0000 [warn]: #0 [out_es] retry succeeded. chunk_id="5bcc0c96c292d20365481eb415cd7bb0"
2021-03-05 02:25:29 +0000 [warn]: #0 [out_es] failed to flush the buffer. retry_time=0 next_retry_seconds=2021-03-05 02:25:30 +0000 chunk="5bcc0c955212f325786752072d324589" error_class=Fluent::Plugin::ElasticsearchOutput::RecoverableRequestFailure error="could not push logs to Elasticsearch cluster ({:host=>\"elasticsearch-master.default.svc\", :port=>9200, :scheme=>\"http\", :user=>\"elastic\", :password=>\"obfuscated\", :path=>\"\"}): read timeout reached"
2021-03-05 02:25:29 +0000 [warn]: #0 suppressed same stacktrace
2021-03-05 02:25:29 +0000 [warn]: #0 [out_es] failed to flush the buffer. retry_time=0 next_retry_seconds=2021-03-05 02:25:30 +0000 chunk="5bcc0c96b32fbe76a187decf434d7a82" error_class=Fluent::Plugin::ElasticsearchOutput::RecoverableRequestFailure error="could not push logs to Elasticsearch cluster ({:host=>\"elasticsearch-master.default.svc\", :port=>9200, :scheme=>\"http\", :user=>\"elastic\", :password=>\"obfuscated\", :path=>\"\"}): read timeout reached"
2021-03-05 02:25:29 +0000 [warn]: #0 suppressed same stacktrace
2021-03-05 02:25:29 +0000 [warn]: #0 [out_es] failed to flush the buffer. retry_time=0 next_retry_seconds=2021-03-05 02:25:30 +0000 chunk="5bcc0c960a588faa607bc7b43ece0de8" error_class=Fluent::Plugin::ElasticsearchOutput::RecoverableRequestFailure error="could not push logs to Elasticsearch cluster ({:host=>\"elasticsearch-master.default.svc\", :port=>9200, :scheme=>\"http\", :user=>\"elastic\", :password=>\"obfuscated\", :path=>\"\"}): read timeout reached"
2021-03-05 02:25:29 +0000 [warn]: #0 suppressed same stacktrace
2021-03-05 02:25:30 +0000 [warn]: #0 [out_es] retry succeeded. chunk_id="5bcc0c96ce24580cae6985bf9eb1cb5b"
apiVersion: v1
data:
index_template.json: |-
{
"index_patterns": [
"logstash-default*"
],
"settings": {
"index": {
"number_of_replicas": "3"
}
}
}
kind: ConfigMap
metadata:
name: es-template
namespace: kube-system
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: fluentd
namespace: kube-system
labels:
k8s-app: fluentd-logging
version: v1
spec:
selector:
matchLabels:
k8s-app: fluentd-logging
version: v1
template:
metadata:
labels:
k8s-app: fluentd-logging
version: v1
spec:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
containers:
- name: fluentd
image: fluent/fluentd-kubernetes-daemonset:v1-debian-elasticsearch
securityContext:
capabilities:
# drop: ['*']
add: ["SETPCAP", "MKNOD", "AUDIT_WRITE", "CHOWN", "NET_RAW", "DAC_OVERRIDE", "FOWNER", "FSETID", "KILL", "SETGID", "SETUID", "NET_BIND_SERVICE", "SYS_CHROOT", "SETFCAP", "DAC_READ_SEARCH"]
env:
- name: FLUENT_ELASTICSEARCH_HOST
value: "elasticsearch-master.default.svc"
- name: FLUENT_ELASTICSEARCH_PORT
value: "9200"
- name: FLUENT_ELASTICSEARCH_SCHEME
value: "http"
# Option to configure elasticsearch plugin with self signed certs
# ================================================================
- name: FLUENT_ELASTICSEARCH_SSL_VERIFY
value: "true"
# Option to configure elasticsearch plugin with tls
# ================================================================
- name: FLUENT_ELASTICSEARCH_SSL_VERSION
value: "TLSv1_2"
# X-Pack Authentication
# =====================
- name: FLUENT_ELASTICSEARCH_USER
value: "elastic"
- name: FLUENT_ELASTICSEARCH_PASSWORD
value: "changeme"
# Logz.io Authentication
# ======================
- name: LOGZIO_TOKEN
value: "ThisIsASuperLongToken"
- name: LOGZIO_LOGTYPE
value: "kubernetes"
# ILM parameters
# ==============
- name: FLUENT_ELASTICSEARCH_ENABLE_ILM
value: "true"
- name: FLUENT_ELASTICSEARCH_ILM_POLICY
value: '{ "policy": { "phases": { "hot": { "min_age": "0ms", "actions": { "rollover": { "max_age": "1d", "max_size": "5gb" } } }, "delete": { "min_age": "2d", "actions": { "delete": {}}}}}}'
- name: FLUENT_ELASTICSEARCH_TEMPLATE_FILE
value: /host/index_template.json
- name: FLUENT_ELASTICSEARCH_TEMPLATE_NAME
value: "logstash-default"
- name: FLUENTD_SYSTEMD_CONF
value: "disable"
resources:
limits:
memory: 200Mi
requests:
cpu: 100m
memory: 200Mi
volumeMounts:
- name: varlog
mountPath: /var/log
- name: varlibdockercontainers
mountPath: /var/lib/docker/containers
readOnly: true
- name: es-template
mountPath: /host
readOnly: true
terminationGracePeriodSeconds: 30
volumes:
- name: varlog
hostPath:
path: /var/log
- name: varlibdockercontainers
hostPath:
path: /var/lib/docker/containers
- name: es-template
configMap:
name: es-template
Using docker image: fluent/fluentd-kubernetes-daemonset:v1.12.0-debian-elasticsearch7-1.1
(check apply)
Problem
Hi team, I have faced a problem ,that is
Could not push logs to Elasticsearch, resetting connection and trying again. read timeout reached
, but in other fluented status is okay that they can push logs into Elasticsearch cluster, both they have the same config and es cluster server ; in addition, I have saw the article https://github.com/uken/fluent-plugin-elasticsearch/issues/746, https://github.com/uken/fluent-plugin-elasticsearch/issues/244, https://github.com/uken/fluent-plugin-elasticsearch/issues/742, and tried some methods to resolve it, but it didn't work.the methods I have used are below: the 1st method: add
reload_connections
、reconnect_on_error
、reload_on_failure
the 2nd method: increase the request_timeout to 2147483648
the fluentd's logs show that:
in this container, use tool
curl
test the es cluster that the status is okay:beacuse the above don't work, I try to use tcpdump to analyse it, found that it happend
TCP Retransmission
at this moment, I have no idea about it, is it the es cluster's problem? or the fluentd? can you give me some ideas? I'm pleasure to provide more details.the fluentd's config:
the kubenretes daemonset's yaml:
Steps to replicate
Either clone and modify https://gist.github.com/pitr/9a518e840db58f435911
OR
Provide example config and message
Expected Behavior or What you need to ask
...
Using Fluentd and ES plugin versions
fluentd --version
ortd-agent --version
fluent-gem list
,td-agent-gem list
or your Gemfile.lock