JAVA 版本大于1.6以上即可
[[email protected] ~]# rpm -ivh jre-8u65-linux-x64.rpm
Preparing... ########################################### [100%]
1:jre1.8.0_65 ########################################### [100%]
Unpacking JAR files...
plugin.jar...
javaws.jar...
deploy.jar...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...
jfxrt.jar...
添加java环境变量到oracle用户:(因我用oracle用户安装的ogg)
export PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
export ORACLE_SID=PHUB
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export DISPLAY=:0.0
umask=022
alias sqlplus=‘rlwrap sqlplus‘
alias rman=‘rlwrap rman‘
alias ggsci=‘rlwrap ggsci‘
export PATH=/u01/ogg:$PATH
export LD_LIBRARY_PATH=/u01/ogg:$LD_LIBRARY_PATH
export GGATE=/u01/ogg
export JAVA_HOME=/usr/java/jre1.8.0_65
PATH=$PATH:$HOME/bin:$JAVA_HOME/jre/bin
源端:
GGSCI (cwogg) 6> view params ./GLOBALS
GGSCHEMA ogg
ENABLEMONITORAGENT
目标端
GGSCI (ogg1) 3> view params ./GLOBALS
GGSCHEMA ogg
CHECKPOINTTABLE ogg.CKPT_TABLE
ENABLEMONITORAGENT
# cd /u01/ogg
编辑Config.properties,修改如下几项:
源库:
vim /u01/ogg/cfg/Config.properties
jagent.host=172.16.30.227
monitor.host=172.16.30.228
monitor.jmx.username=jmxuser
目标库:
vim /u01/ogg/cfg/Config.properties
jagent.host=172.16.30.226
monitor.host=172.16.30.228
monitor.jmx.username=jmxuser
配置ogg wallet
源端配置
[[email protected] ogg]$ ./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:
Wallet is created successfully.密码123123,此处密码和安装时候设定JMX密码一致。
目标端配置:
[[email protected] ogg]$ ./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:
Wallet is created successfully.
启动目标端JAGETN:
GGSCI (ogg1) 2> start JAGENT
GGCMD JAGENT started
GGSCI (ogg1) 3> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
JAGENT RUNNING
REPLICAT RUNNING REP1 00:00:00 00:00:02
GGSCI (ogg1) 4> view report JAGENT
***********************************************************************
Oracle GoldenGate Command Tool for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230
Linux, x64, 64bit (optimized) on Apr 23 2012 04:41:46
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
Starting at 2015-10-28 10:15:23
***********************************************************************
Operating System Version:
Linux
Version #1 SMP Wed Feb 22 17:37:40 EST 2012, Release 2.6.32-300.10.1.el5uek
Node: ogg1
Machine: x86_64
soft limit hard limit
Address Space Size : unlimited unlimited
Heap Size : unlimited unlimited
File Size : unlimited unlimited
CPU Time : unlimited unlimited
Process id: 13462
Parameters...
COMMAND java -jar -Xms64m -Xmx512m dirjar/jagent.jar
Program is ‘java‘, arguments are ‘-jar -Xms64m -Xmx512m dirjar/jagent.jar‘
***********************************************************************
** Run Time Messages **
***********************************************************************
2015-10-28 10:15:23 INFO OGG-00978 GGCMD JAGENT is running.
2015-10-28 10:15:23 INFO OGG-01927 Child process started, process ID 13466, command line ‘java -jar -Xms64m -Xmx512m dirjar/jage
nt.jar‘
源端启动JAGENT:
GGSCI (cwogg) 2> start JAGENT
GGCMD JAGENT started
GGSCI (cwogg) 3> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
JAGENT RUNNING
EXTRACT RUNNING EXT1 00:00:00 00:00:05
GGSCI (cwogg) 4> view report JAGENT
***********************************************************************
Oracle GoldenGate Command Tool for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230
Linux, x64, 64bit (optimized) on Apr 23 2012 04:41:46
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
Starting at 2015-10-28 10:16:58
***********************************************************************
Operating System Version:
Linux
Version #1 SMP Wed Feb 22 17:37:40 EST 2012, Release 2.6.32-300.10.1.el5uek
Node: cwogg
Machine: x86_64
soft limit hard limit
Address Space Size : unlimited unlimited
Heap Size : unlimited unlimited
File Size : unlimited unlimited
CPU Time : unlimited unlimited
Process id: 26094
Parameters...
COMMAND java -jar -Xms64m -Xmx512m dirjar/jagent.jar
Program is ‘java‘, arguments are ‘-jar -Xms64m -Xmx512m dirjar/jagent.jar‘
***********************************************************************
** Run Time Messages **
***********************************************************************
2015-10-28 10:16:58 INFO OGG-00978 GGCMD JAGENT is running.
2015-10-28 10:16:58 INFO OGG-01927 Child process started, process ID 26114, command line ‘java -jar -Xms64m -Xmx512m
dirjar/jagent.jar‘.
完成后发现界面上一直不显示:
jagent.log报错如下:
2015-10-28 11:21:22 [main] INFO JAgentWSMain - About to call initialize on the WebService
2015-10-28 11:21:22 [main] INFO AgentInfoImpl - Using IP address 172.16.30.226 to connect to the Manager Web Service
2015-10-28 11:21:22 [main] INFO AgentInfoImpl - Reading Manager port 7500 from mgr.prm file.
2015-10-28 11:21:23 [main] INFO ManagerFacadeImpl - Metadata initialized
2015-10-28 11:21:23 [main] INFO JAgentDigestMD5JmxFactory - Starting JMX connector server on port 5555
2015-10-28 11:21:23 [main] INFO JAgentWSMain - JAgent finished initialization.
2015-10-28 11:21:23 [ManagerConnectionKeeper] INFO ManagerWSApi - Created WSAPI
2015-10-28 11:21:28 [getInstanceList] ERROR ManagerWSAdapter - com.goldengate.monitor.model.AgentCommunicationException: Failed to get Registry.
2015-10-28 11:21:28 [getInstanceList] ERROR ManagerFacadeImpl - Instance List returned from JNI call is null
2015-10-28 11:21:28 [getInstanceList] ERROR MBeansContainerImpl - Unexpected behavior, no agent object found! JAgent will exit!
2015-10-28 11:21:28 [getInstanceList] INFO MBeansContainerImpl - Jagent Mode: Monitor-Integrated
2015-10-28 11:21:28 [main] WARN JAgentWSMain - No Agent Mbean found, exit with error code 1
2015-10-28 11:21:28 [main] INFO JAgentWSMain - JAgentWSMain is about to terminate its operation
2015-10-28 11:21:28 [agentRegistration] WARN MBeansContainerImpl - AgentMBean is null
对于11.2.1版本的Jagent需要在部署监控代理的服务器上的OGG下创建本地datastore,否则在启动Jagent后即使在ggsci里提示jagent启动成功,并且状态是running的,但是在服务器端的WEB界面里看不到该HOST加入到了监控中,并且在ogg安装目录下的jagent.log中会报类似以上错误:
导致这个问题的原因就是代理端没有建立本地datastore,在代理端创建datastore
GGSCI (ogg1) 2> create datastore
Datastore created
GGSCI (ogg1) 3> stop jagent
JAgent process is required by other GGS processes.
Are you sure you want to stop it (y/n)? y
Sending STOP request to GGCMD JAGENT ...
Request processed.
JAgent stopped.
GGSCI (ogg1) 7> start JAGENT
GGCMD JAGENT started
GGSCI (ogg1) 8> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
JAGENT RUNNING
REPLICAT RUNNING REP1 00:00:00 00:00:10
web监控页面上就能显示了: