【RAC】Oracle 11gR2 RAC 中的 Grid Plug and Play(GPnP) 是什么?

简介: 【RAC】Oracle 11gR2 RAC 中的 Grid Plug and Play(GPnP) 是什么? 一. 什么是GPnP?   Grid Plug and Play (GPnP):Founda...

【RAC】Oracle 11gR2 RAC 中的 Grid Plug and Play(GPnP) 是什么?



一. 什么是GPnP?

 

Grid Plug and Play (GPnP):Foundation for a Dynamic Cluster Management 
 

(1)GPnPeliminates the need for a per node configuration

–It is an underlying gridconcept that enables the automation of operations in the cluster 

–Allows nodes to be dynamicallyadded or removed from the cluster 

–Provides an easier managementto build large clusters OUI does not ask    

–It is the basis for the GridNaming Service (GNS) for a private node name anymore.  

 

(2)Technically,GPnP is based on an XML profile 

–Defining node personality(e.g. cluster name, network classification) 

–Created during installation 

–Updated withevery relevant change (using oifcfg, crsctl) 

–Stored in local files per homeand in the OCR 

- Wallet protected

 

(3) GPnPis apparent in things that you do not  

   see and that youare not asked for (anymore).

 

Grid Plug and Play (GPnP)eliminates per-node configuration data and the need for explicit add and deletenodes steps. This allows a systemadministrator to take a template system image and run it on a new node with nofurther configuration. This removes many manual operations, reduces theopportunity for errors, and encourages configurations that can be changedeasily. Removal of the per-node configuration makes the nodes easierto replace, because they do not need to contain individually-managed state.

    --GPnP 简化了每个节点的配置数据和添加删除节点时的一些步骤。也就是说运行系统管理创建模板的系统镜像,并在新的节点上运行,而不需要其他的配置工作。这样就减少了一些手工操作,降低了发生错误的概率。

 

Grid Plug and Play reduces the cost of installing, configuring, andmanaging database nodes by making their per-node state disposable. It allowsnodes to be easily replaced with regenerated state.

    --GPnP在每个节点通过state来减少安装,配置和管理数据库的成本。

 

Grid Plug andPlay enables you to move your data center toward a dynamic grid infrastructure.This enables you to consolidate applications and lower the costs of managingapplications, while providing a highly available environment that can easilyscale when the workload requires.

 

There are manymodifications in Oracle RAC 11g release 2 (11.2) to support the easy additionof servers in a cluster and therefore a more dynamic grid.

 

 

In the past,adding or removing servers in a cluster required extensive manual preparation.With this release, Grid Plug and Play reduces the costs ofinstalling, configuring, and managing server nodes by automating the followingtasks:

--在过去的版本,添加删除节点需要大量的手工准备,在11gR2中,如下任务通过自动化的操作,GPnP 减少了每个节点安装,配置和管理服务器的成本。

 

1)  Adding an Oracle RAC databaseinstance

2)  Negotiating appropriate networkidentities for itself

3)  Acquiring additionalinformation it needs to operate from a configuration profile

4)  Configuring or reconfiguringitself using profile data, making host names and addresses resolvable on thenetwork

 

--查看GPnP的进程:

[root@rac2 ~]# ps -ef|grep gpnp

grid     5124     1  0 15:26 ?        00:00:01/u01/app/grid/11.2.0/bin/gpnpd.bin

root     6646  4954  0 15:38 pts/0    00:00:00 grep gpnp

[root@rac2 ~]#

 

Grid Plug and Play (GPNPD): GPNPD provides access to the Grid Plug and Play profile, andcoordinates updates to the profile among the nodes of the cluster to ensurethat all of the nodes node have the most recent profile.

--GPnPD 进程可以访问Grid Plug and Play 的profile 文件,并且在集群的所有节点中协调更新profile的内容。 已确保所有节点上的GPnP profile是最新的。

 

 

Multicast Domain Name Service (mDNS): Grid Plug and Play uses the mDNS process to locate profiles in thecluster, as well as by GNS to perform name resolution. The mDNS process is abackground process on Linux and UNIX, and a service on Windows.

    --GpnP 使用mDNS 进程来查找集群中的profile文件,然后执行名称解析。

 

 

