Updated:

less than 1 minute read

개요

  • Prometheus(remote write) -> Metricbeat -> Elasticsearch 구성
  • 어느 순간부터 Elasticsearch에 document 증가폭이 매우 작아지고 Prometheus 로그에 Failed to send batch 에러 출력


해결 과정

  1. document 증가 폭이 작고 Prometheus를 재기동 하면 정상화되므로 Metricbeat가 병목일꺼라 예상
  2. metricbeat.yml의 output.elasticsearch 설정 중에 worker, bulk_max_size, compression_level 값 조정
  3. document 증가폭이 증가하다가 멈춤
  4. Prometheus의 remote_write 설정 중에 capacity, minShards, maxShards, maxSamplesPerSend, batchSendDeadline 값 조정
  5. 2 ~ 4 반복
  6. metricbeat 로그에서 bulk timeout 발생
  7. elasticsearch의 ES_JAVA_OPTS 값 조정