Open mindw opened 3 years ago
Hmm..., it's curious breaking change....
Could you share your Dockerfile without sensitive information? Current official Fluentd images does not ship with gcc toolchains: https://github.com/fluent/fluentd-docker-image/blob/master/v1.12/debian/Dockerfile#L39-L41 https://github.com/fluent/fluentd-docker-image/blob/master/v1.12/debian/Dockerfile#L15-L17
Could you build your custom image which includes gcc toolchain and its libraries?
Hmm..., it's curious breaking change....
Could you share your Dockerfile without sensitive information? Current official Fluentd images does not ship with gcc toolchains: https://github.com/fluent/fluentd-docker-image/blob/master/v1.12/debian/Dockerfile#L39-L41 https://github.com/fluent/fluentd-docker-image/blob/master/v1.12/debian/Dockerfile#L15-L17
Could you build your custom image which includes gcc toolchain and its libraries? @cosmo0920 - Not sure what will that check? the filesystem needs also be made writable. The issue only happens when switching backends. And ethon is 0.13.0.
Main build files - Dockerfile:
FROM ruby:2.7-slim-buster as builder
ARG FLUENTD_VERSION="latest"
ARG JEMALLOC_VERSION="latest"
# Ensure there are enough file descriptors for running FluentD.
RUN ulimit -n 65536
ARG DEBIAN_FRONTEND=noninteractive
SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
COPY build.sh /tmp/build.sh
RUN chmod +x /tmp/build.sh
RUN /tmp/build.sh
FROM ruby:2.7-slim-buster
ARG DEBIAN_FRONTEND=noninteractive
# Ensure there are enough file descriptors for running FluentD.
RUN ulimit -n 65536
COPY --from=builder /usr/local/bundle/ /usr/local/bundle
COPY --from=builder /usr/local/lib/libjemalloc.so /usr/local/lib/libjemalloc.so
COPY entrypoint.sh /entrypoint.sh
COPY fluent.conf /etc/fluent/fluent.conf
COPY plugins /fluentd/plugins
SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"]
RUN chmod +x /entrypoint.sh
RUN apt-get update && \
apt-get install -y --no-install-recommends curl net-tools && \
apt-get clean -y && \
rm -rf \
/var/cache/debconf/* \
/var/lib/apt/lists/* \
/var/log/* \
/var/tmp/* \
rm -rf /tmp/*
# make loading the simple sniffer easier
RUN sniffer=$( gem contents fluent-plugin-elasticsearch|grep elasticsearch_simple_sniffer.rb ) ; \
cp $sniffer /fluentd/plugins
#ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1
ENV LD_PRELOAD /usr/local/lib/libjemalloc.so
CMD ["/entrypoint.sh"]
Build.sh:
#!/bin/bash
set -eux
FLUENTD_VERSION=${FLUENTD_VERSION}
JEMALLOC_VERSION=${JEMALLOC_VERSION}
BUILD_DEPS='gcc g++ make git'
echo 'gem: --no-document' >> /etc/gemrc
apt-get update
apt-get install -y --no-install-recommends curl net-tools ${BUILD_DEPS}
# install jemalloc
JEMALLOC=jemalloc-${JEMALLOC_VERSION}
curl -O -L https://github.com/jemalloc/jemalloc/releases/download/${JEMALLOC_VERSION}/${JEMALLOC}.tar.bz2
tar xf ${JEMALLOC}.tar.bz2
cd ${JEMALLOC}
./configure --disable-debug --disable-static
make -j 8
make install
cd ..
rm -rf ${JEMALLOC} ${JEMALLOC}.tar.bz2 /usr/local/lib/libjemalloc*.a
export FLUENTD_DISABLE_BUNDLER_INJECTION=1
# TODO: migrate to bundler
# install fluentd & plugins
# pin eton to a working version https://github.com/typhoeus/ethon/issues/190
gem install json_pure oj logfmt ethon:'0.12.0' typhoeus async-http
gem install elasticsearch-xpack:'>= 7.12.0'
gem install fluentd -v "${FLUENTD_VERSION}"
#gem install rake
gem install fluent-plugin-elasticsearch -v 5.0.3
gem install fluent-plugin-systemd -v 1.0.4
gem install fluent-plugin-concat -v 2.4.0
gem install fluent-plugin-grok-parser -v 2.6.2
gem install fluent-plugin-rewrite -v 0.1.1
gem install fluent-plugin-rewrite-tag-filter -v 2.4.0
gem install fluent-plugin-route -v 1.0.0
gem install fluent-plugin-multi-format-parser -v 1.0.0
gem install fluent-plugin-record-modifier -v 2.1.0
gem install fluent-plugin-detect-exceptions -v 0.0.13
gem install fluent-plugin-genhashvalue -v 1.1
gem install fluent-plugin-prometheus -v 2.0.1
gem install fluent-plugin-remote_syslog -v 1.0.0
gem install fluent-plugin-kinesis -v 3.3.0
gem install fluent-plugin-s3 -v 1.6.0
gem install fluent-plugin-kubernetes_metadata_filter -v 2.6.0
gem install specific_install
# disabled due to missing
# https://github.com/ryotarai/fluent-plugin-cloudwatch-logs/pull/74
#gem install fluent-plugin-cloudwatch-logs -v 0.13.4
gem specific_install https://github.com/mindw/fluent-plugin-cloudwatch-logs
gem uninstall specific_install
gem cleanup
(check apply)
Problem
Resolved with ethon 0.14.0 : https://github.com/typhoeus/ethon/pull/191
As of 2021-4-12 (ethon 0.13.0 release) Using the typhoeus backend causes a runtime failure. The issue is reported here to potentially save time for users and maintainers this excellent plugin.
Relevant issues: https://github.com/typhoeus/ethon/issues/186 https://github.com/typhoeus/ethon/issues/189 https://github.com/typhoeus/ethon/issues/190 https://github.com/typhoeus/ethon/pull/166
Steps to replicate
typhoeus backend
in the output,Expected Behavior or What you need to ask
FluentD starts successfully.
Using Fluentd and ES plugin versions
fluent-gem list
,td-agent-gem list
or your Gemfile.lock