写在开篇
Oracle怎么做监控?用Zabbix?可以呀,但!本篇讲的内容是基于上次设计的Prometheus主备方案的基础上进行的, 上篇的文章是《重磅!DIY的Prometheus主备方案,全网唯一。生产未上,测试先行。》,顺便再附上该篇文章的链接:https://mp.weixin.qq.com/s?__...
方案说明
本篇讲的是下图中的红色框部分
红色框部分,是oracledb_exporter的主备方案,结合上次的设计,这个图是完整的监控架构了。
oracledb_exporter的主备方案设计思路是跟Prometheus主备的设计思路大同小异的,架构不管如何设计,都是为了在生产环境上不要存在单点。
环境规划
用途 | 主备角色 | 物理IP | VIP接管 | VIP地址 |
---|---|---|---|---|
oracledb_exporter | Master | 192.168.11.20 | 接管 | 192.168.11.200 |
oracledb_exporter | Backup | 192.168.11.21 | 待接管 | 192.168.11.200 |
安装keepalived
下载keepalived
wget https://www.keepalived.org/software/keepalived-2.2.7.tar.gz
编译和安装
mkdir -p /usr/local/keepalived tar -zxf keepalived-2.2.7.tar.gz cd keepalived-2.2.7 ./configure --prefix=/usr/local/keepalived/ && make && make install
配置master和backup的keepalived.conf
配置非抢占模式
master
global_defs { router_id lb01 } vrrp_instance VI_1 { state BACKUP interface ens32 virtual_router_id 80 priority 150 nopreempt advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.11.200/24 dev ens32 label ens32:1 } }
backup
global_defs { router_id lb02 } vrrp_instance VI_1 { state BACKUP interface ens32 virtual_router_id 80 priority 100 nopreempt advert_int 1 authentication { auth_type PASS auth_pass 1111 } virtual_ipaddress { 192.168.11.200/24 dev ens32 label ens32:1 } }
启动keepalived
/usr/local/keepalived/sbin/keepalived -f /usr/local/keepalived/etc/keepalived/keepalived.conf