The section, AboutPrivate Networks, Network Interfaces, and Network Adapters, says that theentity, Private network interfaces, is stored in the OracleClusterware, in the Grid Plug and Play (GPnP) Profile.

--entity,privatenetwork interface 的信息也会存入到Oracle Clusterwre 和Grid Plug and Play Profile中。

 

也就是说我们在安装过程中配置某个interface作为private interface或者使用oifcfg cluster_interconnects命令配置的private interface信息都会写入到GPnP的profile中。

 

 

二. GPnP Profile 位置及内容

 

GPnP profile文件保存的是集群的配置信息。这个XML 文件里记录了如下信息:

1.网络接口和IP地址(公网和私网)

2.ASM diskstring和spfile信息

 

注意:Oracle不支持手动修改profile.xml文件,直接对它的修改可能导致无法修复的问题,最终导致在所有节点重建Clusterware。

 

默认的保存位置是:

$GRID_HOME/gpnp/$HOSTNAME/profile/peer/profile.xml

$GRID_HOME/gpnp/profile/peer/profile.xml(全局备份)

 

 

在没有启动ASM 实例之前,diskgroup是没有mount的,这时候启动ASM 实例必须要读取spfile文件。 

 

当ASM instance 查找初始化文件的时候,搜索的顺序如下:

1.  GPnP(Grid Plug and Play) profile 中指定的本地位置

2.  如果GPnP profile中没有指定初始化文件的位置,然后搜索ASM InstanceHome目录。这里会包含2种文件,SPFILE 和 PFILE,默认路径是:$ORACLE_HOME/dbs/spfile+ASM.ora

 

在集群环境下,集群在启动的时候,ClusterSynchronization Services (CSS)将扫描所有的ASM disks,它利用的是GPnP profile文件中的ASM discovery string。

 

在Oracle 10g 的RAC里面, OCR 和Votingdisk是存放在单独的raw设备上的,所以我们可以停止启动ASM 实例。

 

但是在Oracle 11gRAC里。Oracle 的架构做了变跟。 和ASM 的spfile一样,OCR和Votingdisk 也存放到了ASM 的磁盘组里。

 

这时候,在启动CRS的时候,也必须通过GPnP 属性文件来获取OCR和votingdisk的信息。 然后在启动ASM 实例和数据库实例。

 

也正式如此,我们在11G RAC环境下,不能停止ASM 实例,只能停数据库实例。 ASM 实例只能和CRS 一起停止。 因为CRS 依赖的文件存放在ASM 磁盘组上。

 

 

将profile.xml的内容复制出来,用浏览器打开,如下图:

 

 




网格即插即用(Grid Plug and Play,GPnP)是从11gR2 RAC开始的新功能,提供创建一个动态的GI环境,能随着负载的增加动态改变GI环境。GPnP能非常容易地添加、替换或者移除集群中的节点,就像电源插头一样即插即用。它管理RAC必要的IP,如果添加另一个节点到RAC环境中,不需要请求和管理相应的IP地址,即插即用特性将在集群中自动管理这些IP。网格即插即用能够减少预节点配置的数据、需要明确添加和删除节点的步骤。它允许系统管理员创建一个系统镜像模板,在一个节点运行它来添加进一步的配置。这样减少了很多手动操作,降低了出错的机会。 
网格即插即用能简化实例的添加过程,当数据库支持OMF(Oracle Managed Files)和ASM,数据库创建一个新的实例,明确或工具调用srvctl add instance命令,添加一个实例的恢复线程和UNDO表空间都会自动被创建。网格即插即用通过安装、配置和管理数据库节点,减少了部署成本,节点能更容易地被重建。所有的工具,包括DBCA、NETCA和SRVCTL被更新来支持网格即插即用。管理RACEM的图形化接口,提供网格即插即用环境的管理和监控。
GPnP主要由GPNPD、mDNS、SCAN和GNS构成,其结构如图3-7所示。 

