collectd安装redis插件(二)

来源:互联网 发布:淘宝精品橱窗白底图 编辑:程序博客网 时间:2024/05/01 19:11

按照上一篇文章安装后,重启collectd

/etc/init.d/collectd restart

报错如下:

ERROR: lt_dlopen ("/opt/collectd/lib/collectd/redis.so") failed: file not found. The most common cause for this problem is missing dependencies. Use ldd(1) to check the dependencies of the plugin / shared object.Stopping collectd:                                         [  OK  ]Starting collectd: ERROR: lt_dlopen ("/opt/collectd/lib/collectd/redis.so") failed: file not found. The most common cause for this problem is missing dependencies. Use ldd(1) to check the dependencies of the plugin / shared object.                                                           [  OK  ]

按照提示有ldd命令来分析:

ldd /opt/collectd/lib/collectd/redis.so

linux-vdso.so.1 =>  (0x00007fffebdd4000)libhiredis.so.0.13 => not foundlibdl.so.2 => /lib64/libdl.so.2 (0x00007ff213abd000)libc.so.6 => /lib64/libc.so.6 (0x00007ff213729000)/lib64/ld-linux-x86-64.so.2 (0x00000032c5600000)

原因很明显,找不到 libhiredis.so.0.13,它位于hiredis解压后的目录中。

把这个文件复制到对应位置:

cp ../hiredis/libhiredis.so /lib64/libhiredis.so.0.13

再用ldd命令查看:

ldd /opt/collectd/lib/collectd/redis.so

linux-vdso.so.1 =>  (0x00007fffb4bff000)libhiredis.so.0.13 => /lib64/libhiredis.so.0.13 (0x00007f2fe0987000)libdl.so.2 => /lib64/libdl.so.2 (0x00007f2fe0783000)libc.so.6 => /lib64/libc.so.6 (0x00007f2fe03ee000)/lib64/ld-linux-x86-64.so.2 (0x00000032c5600000)

依赖已经完整

/etc/init.d/collectd restart
Stopping collectd:                                         [  OK  ]Starting collectd:                                         [  OK  ]



0 0
原创粉丝点击