뭐든지시작이반이다
Dream Future
뭐든지시작이반이다
  • 분류 전체보기
    • Spring
      • 개념
      • 기타
    • Java
    • Algorithm
      • 알고리즘 정리
    • DB
      • Postgresql
    • 트러블슈팅
    • Git & Github
    • V&V
    • EFK
    • 북스터디
    • 기타

인기 글

최근 댓글

전체 방문자
오늘
어제

블로그 메뉴

  • 홈
  • 태그
  • 방명록

태그

  • ambiguous오류
  • Kibana
  • git
  • Controller
  • springboot
  • gradle
  • multimodule
  • mybatis
  • gitignore
  • spring
  • auditing
  • fluentd
  • JPA
  • efk
  • springbot
  • SelectionSort
  • lombok
  • 파티셔닝
  • SqlSessionFactory
  • requestmapping
  • dirtyChecking
  • 알고리즘
  • Kotlin
  • Hibernate
  • 트러블슈팅
  • 대규모서비스
  • sqlSessionTemplate
  • github
  • docker
  • spring-boot
hELLO · Designed By 정상우.
뭐든지시작이반이다

Dream Future

[EFK] fluentd 오류 해결 failed to flush the buffer
EFK

[EFK] fluentd 오류 해결 failed to flush the buffer

2022. 4. 15. 21:33

※ Docker 환경

1. http://localhost:9200/_cluster/health?pretty 로 elasticsearch cluster 상태를 확인해보자

(localhost부분은 서버 hostname, 9200부분은 자신이 설정한 elasticsearch 노드 포트 중 하나로 알아서 변경해서 사용하자)

{
  "cluster_name" : "es",
  "status" : "green",
  "timed_out" : false,
  "number_of_nodes" : 3,
  "number_of_data_nodes" : 3,
  "active_primary_shards" : 11,
  "active_shards" : 22,
  "relocating_shards" : 0,
  "initializing_shards" : 0,
  "unassigned_shards" : 0,
  "delayed_unassigned_shards" : 0,
  "number_of_pending_tasks" : 0,
  "number_of_in_flight_fetch" : 0,
  "task_max_waiting_in_queue_millis" : 0,
  "active_shards_percent_as_number" : 100.0
}

위와 같이 엘라스틱서치 클러스터 상태가 멀쩡한데 안되는 경우 다음으로 진행

The client is unable to verify that the server is Elasticsearch. Some functionality may not be compatible if the server is running an unsupported product. ...

Connection refused ...

위의 오류들도 버전 호환 문제로 발생하는 오류로 추정된다

 

2. fluent-plugin-elasticsearch 와 자신이 사용하는 elasticsearch 버전 호환 문제

여기서 나도 많이 헤맸는데 일단 특정 es 버전과 plugin 버전 중 어느것이 호환되는지 찾기 힘들다는 점이 가장 힘들었다. 정말 여러가지로 테스트 해보고 작성하는거지만 사용환경따라 결과가 다를 수도 있다는 점은 참고하길 바란다 (centOS 환경의 경우에는 이렇게 하지 않아도 연결되던데 wsl2 ubuntu 환경에서는 설정해주고 나서야 연결되었다)

dockerfile에서 fluentd에 플러그인을 설치할 때 먼저 자신이 사용하는 elasticsearch 버전에 해당하는 gem을 설치한다.

fluent-plugin-elasticsearch를 최신버전으로 설치한다.

 

fluentd.conf에서 밑의 링크대로 default elasticsearch version을 7으로 설정한다.

예시 설정은 다음과 같다.

<store>
        @type   elasticsearch
        hosts   es01:9200,es02:9201,es03:9202
        #user   elastic
        #password   elastic
        logstash_format true
        logstash_prefix fluentd
        logstash_dateformat %Y.%m
        verify_es_version_at_startup false
        default_elasticsearch_version 7
        suppress_type_name  true
        <buffer>
            flush_interval  1s
        </buffer>
</store>

https://github.com/uken/fluent-plugin-elasticsearch#verify_es_version_at_startup

 

GitHub - uken/fluent-plugin-elasticsearch

Contribute to uken/fluent-plugin-elasticsearch development by creating an account on GitHub.

github.com

 

일단 나는 2번 방법대로 해서 연결에 성공하였다..

연결 성공!

저작자표시 비영리 동일조건 (새창열림)

'EFK' 카테고리의 다른 글

[EFK] kibana 오류 해결 Unable to write to UUID file  (0) 2022.04.15
[EFK] fluentd broken pipe 오류 해결  (0) 2022.04.12
    'EFK' 카테고리의 다른 글
    • [EFK] kibana 오류 해결 Unable to write to UUID file
    • [EFK] fluentd broken pipe 오류 해결
    뭐든지시작이반이다
    뭐든지시작이반이다
    기록장입니다.

    티스토리툴바