安装配置Oracle GoldenGate Director监控goldengate进程

来源:互联网 发布:java新闻发布系统 编辑:程序博客网 时间:2024/05/16 14:22

如果生产环境下OGG服务特别多,安装Oracle GoldenGate Director监控goldengate进程很有必要,能很方便的监控各个进程,抓取ERROR日志,发送邮件等。


环境:rac01(ogg) 、rac02 、一台linux安装GG服务端、windows安装GG客户端
rac01 :192.168.1.5   安装有4个ogg
rac02 :192.168.1.6

数据库版本:11.2.0.3               GGDS版本:11.1.1.0

各账号密码:
weblogic    weblogic             ----linux系统账号的
gg_dir      abc12345             ---数据库的
           12345678             ---weblogic中间件安装时的


weblogic登入:   weblogic   12345678

GGDS登入:    admin    admin          ---默认账号密码


Oracle GoldenGate Director安装
Oracle GoldenGate Director是一个管理Oracle GoldenGate的图形界面工具,它安装以及配置都非常的简单。这里有两台主机rac01和rac02,上面都已经安装好了GoldenGate软件,并已成功配置。而另外一台主机linux用作GoldenGate Director Server(这里安装在rac02上面),上面安装GoldenGate Director服务器端软件
1、安装前准备:

