1

我已经从 git repo 下载了 libmongoc 驱动程序并进行安装。然后我下载了collectd tar文件,解压并尝试安装它,一切正常,但是当我尝试运行collect d时,我遇到了这些错误:

[path to collectd]# sbin/collectd
ERROR: lt_dlopen ("/opt/collectd/lib/collectd/write_mongodb.so") failed: file not found.
The most common cause for this problem are missing dependencies. 
Use ldd(1) to check the dependencies of the plugin / shared object.
[path to  collectd]# 

[path to collectd]# ldd /opt/collectd/lib/collectd/write_mongodb.so
linux-vdso.so.1 =>  (0x00007fff1dbaa000)
libmongoc.so.0.7 => not found
libdl.so.2 => /lib64/libdl.so.2 (0x00007f8351fd1000)
libc.so.6 => /lib64/libc.so.6 (0x00007f8351c1a000)
/lib64/ld-linux-x86-64.so.2 (0x00007f83523e4000)
[path to collectd]# 
[path to  collectd]# locate libmongoc.so.0.7
/usr/local/lib/libmongoc.so.0.7
/usr/local/lib/libmongoc.so.0.7.1
[path to collectd]# 

为什么 collectd 无法识别已安装的 libmongoc 库?

4

1 回答 1

0

我用 write_mongodb 成功安装了 collectd。

[root@stackdev ~]# ldd /usr/local/etc/collectd/lib/collectd/write_mongodb.so 
    linux-vdso.so.1 =>  (0x00007fffa3ffe000)
    libmongoc.so.0.6 => not found
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f1134fe8000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f1134c2f000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f1135614000)

然后我将 libmongoc.so.0.6 (我安装在 /usr/local/lib )复制到 /lib64 的目录中,然后运行 ​​collectd ,一切正常。
希望这可以帮到你。

于 2013-06-03T02:29:27.573 回答