Hello,
I'm trying to use the puppet module to deploy the td-agent.
Actually it's okay the agent is well deployed. Then I want to install elasticsearch.
When I try to install it with gem, it needs ruby packages/lib/headers to install it.
So I tought about deploying my plugin putting the elasticsearch rb file in /etc/td-agent/plugin/ :
====================
root@myserver-1:/etc/td-agent/plugin# ls
out_elasticsearch.rb
====================
root@myserver-1:/etc/td-agent/plugin# /etc/init.d/td-agent restart
/usr/lib/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- patron (LoadError)
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /etc/td-agent/plugin/out_elasticsearch.rb:3:in `<top (required)>'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.45/lib/fluent/plugin.rb:60:in `block in load_plugin_dir'
from /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.45/lib/fluent/plugin.rb:58:in `each'
from /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.45/lib/fluent/plugin.rb:58:in `load_plugin_dir'
from /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.45/lib/fluent/engine.rb:127:in `load_plugin_dir'
from /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.45/lib/fluent/supervisor.rb:335:in `block in init_engine'
from /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.45/lib/fluent/supervisor.rb:332:in `each'
from /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.45/lib/fluent/supervisor.rb:332:in `init_engine'
from /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.45/lib/fluent/supervisor.rb:106:in `dry_run'
from /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.45/lib/fluent/supervisor.rb:83:in `start'
from /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.45/lib/fluent/command/fluentd.rb:168:in `<top (required)>'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
from /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/fluentd-0.10.45/bin/fluentd:6:in `<top (required)>'
from /usr/lib/fluent/ruby/bin/fluentd:23:in `load'
from /usr/lib/fluent/ruby/bin/fluentd:23:in `<top (required)>'
from /usr/sbin/td-agent:7:in `load'
from /usr/sbin/td-agent:7:in `<main>'
I don't understand : It seems td-agent come with the patron gem but seems to have problem to load.
I have nothing interesting in the log as stacktrace.
How can I deploy easily plugins without installing all ruby libraries etc ?
====================
root@myserver-1:/etc/td-agent/plugin# /usr/lib/fluent/ruby/bin/fluent-gem install fluent-plugin-elasticsearch
Building native extensions. This could take a while...
ERROR: Error installing fluent-plugin-elasticsearch:
ERROR: Failed to build gem native extension.
/usr/lib/fluent/ruby/bin/ruby extconf.rb
checking for curl-config... yes
checking for rb_thread_blocking_region()... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. 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/lib/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
/usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:619:in `try_func'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:894:in `block in have_func'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /usr/lib/fluent/ruby/lib/ruby/1.9.1/mkmf.rb:893:in `have_func'
from extconf.rb:47:in `<main>'
Gem files will remain installed in /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/patron-0.4.18 for inspection.
Results logged to /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/patron-0.4.18/ext/patron/gem_make.out
====================
root@myserver-1:/etc/td-agent/plugin# cat /usr/lib/fluent/ruby/lib/ruby/gems/1.9.1/gems/patron-0.4.18/ext/patron/mkmf.log
find_executable: checking for curl-config... -------------------- yes
--------------------
"gcc -o conftest -I/usr/lib/fluent/ruby/include/ruby-1.9.1/x86_64-linux -I/usr/lib/fluent/ruby/include/ruby-1.9.1/ruby/backward -I/usr/lib/fluent/ruby/include/ruby-1.9.1 -I. -g -O2 -pedantic -Wall conftest.c -L. -L/usr/lib/fluent/ruby/lib -Wl,-R/usr/lib/fluent/ruby/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -Wl,-R -Wl,/usr/lib/fluent/ruby/lib -L/usr/lib/fluent/ruby/lib -lruby-static -lpthread -lrt -ldl -lcrypt -lm -lc -L/usr/lib/x86_64-linux-gnu -lcurl"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
====================
root@myserver-1:/etc/td-agent/plugin# dpkg -l | grep libcurl
ii libcurl3:amd64 7.26.0-1+wheezy9 amd64 easy-to-use client-side URL transfer library (OpenSSL flavour)
ii libcurl3-gnutls:amd64 7.26.0-1+wheezy8 amd64 easy-to-use client-side URL transfer library (GnuTLS flavour)
ii libcurl4-openssl-dev 7.26.0-1+wheezy9 amd64 development files and documentation for libcurl (OpenSSL flavour)
ii python-pycurl 7.19.0-5 amd64 Python bindings to libcurl
Don't hesite to ask me if I can give you more info.
The goal is to easily deploy the package everywhere with plugins without installing all ruby environment.
Thanks !