I'm trying to setup the EFK stack with fluent-bit on docker containers. While I could push the logs from fluent-bit to elasticsearch, when I tried to integrate fluentd, I'm facing issues with it. This's the exact error msg:
unexpected error error_class=Errno::EADDRNOTAVAIL error="Address not available - bind(2) for \"fluent-bit\" port 24224"
The services in my docker-compose file
elasticsearch: image: docker.elastic.co/elasticsearch/elasticsearch:${TAG} ports: - '9200:9200' - '9300:9300' volumes: - type: bind source: ./config/elasticsearch.yml target: /usr/share/elasticsearch/config/elasticsearch.yml read_only: true - type: volume source: elasticsearch target: /usr/share/elasticsearch/data networks: - efk_1 fluentd: image: fluent/fluentd:${FLBV} ports: - '24224:24224' volumes: - type: bind source: ./config/fluent.conf target: /fluentd/etc/fluent.conf read_only: true networks: - efk_1 depends_on: - elasticsearch fluent-bit: image: fluent/fluent-bit:${FBITV} ports: - '2020:2020' volumes: - type: bind source: ./config/fluent-bit.conf target: /fluent-bit/etc/fluent-bit.conf read_only: true - type: bind source: ./sample_logs target: /var/log networks: - efk_1 depends_on: - fluentd
Previously I directly pushed the logs from fluent-bit to elasticsearch like this without fluentd config anywhere:
[SERVICE]
Flush 2
Log_Level debug
[INPUT]
Name tail
Path /var/log/log.txt
[OUTPUT]
Name es
Match *
Host elasticsearch
Port 9200
This pushed the logs to elasticsearch successfully, but now I added fluentd in between, so fluent-bit will send the logs to fluentd, which will then push to elasticsearch.
fluent-bit conf:
[SERVICE]
Flush 2
Log_Level debug
[INPUT]
Name tail
Path /var/log/log.txt
[OUTPUT]
Name forward
Match *
Host fluentd
fluentd conf:
<source>
@type forward
bind fluent-bit
</source>
<match **>
@type stdout
</match>
This's giving me errors as they're not able to detect the address even though they're part of the same docker network.
These're the errors I'm getting:
fluent-bit_1 | [2019/11/06 10:31:02] [error] [io] TCP connection failed: fluentd:24224 (Connection refused)
and
fluentd_1 | 2019-11-06 10:31:02 +0000 [error]: #0 unexpected error error_class=Errno::EADDRNOTAVAIL error="Address not available - bind(2) for \"fluent-bit\" port 24224"
Can someone please help me know where I'm making a mistake?