DevOps/monitoring
fluentd - host is unreachable
bandal-gom
2020. 10. 6. 12:30
2020-10-05 16:19:32 +0000 [warn]: #0 failed to flush the buffer. retry_time=15 next_retry_seconds=2020-10-05 21:09:56 +0000 chunk="5b0e6e3d58b7cec7f1d92eaa332995c8" error_class=Fluent::Plugin::ElasticsearchOutput::RecoverableRequestFailure error="could not push logs to Elasticsearch cluster ({:host=>\"호스트명\", :port=>포트번호, :scheme=>\"http\"}): Host is unreachable - connect(2) for IP주소 (Errno::EHOSTUNREACH)"
로그가 수집되지 않길래 fluentd의 로그를 확인해보니 이런 처음 보는 에러가 발생헀다.
ES나 fluentd의 설정은 변경된게 없다. (추석연휴였는데 설정바뀔일이 없지!)
원인
찾아보니, fluentd-ruby의 버그.
fluentd -> ES 연결 시, host 설정이 proxy나 Load Balancing을 하게 되면 발생하는 에러라고 한다.
fluentd-ruby host를 연결해주는 default class 말고 다른 class를 사용하면 해결되는 에러.
해결방법
- default ruby class말고 다른 class 사용 (ElasticsearchSimpleSniffer)
- IP로 직접 연결
제일 빠르게 수정할 수 있는 방법은 IP로 직접연결을 선택했다. 일단은 모니터링 해보고 다른 문제가 발생하거나 또 재현된다면 여기에 추가할 예정.
반응형