img_465cb8a24e349312fd68779bd8c92ec3.jpg

图3-7   GPnP结构 
如图3-7所示,mDNS负责在节点内部进行IP的解析,在添加节点的时候不需要手动修改每个节点的/etc/hosts文件。GPNPD服务提供的是集群配置信息管理,新的节点添加进来会根据现有的GPnP profile配置信息来配置新的节点,同时更新所有节点的GPnP profile文件。一旦新添加的节点加入到集群,SCAN机制动态地将连接分配给该节点,所有的客户端都不需要进行任何配置的变更,就能实现节点的负载均衡。GNS(Grid Naming Service)能动态地为新添加的节点分配VIP地址,利用DHCP管理公共网络中的IP地址。第6章还会详细讨论GNS和SCAN的工作原理。以上的服务共同构成了“网格即插即用”的特性


 在Clusterware中,CSS、GPnP等服务的启动都需要依赖于GPnP profile文件。GPnP profile是一个XML文件,引导节点加入集群,GPnP profile提供了新节点的配置信息。GPnP profile还指定了整个集群的特性。如果该文件被破坏或丢失,Clusterware将无法正常启动。 
在Clusterware启动期间,CSS守护进程使用GPnP profile发现表决文件(参数“DiscoveryString”)。一个不正确的Discovery字符串将阻止CSS守护进程启动,导致整个CRS无法启动。 
注意   Oracle不支持手动修改profile.xml文件,直接对它的修改可能导致无法修复的问题,最终导致在所有节点重建Clusterware。 
GPnP profile文件保存的是集群的配置信息。默认的保存位置是: 
q $GRID_HOME/gpnp/$HOSTNAME/profile/peer/profile.xml 
q $GRID_HOME/gpnp/profile/peer/profile.xml(全局备份) 
下面是典型的GPnP profile内容(/u01/app/11.2.0/grid/gpnp/profiles/peer/profile.xml): 
<?xml version="1.0" encoding="UTF-8"?> 
<gpnp:GPnP-Profile Version="1.0" xmlns="http://www.grid-pnp.org/2005/11/gpnp- 
profile" xmlns:gpnp="http://www.grid-pnp.org/2005/11/ 
gpnp-profile" xmlns:orcl="http://www.oracle.com/gpnp/ 
2005/11/gpnp-profile" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.grid-pnp.org/2005/11/gpnp-profile gpnp- 
profile.xsd" ProfileSequence="4" ClusterUId="33b46b234583df41ff600bf1d9904cea" 
ClusterName="rhel-cluster" PALocation=""> 
       <gpnp:Network-Profile> 
              <gpnp:HostNetwork id="gen" HostName="*"> 
       <gpnp:Network id="net1" IP="10.168.4.0" Adapter="eth0" Use="public"/> 
       <gpnp:Network id="net2" IP="192.168.1.0" Adapter="eth1" 
       Use="cluster_interconnect"/> 
       <gpnp:Network id="net3" IP="192.168.1.0" Adapter="eth2" 
       Use="cluster_interconnect"/> 
              </gpnp:HostNetwork> 
       </gpnp:Network-Profile> 
       <orcl:CSS-Profile id="css" DiscoveryString="+asm" LeaseDuration="400"/> 
       <orcl:ASM-Profile id="asm" DiscoveryString="/dev/raw/*,ORCL:*" 
       SPFile="+OCRVDISK/rhel-cluster/asmparameterfile/registry.253.684539075"/> 
       <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"> 
              <ds:SignedInfo> 
                     <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml- 
              exc-c14n#"/> 
                     <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/> 
                     <ds:Reference URI=""> 
                            <ds:Transforms> 
                                   <ds:Transform Algorithm="http://www.w3.org/2000/09/ 
                                          xmldsig#enveloped-signature"/> 
                                   <ds:Transform Algorithm="http://www.w3.org/ 
                                   2001/10/xml-exc-c14n#"> 
                                          <InclusiveNamespaces xmlns=" 
       http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="gpnp orcl xsi"/> 
                                   </ds:Transform> 
                            </ds:Transforms> 
                            <ds:DigestMethod Algorithm="http://www. 
                            w3.org/2000/09/xmldsig#sha1"/> 
                            <ds:DigestValue>tJwvbopVU0UhRT9K3M6+t9glsbk=</ds:DigestValue> 
                     </ds:Reference> 
              </ds:SignedInfo>  www.2cto.com
              <ds:SignatureValue>XH4UsWRss5MLcgLnBPYXgf4LK/6/EinZL30y 
              Lqe1oavr1tAQFi63XQjW7qpglukNaR3IZX2roOPnlocf3 
              spcnAXUufDlGyUFN7Tf3zqa25P9Xfs2yvdFB24kN81eZNrlANC5own0LbpKL7 
              yiBW6vMr/rz8OgbIzLkb/zkylBKfQ=</ds:SignatureValue> 
       </ds:Signature> 
