#相关资料链接:https://pan.baidu.com/s/1Q2Q0zINF9gsiN3vPWnc5ew 提取码:QGS1
#(linux-x86)VMware的openEuler安装开源Prometheus-2.16.0—普罗米修斯,可参照链接 https://bbs.huaweicloud.com/blogs/301517 #(linux-x86)openEuler安装Grafana-7.2.0,可参照链接 https://bbs.huaweicloud.com/blogs/301488 #通过浏览器进入Prometheus页面 IP:9090 #Prometheus数据展示 IP:9090/metrics #浏览器进入Grafana页面 IP:3000
/etc/hosts文件(添加路由),配置完路由后,服务器相互ping通即可 vi /etc/hosts
#Prometheus可以查看到监控的数据
#Grafana主界面配置prometheus数据源,服务器收集到的数据作为数据源添加到Grafana,这样Grafana就能把Prometheus的数据进行可视化。
#Oracle11g数据库安装参考链接https://bbs.huaweicloud.com/blogs/245918
#打开监听服务 su oracle lsnrctl start
#进入oracle数据库,打开实例 sqlplus / as sysdba startup #查看实例名和服务名 select instance_name from v$instance; select global_name from global_name; exit
#由于Prometheus是用golang开发的,安装Go环境,上传文件go1.16.2.linux-amd64.tar.gz。 安装go语言环境参考链接https://bbs.huaweicloud.com/blogs/281927
#上传Oracle客户端文件,安装Oracle客户端,或者安装oracle客户端并验证oracle客户端参考链接https://bbs.huaweicloud.com/blogs/249320 rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
#创建文件夹 mkdir -p /usr/lib/oracle/11.2/client64/network/admin #创建监听文件 vi /usr/lib/oracle/11.2/client64/network/admin/tnsnames.ora ORCL11G = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = IP)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) )
#授权 chmod -R 755 /usr/lib/oracle/ chown -R oracle:oinstall /usr/lib/oracle/
#配置Oracle局部环境变量 su - oracle vi ~/.bash_profile export ORACLE_HOME2=/usr/lib/oracle/11.2/client64 export ORACLE_SID=orcl11g.us.oracle.com export NLS_LAN=GAMERICAN_AMERICA.AL32UTF8 export PATH=$PATH:$ORACLE_HOME2 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME2/lib
#上传exporter文件,解压,改名,移动,授权 tar -xvf oracledb_exporter.0.2.2.linux-amd64.tar.gz chmod u+x oracledb_exporter.0.2.2.linux-amd64/oracledb_exporter mv oracledb_exporter.0.2.2.linux-amd64 oracledb_exporter mv oracledb_exporter /usr/local/ chown oracle:oinstall /usr/local/oracledb_exporter/
#先用Navicat测试是否成功连接Oracle数据库
#配置Oracle局部环境变量 su - oracle vi ~/.bash_profile export DATA_SOURCE_NAME=用户/密码
#上传依赖包,授权 cd /usr/lib/oracle/11.2/client64/lib/ chmod -R 755 libclntshcore.so.19.1 chmod -R 755 libclntsh.so.18.1 chmod -R 755 libnnz19.so
#启动服务 cd /usr/local/oracledb_exporter/ ./oracledb_exporter -log.level error -web.listen-address IP:9161 su - oracle cd /usr/local/oracledb_exporter/ nohup ./oracledb_exporter &
#下载oralce模板,Grafana导入json文件 https://grafana.com/api/dashboards/3333/revisions/1/download