安裝了collectd-java還報找不到java.so

weixin_34413065發表於2016-12-04

當我們安裝的collectd-java,就會生成java.so檔案,但是重啟collectd的時候卻還是報找不到java.so檔案是怎麼回事呢,原來是collectd想找java 6版本的,為了修復這個bug,我們執行如下操作

安裝yum install collectd-java
生成/usr/lib64/collectd/java.so檔案,
重啟systemctl restart collectd
報錯:tail -f /var/log/collectd.log
lt_dlopen ("/usr/lib64/collectd/java.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.

解決辦法:
rm /usr/lib64/libjvm.so
ln -svf /m8/jdk/jdk1.8.0_101/jre/lib/amd64/server/libjvm.so /usr/lib64/libjvm.so
systemctl restart collectd

參考:https://community.rsa.com/thread/185477

是在安裝hbase-collectd的時候解決的
因為10-jmx.conf檔案裡面有如下描述:

apt-get install collectd-java collectd-generic-jmx

If your collectd log shows an error loading java.so, see

http://www.willdurness.com/collectinggraphing-information-on-neo4j-via-collectd-and-graphite/

and how they setup LD_LIBRARY_PATH. The basic problem is

collectd wants open JDK 6. You can fix this by adding

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/lib/jvm/java-7-oracle/jre/lib/amd64/server

to your collectd init file, but pointing to the correct

library path for your java install.

相關文章