</gpnp:GPnP-Profile> 
通过上面的例子可以看出,GPnP profile保存的是RAC的配置信息,包括集群名称、网络类型信息(public/private)、ASM和CSS的存储信息、安全的数字签名,以及ASM实例的SPFILE文件位置。当集群配置发生变化时,所有节点的该文件会被自动更新。在安装、系统引导或者当使用标准的集群工具更新期间,这些活动包括:oifcfg 改变网络信息、crsctl 改变css设备、ASM额外的存储等,会通过gpdpd进程复制GPnP profile到所有的其他节点。 
如果GPnP出现问题,可以使用cluvfy comp gpnp组件验证命令检查在集群中所有节点网格即插即用的完整性。 
cluvfy comp gpnp [-n node_list] [-verbose] 






About Me

...............................................................................................................................

● 本文整理自网络

● 本文在itpub(http://blog.itpub.net/26736162)、博客园(http://www.cnblogs.com/lhrbest)和个人微信公众号(xiaomaimiaolhr)上有同步更新

● 本文itpub地址:http://blog.itpub.net/26736162/abstract/1/

● 本文博客园地址:http://www.cnblogs.com/lhrbest

● 本文pdf版及小麦苗云盘地址:http://blog.itpub.net/26736162/viewspace-1624453/

● 数据库笔试面试题库及解答:http://blog.itpub.net/26736162/viewspace-2134706/

● QQ群:230161599     微信群:私聊

● 联系我请加QQ好友(646634621),注明添加缘由

● 于 2017-06-02 09:00 ~ 2017-06-30 22:00 在魔都完成

● 文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解

● 版权所有,欢迎分享本文,转载请保留出处

...............................................................................................................................

拿起手机使用微信客户端扫描下边的左边图片来关注小麦苗的微信公众号:xiaomaimiaolhr,扫描右边的二维码加入小麦苗的QQ群,学习最实用的数据库技术。

img_e3029f287d989cd04bd75432ecc1c172.png
DBA笔试面试讲解
欢迎与我联系

目录
相关文章
|
1月前
|
存储 运维 Oracle
Oracle系列十八:Oracle RAC
Oracle系列十八:Oracle RAC
|
2月前
|
Oracle 关系型数据库
oracle Hanganalyze no RAC
oracle Hanganalyze no RAC
15 0
|
2月前
|
Oracle 关系型数据库
oracle rac 手工安装补丁,不适用auto
oracle rac 手工安装补丁,不适用auto
25 3
|
3月前
|
Oracle 关系型数据库 Linux
RHEL7.9系统下一键脚本安装Oracle 11gR2单机版本
RHEL7.9系统下一键脚本安装Oracle 11gR2单机版本
56 1
|
6月前
|
Oracle 关系型数据库 Java
分享一个 Oracle RAC 模式下客户端建立JDBC初始连接时因ONS造成应用启动时卡顿30秒问题的排查分析案例
分享一个 Oracle RAC 模式下客户端建立JDBC初始连接时因ONS造成应用启动时卡顿30秒问题的排查分析案例
|
Oracle 关系型数据库 数据库管理
|
Oracle 关系型数据库 数据库管理
|
Oracle 关系型数据库 网络安全
|
关系型数据库 Oracle 数据库