Monthly Archives: 六月 2014

GoldenGate cannot acquire password for jmxUser

0

Posted on by

版本:

Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100 
Linux, x64, 64bit (optimized), Oracle 10g on Oct  4 2011 23:50:20

 

  在启动agent的时候,报密码不对,报错如下:

2014-06-18 14:50:33  WARNING OGG-01689  Oracle GoldenGate Manager for Oracle, mgr.prm:  Thread: agentRegistration, Message: MBeansContainerImpl.java::::::1266 javax.security.sasl.SaslException: DIGEST-MD5: cannot acquire password for jmxUser in realm : monitorservice.
2014-06-18 14:51:33  WARNING OGG-01689  Oracle GoldenGate Manager for Oracle, mgr.prm:  Thread: agentRegistration, Message: MBeansContainerImpl.java::::::1266 javax.security.sasl.SaslException: DIGEST-MD5: cannot acquire password for jmxUser in realm : monitorservice.
2014-06-18 14:52:33  WARNING OGG-01689  Oracle GoldenGate Manager for Oracle, mgr.prm:  Thread: agentRegistration, Message: MBeansContainerImpl.java::::::1266 javax.security.sasl.SaslException: DIGEST-MD5: cannot acquire password for jmxUser in realm : monitorservice.

 

解决方法为:

1.通过pw_agent_util.sh来更新密码

pw_agent_util.sh -updateServerJMX

 

2.修改 <OGG_HOME>/cfg/Config.properties 这个文件

在配置文件里用户名是jmxUser   其实service端的用户名为jmxuser 

jmxUser 修改为jmxuser  再重启下mgr就可以了。

GoldenGate Error loading function jvm from JNI_GetCreatedJavaVMs

0

Posted on by

版本:

Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100 
Linux, x64, 64bit (optimized), Oracle 10g on Oct  4 2011 23:50:20

 

ogg在配置monitor agent时报错:

2014-06-18 14:38:59  INFO    OGG-00983  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager started (port 7809).
2014-06-18 14:38:59  INFO    OGG-01227  Oracle GoldenGate Manager for Oracle, mgr.prm:  Waiting for connection on port 7809 ..
2014-06-18 14:38:59  INFO    OGG-01338  Oracle GoldenGate Manager for Oracle, mgr.prm:  mgr: The Network Server service was started successfully.
2014-06-18 14:38:59  INFO    OGG-01338  Oracle GoldenGate Manager for Oracle, mgr.prm:  mgr: The Java VM service was started successfully.
2014-06-18 14:38:59  INFO    OGG-01338  Oracle GoldenGate Manager for Oracle, mgr.prm:  mgr: The ProcessManager service was started successfully.
2014-06-18 14:38:59  INFO    OGG-01338  Oracle GoldenGate Manager for Oracle, mgr.prm:  mgr: The Watchdog service was started successfully.
2014-06-18 14:38:59  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager service started successfully.
2014-06-18 14:39:00  ERROR   OGG-01122  Oracle GoldenGate Manager for Oracle, mgr.prm:  Error opening module jvm - Success].
2014-06-18 14:39:00  ERROR   OGG-01668  Oracle GoldenGate Manager for Oracle, mgr.prm:  PROCESS ABENDING.
2014-06-18 14:39:00  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  Stopping Network Server service..
2014-06-18 14:39:01  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  Stopping Network Server service..
2014-06-18 14:39:01  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  The Network Server service was stopped successfully.
2014-06-18 14:39:01  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  Stopping Dispatcher service..
2014-06-18 14:39:02  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  The Dispatcher service was stopped successfully.
2014-06-18 14:39:02  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  Stopping Watchdog service..
2014-06-18 14:39:02  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  The Watchdog service was stopped successfully.
2014-06-18 14:39:02  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  Stopping JavaVMService service..
2014-06-18 14:39:02  INFO    OGG-00975  Oracle GoldenGate Manager for Oracle, mgr.prm:  JavaVMService::stop() shutdownClass.
2014-06-18 14:39:02  ERROR   OGG-01123  Oracle GoldenGate Manager for Oracle, mgr.prm:  Error loading function jvm from JNI_GetCreatedJavaVMs - ./mgr: undefined symbol: JNI_GetCreatedJavaVMs].
2014-06-18 14:39:02  ERROR   OGG-01668  Oracle GoldenGate Manager for Oracle, mgr.prm:  PROCESS ABENDING.

