1.下载采集器:
2.把文件解压到 /usr/local/node_exporter/:
cd /usr/local/node_exporter/oracledb_exporter.0.2.3.linux-amd64
nohup ./oracledb_exporter &
3.此时有可能会报以下错误:
[root@mytest oracledb_exporter.0.2.3.linux-amd64]# cat nohup.out
/usr/local/node_exporter/oracledb_exporter.0.2.3.linux-amd64/oracledb_exporter: error while loading shared libraries: libclntsh.so.18.1: cannot open shared object file: No such file or directory
./oracledb_exporter: error while loading shared libraries: libclntsh.so.18.1: cannot open shared object file: No such file or directory
4.对于安装了oracle数据库的机器,不要再装instant client了,一是不绿色,二是包兼容性存在问题。
5.如果装instance client,会发现多个libclntsh.so.xxx会全部指向到某一个真实文件 。
/u01/app/oracle/12/db1/lib/libclntsh.so.18.1 指向到 /u01/app/oracle/12/db1/lib/libclntsh.so.12.1
6.建立软链接,并在.bash_profile增加红色行即可
cd /u01/app/oracle/12/db1/lib/
ln -s libclntsh.so.12.1 libclntsh.so.18.1
软链接后:
修改profile:
[oracle@mytest ~]$ cat ~/.bash_profile --增加红色行
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
umask 022
export ORACLE_BASE=/u01/app/oracle/12
export ORACLE_HOME=/u01/app/oracle/12/db1
export ORACLE_SID=mytest
export PATH=$ORACLE_HOME/bin:$PATH:$HOME/bin
export EDITOR=/bin/vi
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export DATA_SOURCE_NAME=system/*******
export LD_LIBRARY_PATH=/u01/app/oracle/12/db1/lib
unset USERNAME
推荐阅读