1、JRE软件版本必须是1.6.x以上。(http://www.java.com/zh_CN/download/manual.jsp)(用root用户安装即可)
./jdk-6u25-linux-x64.bin
配置环境变量:
vi /etc/profile
加入:
export JAVA_HOME=/jdk1.6.0_25/
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

PS:/jdk目录是你自己放的,记得更改


2、安装weblogic中间件

http://blog.csdn.net/oyzl68/article/details/8852563(这个是weblogic配置的网页)
http://candon123.blog.51cto.com/704299/365086#0-sqq-1-7354-9737f6f9e09dfaf5d3fd14d775bfee85(图形化配置weblogic的网页)
 Linux下WebLogic12安装  (weblogic可以去oracle的官网去下载)
 .
# groupadd weblogic
 # useradd -g weblogic weblogic
 # passwd weblogic
 # mkdir -p /u01/weblogic
 # chown -R weblogic:weblogic /u01/weblogic
 # su - weblogic
 $ vi ~/.bash_profile
增加 export LANG=en_US.iso885915
 $ su -
 # chmod a+x /root/wls1211_linux32.bin(文件名字根据自己下载的来)
 # ./wls1211_linux32.bin -mode=console(去掉这个参数就是图形化安装,和这个步骤一样)
 Welcome:
 --------
 This installer will guide you through the installation of WebLogic 12.1.1.0.
 Type "Next" or enter to proceed to the next prompt.  If you want to change data entered previously, type "Previous".  You may quit the installer at any time by typing "Exit".
 Enter [Exit][Next]>        Next

 Choose Middleware Home Directory:
 ---------------------------------
     "Middleware Home" = [Enter new value or use default
 "/root/Oracle/Middleware"]
 Enter new Middleware Home OR [Exit][Previous][Next]>      /u01/weblogic

 Choose Middleware Home Directory:   
 ---------------------------------
     "Middleware Home" = [/u01/weblogic]
 Use above value or select another option:
     1 - Enter new Middleware Home
     2 - Change to default [/root/Oracle/Middleware]
 Enter option number to select OR [Exit][Previous][Next]>         Next

 Register for Security Updates:
 ------------------------------
 Provide your email address for security updates and  to initiate configuration manager.
    1|Email:[]
    2|Support Password:[]
    3|Receive Security Update:[Yes]
 Enter index number to select OR [Exit][Previous][Next]>        3

 Register for Security Updates:
 ------------------------------
 Provide your email address for security updates and  to initiate configuration manager.
     "Receive Security Update:" = [Enter new value or use default "Yes"]
 Enter [Yes][No]?         No

 Register for Security Updates:
 ------------------------------
 Provide your email address for security updates and  to initiate configuration manager.
     "Receive Security Update:" = [Enter new value or use default "Yes"]
     ** Do you wish to bypass initiation of the configuration manager and
     **  remain uninformed of critical security issues in your configuration?
 Enter [Yes][No]?        yes

 Register for Security Updates:
 ------------------------------
 Provide your email address for security updates and  to initiate configuration manager.
    1|Email:[]
    2|Support Password:[]
    3|Receive Security Update:[No]
 Enter index number to select OR [Exit][Previous][Next]>        Next

 Choose Install Type:
 --------------------
 Select the type of installation you wish to perform.
  ->1|Typical
     |  Install the following product(s) and component(s):
     | - WebLogic Server
     | - Oracle Coherence

    2|Custom
     |  Choose software products and components to install and perform optional
     |configuration.
 Enter index number to select OR [Exit][Previous][Next]>        1

 Choose Product Installation Directories:
 ----------------------------------------
 Middleware Home Directory: [/u01/weblogic]
 Product Installation Directories:
    1|WebLogic Server: [/u01/weblogic/wlserver_12.1]
    2|Oracle Coherence: [/u01/weblogic/coherence_3.7]
 Enter index number to select OR [Exit][Previous][Next]>        Next

 The following Products and JDKs will be installed:
 --------------------------------------------------
     WebLogic Platform 12.1.1.0
     |_____WebLogic Server
     |    |_____Core Application Server
     |    |_____Administration Console
     |    |_____Configuration Wizard and Upgrade Framework
     |    |_____Web 2.0 HTTP Pub-Sub Server
     |    |_____WebLogic SCA
     |    |_____WebLogic JDBC Drivers
     |    |_____Third Party JDBC Drivers
     |    |_____WebLogic Server Clients
     |    |_____Xquery Support
     |    |_____Evaluation Database
     |_____Oracle Coherence
     |    |_____Coherence Product Files
     |_____JDKs
          |_____SUN SDK 1.6.0_29
          |_____Oracle JRockit 1.6.0_29 SDK
     *Estimated size of installation: 1,178.0 MB
 Enter [Exit][Previous][Next]>         Next

 Installing files..
 0%          25%          50%          75%          100%
 [------------|------------|------------|------------]
 [***************************************************]
 Installing JDK....
 Performing String Substitutions...
 Configuring OCM...
 Installing Patches...
 Creating Domains...
 Installation Complete
 Press [Enter] to continue or type [Exit]>        EXIT

配置weblogic
 # cd /u01/weblogic/wlserver_12.1/common/bin
 # ./config.sh  -mode=console
 Welcome:
 --------
 Choose between creating and extending a domain. Based on your selection,
 the Configuration Wizard guides you through the steps to generate a new or
 extend an existing domain.
  ->1|Create a new WebLogic domain
     |    Create a WebLogic domain in your projects directory. 
    2|Extend an existing WebLogic domain
     |    Use this option to add new components to an existing domain and modify     |configuration settings.
 Enter index number to select OR [Exit][Next]>        1

 Select Domain Source:
 ---------------------
 Select the source from which the domain will be created. You can create the
 domain by selecting from the required components or by selecting from a
 list of existing domain templates.
  ->1|Choose Weblogic Platform components
     |    You can choose the Weblogic component(s) that you want supported in
     |your domain.
    2|Choose custom template
     |    Choose this option if you want to use an existing  template. This
     |could be a custom created template using the Template Builder.
 Enter index number to select OR [Exit][Previous][Next]>        1

 Application Template Selection:
 -------------------------------
     Available Templates
     |_____Basic WebLogic Server Domain - 12.1.1.0 [wlserver_12.1]x
     |_____Basic WebLogic SIP Server Domain - 12.1.1.0 [wlserver_12.1] [2]
     |_____WebLogic Advanced Web Services for JAX-RPC Extension - 12.1.1.0 [wlserver_12.1] [3]
     |_____WebLogic Advanced Web Services for JAX-WS Extension - 12.1.1.0 [wlserver_12.1] [4]
 Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>        next

 Edit Domain Information:
 ------------------------
     |  Name  |    Value    |
    _|________|_____________|
    1| *Name: | base_domain |
 Enter value for "Name" OR [Exit][Previous][Next]>  weblogic

 Edit Domain Information:
 ------------------------
     |  Name  | Value     |
    _|________|_______    |
    1| *Name: | weblogic  |
 Use above value or select another option:
     1 - Modify "Name"
     2 - Discard Changes
 Enter option number to select OR [Exit][Previous][Next]>   Next

 Select the target domain directory for this domain:
 ---------------------------------------------------
     "Target Location" = [Enter new value or use default
 "/u01/weblogic/user_projects/domains"]
 Enter new Target Location OR [Exit][Previous][Next]>    Next

 Configure Administrator User Name and Password:
 -----------------------------------------------
 Create a user to be assigned to the Administrator role. This user is the
 default administrator used to start development mode servers.
     |          Name           |                  Value                  |
    _|_________________________|_________________________________________|
    1|         *Name:          |                weblogic                 |
    2|     *User password:     |                                         |
    3| *Confirm user password: |                                         |
    4|      Description:       | This user is the default administrator. |
 Use above value or select another option:
     1 - Modify "Name"
     2 - Modify "User password"
     3 - Modify "Confirm user password"
     4 - Modify "Description"
 Enter option number to select OR [Exit][Previous][Next]>        2

 Configure Administrator User Name and Password:
 -----------------------------------------------
 Create a user to be assigned to the Administrator role. This user is the
 default administrator used to start development mode servers.
     "*User password:" = []
 Enter new *User password: OR [Exit][Reset][Accept]>   输入密码(至少八位) 如:12345678

Create a user to be assigned to the Administrator role. This user is the
 default administrator used to start development mode servers.
     |          Name           |                  Value                  |
    _|_________________________|_________________________________________|
    1|         *Name:          |                weblogic                 |
    2|     *User password:     |                ********                 |
    3| *Confirm user password: |                                         |
    4|      Description:       | This user is the default administrator. |
 Use above value or select another option:
     1 - Modify "Name"
     2 - Modify "User password"
     3 - Modify "Confirm user password"
     4 - Modify "Description"
     5 - Discard Changes
 Enter option number to select OR [Exit][Previous][Next]>     3

 Configure Administrator User Name and Password:
 -----------------------------------------------
 Create a user to be assigned to the Administrator role. This user is the
 default administrator used to start development mode servers.
     "*Confirm user password:" = []
 Enter new *Confirm user password: OR [Exit][Reset][Accept]>重复密码(至少八位) 12345678

Create a user to be assigned to the Administrator role. This user is the
 default administrator used to start development mode servers.
     |          Name           |                  Value                  |
    _|_________________________|_________________________________________|
    1|         *Name:          |                weblogic                 |
    2|     *User password:     |                 ******                  |
    3| *Confirm user password: |                 ******                  |
    4|      Description:       | This user is the default administrator. |

 Use above value or select another option:
     1 - Modify "Name"
     2 - Modify "User password"
     3 - Modify "Confirm user password"
     4 - Modify "Description"
     5 - Discard Changes
 Enter option number to select OR [Exit][Previous][Next]>     next

 Domain Mode Configuration:
 --------------------------
 Enable Development or Production Mode for this domain.
  ->1|Development Mode
    2|Production Mode
 Enter index number to select OR [Exit][Previous][Next]>     next

 Java SDK Selection:
 -------------------
    1|JRockit SDK 1.6.0_29 @ /var/bea/jrockit_160_29_D1.2.0-10
  ->2|Sun SDK 1.6.0_29 @ /var/bea/jdk160_29
    3|Other Java SDK
 Enter index number to select OR [Exit][Previous][Next]>     next

 Select Optional Configuration:
 ------------------------------
    1|Administration Server [ ]
    2|Managed Servers, Clusters and Machines [ ]
    3|RDBMS Security Store [ ]
 Enter index number to select OR [Exit][Previous][Next]>     1

 Select Optional Configuration:
 ------------------------------
    1|Administration Server [x]
    2|Managed Servers, Clusters and Machines [ ]
    3|RDBMS Security Store [ ]
 Enter index number to select OR [Exit][Previous][Next]>     next

 Each WebLogic Server domain must have one Administration Server. The Administration
 Server is used to perform administrative tasks.
     |       Name       |        Value        |
    _|__________________|_____________________|
    1|      *Name:      |     AdminServer     |
    2| *Listen address: | All Local Addresses |
    3|   Listen port:   |        7001         |
    4| SSL listen port: |         N/A         |
    5|   SSL enabled:   |        false        |
 Use above value or select another option:
     1 - Modify "Name"
     2 - Modify "Listen address"
     3 - Modify "Listen port"
     4 - Modify "SSL enabled"
 Enter option number to select OR [Exit][Previous][Next]>     3

 Each WebLogic Server domain must have one Administration Server. The Administration
 Server is used to perform administrative tasks.
     |       Name       |        Value        |
    _|__________________|_____________________|
    1|      *Name:      |     AdminServer     |
    2| *Listen address: | All Local Addresses |
    3|   Listen port:   |        7001         |
    4| SSL listen port: |         N/A         |
    5|   SSL enabled:   |        false        |
 Enter value for "Listen port" OR [Exit][Previous][Next]>     7001和上面OGGmonitor安装定义的HTTP端口得一样

 Each WebLogic Server domain must have one Administration Server. The Administration
 Server is used to perform administrative tasks.
     |       Name       |        Value        |
    _|__________________|_____________________|
    1|      *Name:      |     AdminServer     |
    2| *Listen address: | All Local Addresses |
    3|   Listen port:   |        7001         |
    4| SSL listen port: |         N/A         |
    5|   SSL enabled:   |        false        |
 Use above value or select another option:
     1 - Modify "Name"
     2 - Modify "Listen address"
     3 - Modify "Listen port"
     4 - Modify "SSL enabled"
     5 - Discard Changes
 Enter option number to select OR [Exit][Previous][Next]>     4

 Each WebLogic Server domain must have one Administration Server. The Administration
 Server is used to perform administrative tasks.
     *Enter index number to modify "Value"
    1|true
  ->2|false
    3|Unspecified
 Enter index number to select OR [Exit][Reset][Accept]>     1

 Each WebLogic Server domain must have one Administration Server. The Administration
 Server is used to perform administrative tasks.
     |       Name       |        Value        |
    _|__________________|_____________________|
    1|      *Name:      |     AdminServer     |
    2| *Listen address: | All Local Addresses |
    3|   Listen port:   |        7001       |
    4| SSL listen port: |        7002         |
    5|   SSL enabled:   |        true         |

 Use above value or select another option:
     1 - Modify "Name"
     2 - Modify "Listen address"
     3 - Modify "Listen port"
     4 - Modify "SSL listen port"
     5 - Modify "SSL enabled"
     6 - Discard Changes
 Enter option number to select OR [Exit][Previous][Next]>     4

 Each WebLogic Server domain must have one Administration Server. The Administration
 Server is used to perform administrative tasks.
     |       Name       |        Value        |
    _|__________________|_____________________|
    1|      *Name:      |     AdminServer     |
    2| *Listen address: | All Local Addresses |
    3|   Listen port:   |        7001         |
    4| SSL listen port: |        7002         |
    5|   SSL enabled:   |        true         |
 Enter value for "SSL listen port" OR [Exit][Previous][Next]>     7002

 Each WebLogic Server domain must have one Administration Server. The Administration
 Server is used to perform administrative tasks.
     |       Name       |        Value        |
    _|__________________|_____________________|
    1|      *Name:      |     AdminServer     |
    2| *Listen address: | All Local Addresses |
    3|   Listen port:   |        7001         |
    4| SSL listen port: |        7002         |
    5|   SSL enabled:   |        true         |
 Use above value or select another option:
     1 - Modify "Name"
     2 - Modify "Listen address"
     3 - Modify "Listen port"
     4 - Modify "SSL listen port"
     5 - Modify "SSL enabled"
     6 - Discard Changes
 Enter option number to select OR [Exit][Previous][Next]>     next

 Creating Domain...
 0%          25%          50%          75%          100%
 [------------|------------|------------|------------]
 [***************************************************]
 **** Domain Created Successfully! ****

启动weblogic
 # /u01/weblogic/user_projects/domains/weblogic/startWebLogic.sh
(后台运行:#/u01/weblogic/user_projects/domains/weblogic/startWebLogic.sh &)
  查看后台运行程序:jobs
  关闭后台运行程序:fg %n
 http://192.168.1.50:7001/console/
用户名为weblogic
密码:八位密码12345678


2.1.Weblogic 开机启动
# vi /etc/rc.local
追加 sh /var/bea/user_projects/domains/weblogic/bin/startWebLogic.sh &


3、已安装存放GG Director元数据的数据库
(Mysql、MSSQL和Oracle三个其中之一)。这里使用的是oracle数据库。(把OGG同步做完)

4、准备GG Director服务器端安装软件和客户端安装软件。其中客户端的安装软件可以事先不必准备,因为当服务器端安装好后,客户端可以从服务器端下载。

4、OGGD安装过程:

1、服务器端安装过程:(可以用xmanager远程linux服务器)

这里用的是版本11,软件全名称是gg-director-serversetup_unix_v11_1_1_0_0_005.sh。
[root@rac02 OGGMonitor]# ./gg-director-serversetup_unix_v12_1_2_0_1.sh

指定安装位置  /u01/GG_Directorygg-director  ----下一步:

指定weblogic中间件家目录  /u01/weblogic/   ---下一步:

定义http端口,默认是7001:
 
选择数据库类型:
 
指定数据库的相关信息:


server host name :192.168.1.6
#sid     -----
server name      :racdb
database port    :1521


Server Host Name 也可以写IP地址
在安装之前,必须在数据库中创建一个用户,并且密码必须是8位。
SQL> create user gg_dir identified by abc12345 default tablespace users;

User created.

SQL> grant connect,resource to gg_dir;

Grant succeeded.

 
安装概要:
 
 
安装完成后,就可以启动weblogic服务了,启动脚本位于/u01/GG_Directorgg-director/domain目录下面,名称是startWebLogic.sh。(启动完脚本之后会此终端窗口不能关闭也不能做其他操作可以后面加 & 后台运行);停止脚本位于/usr/GG_Directorgg-director/domain/bin目录下面,脚本名称是stopWebLogic.sh。(要关闭服务的话关闭终端窗口即可)其中的/u01/GG_Directorgg-director路径是在安装过程中指定的。

启动完成后,就可以在客户端通过浏览器访问服务器端下载客户端安装软件了,具体访问以下地址:

http://serverIP:7001  根据系统平台选择相应的文件下载即可。

客户端的安装
这里我们下载的windows客户端安装,安装安装向导完成即可。
配置篇客户端:
服务端启动weblogic服务
注意:这里应该先停止之前启动的weblogic (如果安装完webgic就启动了的话,现在启动GG的weblogic就要先停止之前的weblogic)
GGDS的weblogic:/u01/weblogic/user_projects/domains/weblogic/bin/stopWebLogic.sh
     (启动脚本在:/u01/weblogic/user_projects/domains/weblogic/startWebLogic.sh)

也可以根据以下方法查找并杀掉进程:
ps -ef | grep web
netstat -anpt | grep 7001
kill  -9   xxx

GGDS在  :/u01/GG_Directorgg-director/domain/startWebLogic.sh
停止脚本在:/u01/GG_Directorgg-director/domain/bin/stopWebLogic.sh


2、(linux的客户端,我们用windows的跳过)客户端如何访问服务端呢?在客户端上,执行run-director.sh程序,输入相关信息即可。默认的用户名和密码是admin/admin,服务器是指《主机名/IP:端口号》。
3、管理Oracle GoldenGate data sources:运行了run-admin.sh程序后,会出现如下画面:(我之前做的时候在Linux系统中登陆不上客户端,在windows中安装客户端可以登陆。客户端的机器必须安装Java环境)

windows的
 
用户名和密码都是admin,server是指GG Director安装机器名称或IP,后面一定要加端口号,否则会登录失败的。登录成功后,在Data Source选项卡里,输入两节点的相关信息,如图:
 
其中Manager Port就是在安装GG时定义的端口,默认是7809。还有一些其他参数的意义请参考官方文档。
配置客户端的参数具体描述:
  Host Identity:
? Fully Qualified Domain Name : GoldenGate实例所在的服务器名
? Manager Port : GoldenGate实例MGR进程端口号
? Data Source Name :原则上可以填写任何名称。建议制定命名规范。(如masterdatab)
? 点击Check–Connection 验证连接。
 
GoldenGate Info:
? Host Operating System: 选择WU(即Windows/Unix意思)
? Database: 选择数据库类型。Oracle数据库应选择ORA。
? GoldenGate Version : 10.4 .1.1
? 点击 “Save”,然后点击“Yes”。
 
从左侧的面板上选择刚才创建的Data Source(只在通过ODBC连接时才需要填写),填写完其他信息,包括:
Default DB Credential:
? DSN: 数据库实例名或服务名
? Username : 用户名
? Password & Confirm Password : 密码
Access Control:
? Owner : 选择admin(表示配置该数据源的owner为admin,也可以选择admin外的用户)
? 勾选Host is Observable选项(表示配置该数据源对其他用户可见,也可以不勾选)
? GoldenGate Version : 10.4
? 点击“Save”
 Cannot Establish Remote GGSCI Session
There has been a problem reaching the remote host - please try the following:


完成后,通过浏览器访问http://IP:7001/acon:
要想看的以下情况,前提必须把ogg同步搭建完成且进程都正常启动:
账号密码:admin    admin  
 
如果配置成功的话,就会看到俩节点上的进程都处于运行状态。
整个主界面分为三个区域:
左侧面板包含了所有GoldenGate实例的列表以及一些功能链接。
右侧上方按照GoldenGate实例分组列出了每个实例上所有进程的概况。
右侧下方列出了所选实例的事件日志。
监控整体运行情况
首先查看主界面左侧面板,点击一个实例左边的黑三角符号可以展开该实例,查看到具体的进程。右侧面板也会有相应的变化,列出该实例下所有进程的概要信息以及事件日志。
 
  
 表示实例正在运行(MGR进程正常运行)
 表示实例没有启动(MGR进程已停止)
 表示进程正常运行
 表示进程正常停止
 表示进程非正常停止,需要进一步调查原因。同时会用红色的Abended字样标示。  
监控进程状态
右侧上方的面板显示了每一个进程的概要信息。点击More Info查看详细的进程信息。
这里可以查看到进程报告文件、详细信息、历史延时情况以及被丢弃的记录。Discard File是进程用来存放丢弃记录的文件。如果该文件中有记录,需要详细查看记录情况,分析记录被丢弃的原因,并解决相关问题。
 
查看事件日志
主界面右侧下方是事件日志。
Info事件只是一般的事件,如收到stats命令等,不会对GoldenGate的正常运行造成影响。
Warning事件是有可能对GoldenGate造成影响的事件,如停止MGR进程等。
Error事件需要引起关注,表示有重大错误发生,已经影响到了GoldenGate的正常运行。

点击右上角的Filter按钮,把Show Information和Show Un-acknowledged Only两项勾选掉。这样,仅Warning和Error信息被显示出来,便于发现问题。
 
筛选事件类型
 
筛选后的情况
Email告警
开启Email告警功能需要事先部署一个Mail服务器。点击主界面左侧面板上My Email Alerts链接,在新窗口中填写以下信息:
? Alert Name:告警的名字
? Alert Type:有两种类型可供选择。
如果选择Process Lag,则需要指定一个时限,超过这个时限会引发告警。
如果选择Event Text,则需要指定Event Type(Error,Warning等),以及Event text中包含的文本。当Event消息中包含此文本时,会引发告警。支持通配符*。
? Process Name:进程名称,支持通配符*。
? Sent an email to:目标邮件地址
? With the subject:邮件标题
? From Address:发送方地址
? Mail server:邮件服务器,需要事先部署。
  
Email 告警
运行GGSCI命令
选择主界面右上方某个实例,点击实例下方的GGSCI图标,进入命令行交互页面。
 
在这里,可以输入各种命令,并显示输出结果。具体命令,请参考第二章内容。
 
GGSCI 交互页面

基于C/S的Director客户端
查看事件日志
    和基于Web的方式类似,基于C/S的Director客户端集中多个GoldenGate实例的日志,可以进行排序、过滤等操作。
 

Email告警
  和基于Web的方式类似,可以指定规则,将满足规则的日志信息通过email方式告警。
 

运行GGSCI命令
  和基于Web的方式类似,可以在多个GoldenGate实例间切换执行ggsci命令,以管理GoldenGate。
 






---end---







0 0