天萃荷净
Oracle研究中心学习笔记:分享一篇关于Oracle数据库Goldengate monitor v11.1 Configure for Linux X86详细笔记。
本站文章除注明转载外,均为本站原创: 转载自love wife & love life —Roger 的Oracle技术博客
本文链接地址: Goldengate monitor v11.1 Configure for Linux X86
首先安装去oracle官网下载java,ogg 11.1要求至少是java 1.6以上。我这里下载的是1.6.0。下面开始安装java :
1. install java
[root@10gasm java]# chmod a+x *.bin
[root@10gasm java]# ls -ltr
total 20680
-rwxr-xr-x 1 root root 21145580 Aug 23 07:26 jre-6u34-linux-i586-rpm.bin
[root@10gasm java]# ./jre-6u34-linux-i586-rpm.bin
Unpacking...
Checksumming...
Extracting...
UnZipSFX 5.50 of 17 February 2002, by Info-ZIP (Zip-Bugs@lists.wku.edu).
inflating: jre-6u34-linux-i586.rpm
Preparing... ########################################### [100%]
1:jre ########################################### [100%]
Unpacking JAR files...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...
plugin.jar...
javaws.jar...
deploy.jar...
Done.
[root@10gasm java]#
2. configure java
配置ggs用户的环境变量,加入java的变量,如下:
[ggs@10gasm ~]$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
export PATH
export ORACLE_SID=10gasm
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export ORACLE_HOME=/home/oracle/oracle/product/10.2.0
export LD_LIBRARY_PATH=/home/ggs/ggs_home:$ORACLE_HOME/lib
###java
export JAVA_HOME=/usr/java/jre1.6.0_34
PATH=$PATH:$HOME/bin:$JAVA_HOME/jre/bin
3. 配置目标端goldengate
---目标端1
GGSCI (killdb.com) 11> view param ./GLOBALS
GGSCHEMA ggs
CHECKPOINTTABLE ggs.GGSCHKPT
ENABLEMONITORAGENT ---需要添加的参数
GGSCI (killdb.com) 12>
---目标端2
GGSCI (11gR2test) 8> view param ./GLOBALS
GGSCHEMA ggs
CHECKPOINTTABLE ggs.GGSCHKPT
ENABLEMONITORAGENT ---需要添加的参数
GGSCI (11gR2test) 9>
4. agent configure
---目标端1
cd /home/ggs/ggs_home/cfg
编辑Config.properties,修改如下几项:
jagent.host = killdb.com
monitor.host =10gasm
monitor.jmx.username =ggs
---目标端2
cd /home/ggs/ggs_home/cfg
编辑Config.properties,修改如下几项:
jagent.host = 11gR2test
monitor.host =10gasm
monitor.jmx.username =ggs
编辑完成之后,退出ggsci,然后再次登录就能看到agent了,如下:
GGSCI (11gR2test) 14> exit
-bash-3.2$ ./ggsci
2012-08-23 08:10:36 WARNING OGG-00254 ENABLEMONITORAGENT is a deprecated parameter.
Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x86, 32bit (optimized), Oracle 11g on Apr 23 2012 08:09:25
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
GGSCI (11gR2test) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
JAGENT STOPPED
REPLICAT RUNNING REP1 00:00:00 00:00:00
5. 配置ogg wallet
---源端
[root@10gasm ~]# su - ggs
[ggs@10gasm ~]$ cd ggs_home/
[ggs@10gasm ggs_home]$ ./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.
---目标端1
ggs@killdb ~]$ cd ggs_home/
[ggs@killdb ggs_home]$ ./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.
[ggs@killdb ggs_home]$
---目标端2
-bash-3.2$ cd /home/ggs/ggs_home/
-bash-3.2$ ls- ltr
-bash: ls-: command not found
-bash-3.2$ ./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.
-bash-3.2$ hostname
11gR2test
-bash-3.2$
6. 启动目标端的agent
---源端2
GGSCI (11gR2test) 8> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
JAGENT RUNNING
REPLICAT RUNNING REP1 00:00:00 00:00:01
GGSCI (11gR2test) 9> 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, x86, 32bit (optimized) on Apr 23 2012 04:36:58
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
Starting at 2012-08-23 08:25:00
***********************************************************************
Operating System Version:
Linux
Version #1 SMP Tue Mar 16 21:52:43 EDT 2010, Release 2.6.18-194.el5
Node: 11gR2test
Machine: i686
soft limit hard limit
Address Space Size : unlimited unlimited
Heap Size : unlimited unlimited
File Size : unlimited unlimited
CPU Time : unlimited unlimited
Process id: 32668
Parameters...
COMMAND java -jar -Xms64m -Xmx512m dirjar/jagent.jar
Program is 'java', arguments are '-jar -Xms64m -Xmx512m dirjar/jagent.jar'
***********************************************************************
** Run Time Messages **
***********************************************************************
2012-08-23 08:25:00 INFO OGG-00978 GGCMD JAGENT is running.
2012-08-23 08:25:00 INFO OGG-01927 Child process started, process ID 32672, command line 'java -jar -Xms64m -Xmx512m dirjar/jagent.jar'.
GGSCI (11gR2test) 10>
---源端1
GGSCI (killdb.com) 13> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
JAGENT STOPPED
REPLICAT RUNNING REP2 00:00:00 00:00:01
GGSCI (killdb.com) 14> 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, x86, 32bit (optimized) on Apr 23 2012 04:37:28
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
Starting at 2012-08-23 08:24:38
***********************************************************************
Operating System Version:
Linux
Version #1 SMP Wed Jul 12 23:27:17 EDT 2006, Release 2.6.9-42.ELsmp
Node: killdb.com
Machine: i686
soft limit hard limit
Address Space Size : unlimited unlimited
Heap Size : unlimited unlimited
File Size : unlimited unlimited
CPU Time : unlimited unlimited
Process id: 9373
Parameters...
COMMAND java -jar -Xms64m -Xmx512m dirjar/jagent.jar
Program is 'java', arguments are '-jar -Xms64m -Xmx512m dirjar/jagent.jar'
***********************************************************************
** Run Time Messages **
***********************************************************************
2012-08-23 08:24:38 INFO OGG-00978 GGCMD JAGENT is running.
2012-08-23 08:24:38 INFO OGG-01927 Child process started, process ID 9377, command line 'java -jar -Xms64m -Xmx512m dirjar/jagent.jar'.
2012-08-23 08:24:39 INFO OGG-01928 Child process terminated with exit code 1.
2012-08-23 08:24:39 INFO OGG-00979 GGCMD JAGENT is down (gracefully).
检查发现源端1,agent无法正常启动。
感觉可能是java配置有点问题,果然,检查java发现变量不对,还是1.4.2版本,如下:
-bash-3.00$ java -version
java version "1.4.2"
gcj (GCC) 3.4.6 20060404 (Red Hat 3.4.6-3)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
删除旧版本的java,然后创建一个link:
[root@killdb bin]# rm /usr/bin/java
[root@killdb bin]# ln -s /usr/java/jre1.6.0_34/bin/java java
再次进入ggsci,然后启动agent,发现ok了。
GGSCI (killdb.com) 1> info all
Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER RUNNING
JAGENT RUNNING
REPLICAT RUNNING REP2 00:00:00 00:00:09
GGSCI (killdb.com) 2> 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, x86, 32bit (optimized) on Apr 23 2012 04:37:28
Copyright (C) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
Starting at 2012-08-23 08:34:15
***********************************************************************
Operating System Version:
Linux
Version #1 SMP Wed Jul 12 23:27:17 EDT 2006, Release 2.6.9-42.ELsmp
Node: killdb.com
Machine: i686
soft limit hard limit
Address Space Size : unlimited unlimited
Heap Size : unlimited unlimited
File Size : unlimited unlimited
CPU Time : unlimited unlimited
Process id: 9950
Parameters...
COMMAND java -jar -Xms64m -Xmx512m dirjar/jagent.jar
Program is 'java', arguments are '-jar -Xms64m -Xmx512m dirjar/jagent.jar'
***********************************************************************
** Run Time Messages **
***********************************************************************
2012-08-23 08:34:15 INFO OGG-00978 GGCMD JAGENT is running.
2012-08-23 08:34:15 INFO OGG-01927 Child process started, process ID 9954, command line 'java -jar -Xms64m -Xmx512m dirjar/jagent.jar'.
7. 重启monitor
[ggs@10gasm bin]$ ./monitor.sh stop
Using CATALINA_BASE: /home/ggs/ggs_monitor/monitor_linux86/tomcat
Using CATALINA_HOME: /home/ggs/ggs_monitor/monitor_linux86/tomcat
Using CATALINA_TMPDIR: /home/ggs/ggs_monitor/monitor_linux86/tomcat/temp
Using JRE_HOME: /home/ggs/ggs_monitor/monitor_linux86/jre
[ggs@10gasm bin]$ ./monitor.sh start
Using CATALINA_BASE: /home/ggs/ggs_monitor/monitor_linux86/tomcat
Using CATALINA_HOME: /home/ggs/ggs_monitor/monitor_linux86/tomcat
Using CATALINA_TMPDIR: /home/ggs/ggs_monitor/monitor_linux86/tomcat/temp
Using JRE_HOME: /home/ggs/ggs_monitor/monitor_linux86/jre
[ggs@10gasm bin]$
最后发现虽然jagent进程都能启动,带上界面里面看不到任何东西,很奇怪,检查jagent.log,发现如下信息:
2012-08-23 09:02:42 [Shutdown Thread.] WARN MBeansContainerImpl - AgentMBean is null
2012-08-23 09:02:42 [Shutdown Thread.] ERROR JAgentWSMain - AgentMBean cannot be found. JAgent returns without releasing its resources.
2012-08-23 09:02:46 [main] INFO JAgentWSMain - About to call initialize on the WebService
2012-08-23 09:02:47 [main] INFO AgentInfoImpl - Using IP address 192.168.0.115 to connect to the Manager Web Service
2012-08-23 09:02:47 [main] INFO AgentInfoImpl - Reading Manager port 7809 from mgr.prm file.
2012-08-23 09:02:48 [main] INFO ManagerFacadeImpl - Metadata initialized
2012-08-23 09:02:48 [main] INFO JAgentDigestMD5JmxFactory - Starting JMX connector server on port 5555
2012-08-23 09:02:48 [main] INFO JAgentWSMain - JAgent finished initialization.
2012-08-23 09:02:48 [ManagerConnectionKeeper] INFO ManagerWSApi - Created WSAPI
2012-08-23 09:02:53 [getInstanceList] ERROR ManagerWSAdapter - com.goldengate.monitor.model.AgentCommunicationException: Failed to get Registry.
2012-08-23 09:02:53 [getInstanceList] ERROR ManagerFacadeImpl - Instance List returned from JNI call is null
2012-08-23 09:02:53 [getInstanceList] ERROR MBeansContainerImpl - Unexpected behavior, no agent object found! JAgent will exit!
2012-08-23 09:02:53 [main] WARN JAgentWSMain - No Agent Mbean found, exit with error code 1
2012-08-23 09:02:53 [main] INFO JAgentWSMain - JAgentWSMain is about to terminate its operahttp://www.oracleplus.nettion
2012-08-23 09:02:53 [getInstanceList] INFO MBeansContainerImpl - Jagent Mode: Monitor-Integrated
2012-08-23 09:02:53 [agentRegistration] WARN MBeansContainerImpl - AgentMBean is null
想起一个问题,可能是Config.properties配置错误了,分别修改源端和2个目标端的Config.properties文件中的
monitor.jmx.username =ggs,将其改为jmxuser,这个jmxuser是安装monitor时默认在java managment用户。开始理解错误
以为这里应该是ogg的用户。
再次启动,发现仍然不行,此时jagent.log里面又是另外的错误:
2012-08-23 09:20:54 [getInstanceList] INFO ManagerWSApi - WS getMps with id: database:ROGER
2012-08-23 09:20:54 [getInstanceList] INFO ManagerWSApi - Getting MP's for database:ROGER
2012-08-23 09:20:54 [getInstanceList] INFO ManagerWSApi - +++++++++++ getMonitoringPoints localId=database:ROGER, running=true, prevRunning=false
2012-08-23 09:20:54 [getInstanceList] INFO ManagerWSApi - getMonitoringPoints() ---------- Getting Monitoring Points for processName REP2
2012-08-23 09:20:54 [getInstanceList] INFO ManagerWSApi - getMonitoringPoints() +++++++++ GgsObjectType = DATABASE
2012-08-23 09:20:54 [getInstanceList] INFO MonitoringPointsHelper - loadDatabaseMonitoringPoints REP2 for localId=database:ROGER, running=true, prevRunning=false
2012-08-23 09:20:54 [getInstanceList] INFO MonitoringPointsHelper - Loaded REP2 Database monitoring points MpListImpl[id:database:ROGER,mps:[MpValueImpl[name:name,value:ROGER], MpValueImpl[name:version,value:Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Prod
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for Linux: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
], MpValueImpl[name:type,value:ORACLE]]]
2012-08-23 09:20:54 [getInstanceList] INFO MBeansContainerImpl - Registering MBean Trail[localId=:type=trail,name=killdb.com---7809---./dirdat---rm] as :type=trail,name=killdb.com---7809---./dirdat---rm
2012-08-23 09:20:54 [getInstanceList] INFO MBeansContainerImpl - Registering MBean Delivery[localId=:type=delivery,name=REP2] as :type=delivery,name=REP2
2012-08-23 09:20:54 [getInstanceList] INFO MBeansContainerImpl - Registering MBean Database[localId=:type=database,name=ROGER] as :type=database,name=ROGER
2012-08-23 09:20:54 [getInstanceList] INFO MBeansContainerImpl - Registering MBean Agent[localId=:type=agent,name=MGR] as :type=agent,name=MGR
2012-08-23 09:20:54 [getInstanceList] INFO MBeansContainerImpl - Jagent Mode: Monitor-Integrated
2012-08-23 09:21:14 [agentRegistration] WARN MBeansContainerImpl -
JAgent is unable to establish a connection to Monitor Server. Monitor Server is probably down. Retry again in 10 seconds.
JAgent connection info: Jagent Host=killdb.com, Jagent JMX Port=5555, Jagent Config Dir=./cfg, Monitor Host=10gasm, Monitor Port=5502
2012-08-23 09:21:44 [agentRegistration] WARN MBeansContainerImpl -
JAgent is unable to establish a connection to Monitor Server. Monitor Server is probably down. Retry again in 10 seconds.
JAgent connection info: Jagent Host=killdb.com, Jagent JMX Port=5555, Jagent Config Dir=./cfg, Monitor Host=10gasm, Monitor Port=5502
2012-08-23 09:22:14 [agentRegistration] WARN MBeansContainerImpl -
JAgent is unable to establish a connection to Monitor Server. Monitor Server is probably down. Retry again in 10 seconds.
JAgent connection info: Jagent Host=killdb.com, Jagent JMX Port=5555, Jagent Config Dir=./cfg, Monitor Host=10gasm, Monitor Port=5502
2012-08-23 09:22:44 [agentRegistration] WARN MBeansContainerImpl -
一直保持无法连接,不知道哪儿出问题了,困扰了很久。最后检查官方文档,发现了一个细微的地方:
如果你的ogg在配置rmthost时使用了ip,例如我这里:
GGSCI (10gasm) 3> view param dp1
EXTRACT dp1
RMTHOST 192.168.0.116, MGRPORT 7809 TCPBUFSIZE 5000000
PASSTHRU
RMTTRAIL ./dirdat/rm
NUMFILES 3000
SEQUENCE roger.*;
TABLE roger.*;
那么你在agent端的Config.properties配置中,jagent.host 参数应该跟你上面的rmthost参数保持一致,换句话说,
你上面rmthost是用的ip,那么你参数文件里面也必须写IP。最后我修改为如下:
---agent 1
jagent.host = 192.168.0.115
monitor.host =10gasm
monitor.jmx.username =jmxuser
---agent 2
jagent.host = 192.168.0.116
monitor.host =10gasm
monitor.jmx.username =jmxuser
最后重启下jagent进程,发现一切正常。
不错一下,通过如下方式去启停monitor程序:
[ggs@10gasm bin]$ ./monitor.sh start
Using CATALINA_BASE: /home/ggs/ggs_monitor/monitor_linux86/tomcat
Using CATALINA_HOME: /home/ggs/ggs_monitor/monitor_linux86/tomcat
Using CATALINA_TMPDIR: /home/ggs/ggs_monitor/monitor_linux86/tomcat/temp
Using JRE_HOME: /home/ggs/ggs_monitor/monitor_linux86/jre
[ggs@10gasm bin]$
[ggs@10gasm bin]$ ./monitor.sh stop
Using CATALINA_BASE: /home/ggs/ggs_monitor/monitor_linux86/tomcat
Using CATALINA_HOME: /home/ggs/ggs_monitor/monitor_linux86/tomcat
Using CATALINA_TMPDIR: /home/ggs/ggs_monitor/monitor_linux86/tomcat/temp
Using JRE_HOME: /home/ggs/ggs_monitor/monitor_linux86/jre
--------------------------------------ORACLE-DBA----------------------------------------
最权威、专业的Oracle案例资源汇总之【学习笔记】Oracle Goldengate monitor v11.1 Configure for Linux X86
本文由大师惜分飞原创分享,网址:http://www.oracleplus.net/arch/1380.html