ankiit / logstash

Automatically exported from code.google.com/p/logstash
0 stars 0 forks source link

grok not linking to tokyocabinet #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello,

I've been running logstash in a debian environment for a while and have been 
loving it.

I've been since forced to move it to a centos box which has resulted in a few 
minor complications most of which I've been able to sort out.

When running grok I come into a problem with the tokyocabinet lib.

When I run ldd libgrok.so i get :

ldd libgrok.so 
    libdl.so.2 => /lib64/libdl.so.2 (0x00002afd76bef000)
    libpcre.so.0 => /lib64/libpcre.so.0 (0x00002afd76df3000)
    libevent-1.4.so.2 => /usr/lib64/libevent-1.4.so.2 (0x00002afd77012000)
    libtokyocabinet.so.8 => not found
    libc.so.6 => /lib64/libc.so.6 (0x00002afd7722d000)
    /lib64/ld-linux-x86-64.so.2 (0x000000383b000000)
    libnsl.so.1 => /lib64/libnsl.so.1 (0x00002afd77584000)
    librt.so.1 => /lib64/librt.so.1 (0x00002afd7779d000)
    libresolv.so.2 => /lib64/libresolv.so.2 (0x00002afd779a6000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00002afd77bbb000)

So obviously grok can't find libtokyocabinet.so.8 but how do I fix this? I have 
the lib installed and I know where its located but when I've tried to recompile 
grok it can never find it.

Original issue reported on code.google.com by nceth...@gmail.com on 14 Apr 2011 at 6:33

GoogleCodeExporter commented 9 years ago
Fixed by a simple reinstall of tokyocabinet, missed the step in troubleshooting.

Original comment by nceth...@gmail.com on 14 Apr 2011 at 6:37

GoogleCodeExporter commented 9 years ago
But now I'm getting an error on the startup of logstash:

/usr/local/rvm/rubies/ruby-1.8.7-p334/lib/ruby/gems/1.8/gems/ffi-0.6.3/lib/ffi/l
ibrary.rb:61:in `ffi_lib': Could not open library 'libgrok.so': libgrok.so: 
cannot open shared object file: No such file or directory. Could not open 
library 'libgrok': libgrok: cannot open shared object file: No such file or 
directory (LoadError)

Original comment by nceth...@gmail.com on 14 Apr 2011 at 6:40

GoogleCodeExporter commented 9 years ago
hmm. Where is libgrok.so on your system?

Original comment by jls.semi...@gmail.com on 14 Apr 2011 at 7:45

GoogleCodeExporter commented 9 years ago
/usr/lib/libgrok.so

Original comment by nceth...@gmail.com on 14 Apr 2011 at 8:29

GoogleCodeExporter commented 9 years ago
Hmm. Confusing!

Can you try running logstash with 'strace -o /tmp/strace.out -e trace=file' and 
attaching the output (/tmp/strace.out) here? I wonder where ffi is looking for 
libgrok.

Original comment by jls.semi...@gmail.com on 14 Apr 2011 at 8:44

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by nceth...@gmail.com on 15 Apr 2011 at 3:39

Attachments:

GoogleCodeExporter commented 9 years ago
by looking at this:

open("/usr/local/rvm/rubies/ruby-1.8.7-p334/lib/libgrok.so", O_RDONLY) = -1 
ENOENT (No such file or directory)
open("/usr/local/rvm/rubies/ruby-1.8.7-p334/lib/libgrok.so", O_RDONLY) = -1 
ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 7
open("/lib64/libgrok.so", O_RDONLY)     = -1 ENOENT (No such file or directory)
open("/usr/lib64/tls/libgrok.so", O_RDONLY) = -1 ENOENT (No such file or 
directory)
open("/usr/lib64/libgrok.so", O_RDONLY) = -1 ENOENT (No such file or directory)

I put the libgrok in the /usr/lib64/ and it works perfectly now. Thanks for the 
strace tip I've never used it before. Its a pretty awesome little tool. 

Original comment by nceth...@gmail.com on 15 Apr 2011 at 3:43

GoogleCodeExporter commented 9 years ago

Original comment by jls.semi...@gmail.com on 26 Apr 2011 at 1:35