看错误是jvm起不来报的错,通过查找资料,基本是JAVA_HOME的问题

1.JAVA_HOME 没有配置或者配置目录不对

2.jvm的lib目录没有配置,如操作系统是64位的,jvm也必须为64位的

 

官方解决方案:

In case of the 64 bit Monitor Jagent, your LD_LIBRARY_PATH must be pointing to the 64-bit libjvm.so, not the 32-bit libjvm.so.

To locate the correct one, check each of the libjvm.so using 'file' to determine which is 64-bit:

In the following example we are running on SPARC Solaris:



1. Find the correct Java directory 

 

echo $JAVA_HOME
/usr/jdk/jdk1.6.0_18





2. Search for available libjvm.so files 

 

cd $JAVA_HOME
find ./ -name libjvm.so
/usr/jdk/jdk1.6.0_18/jre/lib/sparcv9/server/libjvm.so
/usr/jdk/jdk1.6.0_18/jre/lib/sparc/client/libjvm.so
/usr/jdk/jdk1.6.0_18/jre/lib/sparc/server/libjvm.so
/usr/jdk/jdk1.6.0_18/jre/lib/sparc/libjvm.so



3. Verify with 'file' if those files are 32 bit or 64 bit libraries:

 

file /usr/jdk/jdk1.6.0_18/jre/lib/sparcv9/server/libjvm.so
/usr/jdk/jdk1.6.0_18/jre/lib/sparcv9/server/libjvm.so: ELF 64-bit MSB dynamic lib SPARCV9 Version 1, dynamically linked, not stripped, no debugging information available
file /usr/jdk/jdk1.6.0_18/jre/lib/sparc/server/libjvm.so
/usr/jdk/jdk1.6.0_18/jre/lib/sparc/server/libjvm.so: ELF 32-bit MSB dynamic lib SPARC32PLUS Version 1, V8+ Required, dynamically linked, not stripped, no debugging information available



4. Then set your JAVA_HOME, PATH with JAVA_HOME/bin and LD_LIBRARY_PATH pointing to the correct 64-bit libjvm.so:

 

export JAVA_HOME=/usr/jdk/jdk1.6.0_18
export PATH=$JAVA_HOME/bin:$PATH
export LD_LIBRARY_PATH=/usr/jdk/jdk1.6.0_18/jre/lib/sparcv9/server:$LD_LIBRARY_PATH



5. Then, after the environment variables are set, using the same session, go to GGSCI and start the MANAGER with ENABLEMONITORAGENT set in the GLOBALS file.

 

 

 

 

postgres Synchronous replication 搭建

0

Posted on by

     Synchronous replication 其实就是同步复制,即意味着直到被主服务器和复制服务器均接收完事务时,事务才会返回给应用程序。这点就确保了即便在主服务器永久下线的情况下,任何已提交事务的数据都不会丢失。

    其实同步搭建和异步搭建只需要在主库上和备库上新增一个配置文件就可以了。

    异步同步搭建链接:postgres streaming replication 搭建

 

主库:

在postgresql.conf配置文件中新增:

synchronous_standby_names = 'mydb_standby'

 

备库:

在recovery.conf 配置文件修改:

primary_conninfo = 'host=192.168.1.11 port=5432 user=repuser password=repuser  keepalives_idle=60 keepalives_interval=5 keepalives_count=5'
​修改成
primary_conninfo = 'host=192.168.1.11 port=5432 user=repuser password=repuser application_name=mydb_standby keepalives_idle=60 keepalives_interval=5 keepalives_count=5'

注意:

      若开启同步复制,若一个 standby 节点 crash ,而又没有其它standby 节点顶上,那么主库上的所有操作将会被 HANG 住,直到备库恢复;主库才恢复正常,如果是很重要的业务,建议至少配置两个 standby 节点,提高高可用性。