安装fluentd时配置fluent-plugin-elasticsearch发生的错误

安装fluentd时配置fluent-plugin-elasticsearch发生的错误
我们在进行fluentd,elasticsearch,kibana环境搭建时,fluentd需要es作为存储的平台,这个时候在配置 vi /etc/td-agent/td-agent.conf时
  1. <match task.**>
  2. host 192.168.0.1 ##### elasticsearch 服务器地址
  3. type elasticsearch
  4. logstash_format true
  5. flush_interval 5s
  6. include_tag_key true
  7. tag_key mapred
  8. </match>


中间涉及到使用elasticsearch,所以我们要安装

fluent-plugin-elasticsearch

/usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-elasticsearch
发生错误:ERROR:  Error installing fluent-plugin-elasticsearch:    ERROR: Failed to build gem native extension.        /usr/lib64/fluent/ruby/bin/ruby extconf.rbchecking for curl-config... nochecking for main() in -lcurl... no*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack ofnecessary libraries and/or headers.  Check the mkmf.log file for moredetails.  You may need configuration options.Provided configuration options:    --with-opt-dir    --without-opt-dir    --with-opt-include    --without-opt-include=${opt-dir}/include    --with-opt-lib    --without-opt-lib=${opt-dir}/lib    --with-make-prog    --without-make-prog    --srcdir=.    --curdir    --ruby=/usr/lib64/fluent/ruby/bin/ruby    --with-curl-dir    --without-curl-dir    --with-curl-include    --without-curl-include=${curl-dir}/include    --with-curl-lib    --without-curl-lib=${curl-dir}/lib    --with-curllib    --without-curllibextconf.rb:39:in `<main>':   Can't find libcurl or curl/curl.h (RuntimeError)
这个是由于我们没有安装 libcurl-devel造成的,我们只要先yum install  libcurl-devel,再次重新/usr/lib64/fluent/ruby/bin/fluent-gem install fluent-plugin-elasticsearch时就可以顺利进行下去。如此,fluentd配置成功,可以启动了service td-agent start

推荐阅读