一、ogg agent软件下载
下载地址:https://www.oracle.com/tw/middleware/technologies/goldengate-downloads.html
下载最新版本12.2.1.2.0
二、java版本检查
1. 安装前需要确定java版本,需要大于java version "1.8.0_371"版本。
下载地址:https://www.oracle.com/java/technologies/downloads/
2.安装步骤
tar -xvf jdk-8u381-linux-x64.tar.gz -C /u09/
配置环境变量
export JAVA_HOME=/u09/jdk1.8.0_381
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$PATH
配置确定版本
三、OGG AGENT安装
本次安装采用静默安装模式,安装前配置文件monitoragent.rsp
vi monitoragent.rsp
[ENGINE]
#DO NOT CHANGE THIS.
Response File Version=1.0.0.0.0
[GENERIC]
#The oracle home location. This can be an existing Oracle Home or a new Oracle Home
ORACLE_HOME=/u09/oggagent
#Set this variable value to the Installation Type selected.
#e.g.
#Complete
#GoldenGate Veridata Web Server Installation
#GoldenGate Veridata Agent Installation
#GoldenGate Veridata Web Server and Agent Installation
#GoldenGate Monitor Web Server Installation
#GoldenGate Monitor Agent Installation
#GoldenGate Monitor Web Server and Agent Installation.
INSTALL_TYPE=GoldenGate Monitor Agent Installation
1. 新建AGENT目录
mkdir -p /u09/oggagent
2. 配置ORACLE_HOME
export ORACLE_HOME=/u09/oggagent
3. 执行安装、rsp文件要用绝对路径
java -jar fmw_12.2.1.2.0_ogg.jar -silent -responseFile /home/oracle/monitoragent.rsp
4. agent打补丁
下载26982776\ 31997138
解压文件,cd 到补丁目录执行apply
先配置ORACLE_HOME
export ORACLE_HOME=/u09/oggagent
/u09/oggagent/OPatch/opatch apply
四、创建和配置agent实例
1. 切换到agent安装目录,对每个实例都要指定不同的目录,同时与agent_home不同:
[oracle@szpmsb02cimrac-db07 31997138]$ cd /u09/oggagent/oggmon/ogg_agent/
[oracle@szpmsb02cimrac-db07 ogg_agent]$ ./createMonitorAgentInstance.sh
Please enter absolute path of Oracle GoldenGate home directory : /u09/ggs_for19c
Please enter absolute path of OGG Agent instance : /u09/oggagent
OGG Agent instance directory should be outside ORACLE_HOME.
因为配置了ORACLE_HOME环境变量。默认不能安装。因为是单MGR部署安装放一起也没啥问题
如下
[oracle@szpmsb02cimrac-db07 ogg_agent]$ exit
logout
Last login: Tue Oct 31 17:06:19 2023
[oracle@szpmsb02cimrac-db07 ~]$ cd /u09/oggagent/oggmon/ogg_agent/
[oracle@szpmsb02cimrac-db07 ogg_agent]$ ./createMonitorAgentInstance.sh
Please enter absolute path of Oracle GoldenGate home directory : /u09/ggs_for19c
Please enter absolute path of OGG Agent instance : /u09/oggagent
OGG Agent instance directory already exists, do you want to overwrite the contents (yes | no) : yes
Please enter unique name to replace timestamp in startMonitorAgent script (startMonitorAgentInstance_20231031170849.sh) : 01
Successfully created OGG Agent instance.
2. 配置agent实例参数
vi /u09/oggagent/cfg/Config.properties
需要修改如下
jagent.host=10.126.1.68 ---本机ip
monitor.jmx.username=oggadmin --监控用户名
jagent.username=oggadmin ---监控用户名
mgr.host=10.126.1.68 --ogg地址
mgr.port=7809 --mgr端口
agent.type.enabled=OEM --监控类型
3. 创建wallet身份,密码统一设置为oracle123 后面会用到
[oracle@szpmsb02cimrac-db07 ogg_agent]$ cd /u09/oggagent/bin/ [oracle@szpmsb02cimrac-db07 bin]$ ./pw_agent_util.sh -create Please create a password for Java Agent: Please confirm password for Java Agent: Please enter Monitor Server JMX password: Please confirm Monitor Server JMX password: Oct 31, 2023 5:34:52 PM oracle.security.jps.JpsStartup start INFO: Jps initializing. Oct 31, 2023 5:34:52 PM oracle.security.jps.JpsStartup start INFO: Jps started. Exception while reading /oggmon.properties: Did not find /oggmon.properties on classpath java.io.FileNotFoundException: Did not find /oggmon.properties on classpath at com.goldengate.monitor.jagent.config.impl.ConfigFilesHelper.getConfigFileInput(ConfigFilesHelper.java:69) at com.goldengate.monitor.jagent.security.PWAgentUtil.loadSecretKey(PWAgentUtil.java:665) at com.goldengate.monitor.jagent.security.PWAgentUtil.loadSecretKey(PWAgentUtil.java:651) at com.goldengate.monitor.jagent.security.PWAgentUtil.main(PWAgentUtil.java:129) Exception in thread "main" java.lang.Exception: Exception while reading /oggmon.properties: Did not find /oggmon.properties on classpath at com.goldengate.monitor.jagent.security.PWAgentUtil.loadSecretKey(PWAgentUtil.java:671) at com.goldengate.monitor.jagent.security.PWAgentUtil.loadSecretKey(PWAgentUtil.java:651) at com.goldengate.monitor.jagent.security.PWAgentUtil.main(PWAgentUtil.java:129) [oracle@szpmsb02cimrac-db07 bin]$ |
红色部分可以忽略,缺失oggmon文件是ogg monitor的,我们没有配置直接用OEM,可以忽略
五、启动monitor agent
1. 配置mgr进程
Mgr进程加入启动agent参数
autostart jagent
2. 全局文件GLOBALS加上开启监控参数
edit param ./GLOBALS
ENABLEMONITORING
退出ggsci。重进会多出两个进程
3. 先关闭所有进程和mgr进程,再启动
GSCI (szpmsb02cimrac-db07) 2> stop *
Sending STOP request to REPLICAT OGGTEST ...
Request processed.
Sending STOP request to REPLICAT REPLDW ...
STOP request pending end-of-transaction (887 records so far).
......
GGSCI (szpmsb02cimrac-db07) 4> stop mgr
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)?y
Sending STOP request to MANAGER ...
Request processed.
Manager stopped.
先启动PMSRVR进程,在启动mgr,会把agent进程一起启动。再启动其他进程
4. 查看日志有无报错
tail -20f /u09/oggagent/logs/ogg_agent.log
六、配置OEM
1. 设定自动查找添加目标
2. 主机查找,添加前提OGG主机已经配置OEMagent
编辑参数
对应修改参数
保存后立即寻找
点击发现目标,找到ogg agent
不用配置角色,切换到home
添加完成