由 https://github.com/fluent/fluentd-kubernetes-daemonset 找到了dockerfile文件
编译了 https://github.com/fluent/fluentd-kubernetes-daemonset/blob/master/docker-image/v0.12/debian-elasticsearch/Dockerfile
一切顺利
编译完成后
发现缺少 fluent-plugin-webhdfs
通过docker run 进入docker 测试安装
运行
root@e100069201209:/home/fluent# gem install fluent-plugin-webhdfs Building native extensions. This could take a while... ERROR: Error installing fluent-plugin-webhdfs: ERROR: Failed to build gem native extension. current directory: /fluentd/vendor/bundle/ruby/2.3.0/gems/strptime-0.2.3/ext/strptime /usr/bin/ruby2.3 -r ./siteconf20180426-92-1vr0vab.rb extconf.rb mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h extconf failed, exit code 1 Gem files will remain installed in /fluentd/vendor/bundle/ruby/2.3.0/gems/strptime-0.2.3 for inspection. Results logged to /fluentd/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0/strptime-0.2.3/gem_make.out
无法安装,
git上提了issue, 开发者给出的建议是: https://docs.fluentd.org/v1.0/articles/plugin-management#gem-and-native-extension
但是我是没有看出上面缺少哪个插件
想了半天
发现原始文件里面 https://github.com/fluent/fluentd-kubernetes-daemonset/blob/master/docker-image/v0.12/debian-elasticsearch/Gemfile 有这个文件
将 fluent-plugin-webhdfs加入 解决问题
# AUTOMATICALLY GENERATED # DO NOT EDIT THIS FILE DIRECTLY, USE /templates/Gemfile.erb source "https://rubygems.org" gem "fluentd", "0.12.33" gem "fluent-plugin-secure-forward" gem "fluent-plugin-record-reformer" gem "fluent-plugin-elasticsearch" gem "fluent-plugin-kubernetes_metadata_filter" gem "ffi" gem "fluent-plugin-systemd" gem "fluent-plugin-webhdfs"