Grid Plug and Play ( GPnP ) – new 11.2 feature

Overview

GPNP PROFILE
The GPnP profile is a small XML file located in GRID_HOME/gpnp/<hostname>/profiles/peer under the name profile.xml.It is stored in the local OCR and in the cluster OCR. In case of errors GPnPD deamon re-creates the profile. Never change this XML file directly – instead use tools like:

  • asmcmd
  • OUI
  • oifcfd
  • ASMCA

The GPNP has 2 parts a WALLET and a PROFILE configuration:

PROFILE configuration:
# ls -l $GRID_HOME/gpnp/grac1/profiles/peer/profile.xml
-rw-r–r– 1 grid oinstall 1891 Jul 17 18:27 /u01/app/11203/grid/gpnp/grac1/profiles/peer/profile.xml

The WALLET information can be found in : /u01/app/11203/grid/gpnp/grac1/wallets/

This  XML Profile is used to establish the correct global personality of a node. Each node maintains a local copy of the GPnP Profile and is maintainid by the GPnP Deamon (GPnPD) .  The GPnP profile is a small XML file containing bootstrap information for the cluster. Each node maintains a local copy of the GPnP Profile. The profile doesn’t contain any node related information and exists on every node in the GPnP cache.

GPnP Profile contains various attributes:  

  •  Cluster name
  • Network classifications (Public/Private)
  • Storage to be used for CSS
  • Storage to be used for ASM : SPFILE location,ASM DiskString  etc
  • Digital signature information :

Using gpnptool to verify profile.xml

The gpnptool can be  used  for reading the gpnp profile.
# $GRID_HOME/bin/gpnptool get ( formatted output )

Warning: some command line parameters were defaulted. Resulting command line:
/u01/app/11203/grid/bin/gpnptool.bin get -o-
ProfileSequence=”4″
ClusterUId=”2ae3c3415014ef2abf2ff662c5bf8512″
ClusterName=”GRACE2″ i
PALocation=””><gpnp:Network-Profile>
   <gpnp:HostNetwork id=”gen” HostName=”*”>
   <gpnp:Network id=”net1″ IP=”192.168.1.0″ Adapter=”eth0″ Use=”public”/>
   <gpnp:Network id=”net2″ IP=”192.168.2.0″ Adapter=”eth1″ Use=”cluster_interconnect”/>
   </gpnp:HostNetwork>
   </gpnp:Network-Profile><orcl:CSS-Profile id=”css” DiscoveryString=”+asm” LeaseDuration=”400″/>
                          <orcl:ASM-Profile id=”asm” DiscoveryString=”/dev/oracleasm/disks/*” SPFile=”+DATA/grace2/asmparameterfile/registry.253.821039237″/>
<ds:Signature xmlns:ds=”http://www.w3.org/2000/09/xmldsig#”><ds:SignedInfo <ds:CanonicalizationMethod …

GPnPd daemon replicates changes to the profile and is modified during following operations:

  • installation
  • system boot
  • when updated

The XML Profile is updated whenever changes are made to a cluster with configuration tools like

  • oifcfg (Change network)
  • crsctl (change location of voting disk)
  • asmcmd (change ASM_DISKSTRING, SPfile location) etc.

The fist usage of the XMl profile is during booting Clusterware and reading of the ASM SPfile. To start clusterware, voting disk needs to be accessed. If voting disk is on ASM, this information  is read from GPnP profile  (<orcl:CSS-Profile id=”..” DiscoveryString=”….” LeaseDuration=”…″/>).   The voting disk is read using kfed utility  even if ASM is not up. Please read the following for a full sample of the ASM startup steps. Next,  the clusterware checks if all the nodes have the updated GPnP profile and the node joins the cluster based on the GPnP configuration . Whenver a node is started/added to the cluster, the clusterware software on the starting node starts a GPnP agent.

  • If the node is already part of the cluster, the GPnP agent reads the existing profile on that node.
  • If the node is being added to the cluster, GPnP agent locates agent on another existing node using multicast protocol (provided by mDNS) and gets the profile from that agent.

Next CRSD needs to read OCR to startup various resources on the node and hence update it as status of resources changes. Since OCR is also on ASM, location of ASM SPfile should be known.
The order of searching the ASM SPfile is

  •  GPnP profile
  •  $ORACLE_HOME/dbs/spfile<sid.ora>
  •  $ORACLE_HOME/dbs/init<sid.ora>

GPNPTOOL COMMAND REFERENCE

How to read the profile
#  $GRID_HOME/bin/gpnptool  get

How to find GPnP Deamons are running on the local node
#   $GRID_HOME/bin/gpnptool   lfind
Success. Local gpnpd found.
How to find the location of ASM spfile if the ASM is down
# $GRID_HOME/bin/gpnptool  getpval -asm_spf -p=/u01/app/11203/grid/gpnp/grac1/profiles/peer/profile.xml
Warning: some command line parameters were defaulted. Resulting command line:
/u01/app/11203/grid/bin/gpnptool.bin getpval -asm_spf -p=/u01/app/11203/grid/gpnp/grac1/profiles/peer/profile.xml -o-
+DATA/grace2/asmparameterfile/registry.253.821039237

Check if GPnP configuration is valid
#  $GRID_HOME/bin/gpnptool  check -p=/u01/app/11203/grid/gpnp/grac1/profiles/peer/profile.xml
Profile cluster=”GRACE2″, version=4
GPnP profile signed by peer, signature valid.
Got GPnP Service current profile to check against.
Current GPnP Service Profile cluster=”GRACE2″, version=4
Error: profile version 4 is older than- or duplicate of- GPnP Service current profile version 4.
Profile appears valid, but push will not succeed.

Verify profile signature
# $GRID_HOME/bin/gpnptool   verify -p=/u01/app/11203/grid/gpnp/grac1/profiles/peer/profile.xml -w=”file://u01/app/11203/grid/gpnp/grac1/wallets/peer” -wu=peer
Profile signature is valid.

Check if a specific remote GPnPD is resonding
# $GRID_HOME/bin/gpnptool find -h=grac2
Found 1 instances of service ‘gpnp’.
mdns:service:gpnp._tcp.local.://grac2:37069/agent=gpnpd,cname=GRACE2,host=grac2,pid=3124/gpnpd h:grac2 c:GRACE2

Check whether all peers are responding
# $GRID_HOME/bin/gpnptool find -c=GRACE2
Found 2 instances of service ‘gpnp’.
mdns:service:gpnp._tcp.local.://grac2:37069/agent=gpnpd,cname=GRACE2,host=grac2,pid=3124/gpnpd h:grac2 c:GRACE2
mdns:service:gpnp._tcp.local.://grac1:59485/agent=gpnpd,cname=GRACE2,host=grac1,pid=3196/gpnpd h:grac1 c:GRACE2

 

How to extract data from profile.xml in a readable format

Extract ProfileSequence  ClusterName 
[grid@grac41 ~]$   $GRID_HOME/bin/gpnptool get 2>/dev/null |  xmllint --format - | awk '/ProfileSequence/ { printf("%s %s\n",  $9,$11); }'
ProfileSequence="11" ClusterName="grac4"

Extract Network and ASM specific data
[grid@grac41 ~]$ $GRID_HOME/bin/gpnptool get 2>/dev/null  |  xmllint --format - | egrep 'CSS-Profile|ASM-Profile|Network id' 
    <gpnp:HostNetwork id="gen" HostName="*">
      <gpnp:Network id="net1" IP="192.168.1.0" Adapter="eth1" Use="public"/>
      <gpnp:Network id="net2" IP="192.168.2.0" Adapter="eth2" Use="cluster_interconnect"/>
  <orcl:CSS-Profile id="css" DiscoveryString="+asm" LeaseDuration="400"/>
  <orcl:ASM-Profile id="asm" DiscoveryString="/dev/asm*,/dev/oracleasm/disks/*" SPFile="+OCR/grac4/asmparameterfile/spfileCopyASM.ora"/>


Script get_profile.sh to check your cluster nodes 
#!/bin/bash
host1=grac41
host2=grac42
host3=grac43

echo "*** GPnP Info - Verify profile.xml  on all nodes"
ssh $host1 /bin/hostname;$GRID_HOME/bin/gpnptool get 2>/dev/null |  xmllint --format - | awk '/ProfileSequence/ { printf("%s %s\n",  $9,$11); }'
ssh $host2 /bin/hostname;$GRID_HOME/bin/gpnptool get 2>/dev/null |  xmllint --format - | awk '/ProfileSequence/ { printf("%s %s\n",  $9,$11); }'
ssh $host3 /bin/hostname;$GRID_HOME/bin/gpnptool get 2>/dev/null |  xmllint --format - | awk '/ProfileSequence/ { printf("%s %s\n",  $9,$11); }'

ssh   $host1  /bin/hostname; $GRID_HOME/bin/gpnptool get 2>/dev/null  |  xmllint --format - | egrep 'CSS-Profile|ASM-Profile|Network id' 
ssh   $host2  /bin/hostname; $GRID_HOME/bin/gpnptool get 2>/dev/null  |  xmllint --format - | egrep 'CSS-Profile|ASM-Profile|Network id' 
ssh   $host3  /bin/hostname; $GRID_HOME/bin/gpnptool get 2>/dev/null  |  xmllint --format - | egrep 'CSS-Profile|ASM-Profile|Network id' 

Output - should be identical on all nodes 
[grid@grac41 ~]$   get_profile.sh
*** GPnP Info - Verify profile.xml  on all nodes
grac41.example.com
ProfileSequence="11" ClusterName="grac4"
grac42.example.com
ProfileSequence="11" ClusterName="grac4"
grac43.example.com
ProfileSequence="11" ClusterName="grac4"
grac41.example.com
    <gpnp:HostNetwork id="gen" HostName="*">
      <gpnp:Network id="net1" IP="192.168.1.0" Adapter="eth1" Use="public"/>
      <gpnp:Network id="net2" IP="192.168.2.0" Adapter="eth2" Use="cluster_interconnect"/>
  <orcl:CSS-Profile id="css" DiscoveryString="+asm" LeaseDuration="400"/>
  <orcl:ASM-Profile id="asm" DiscoveryString="/dev/asm*,/dev/oracleasm/disks/*" SPFile="+OCR/grac4/asmparameterfile/spfileCopyASM.ora"/>
grac42.example.com
    <gpnp:HostNetwork id="gen" HostName="*">
      <gpnp:Network id="net1" IP="192.168.1.0" Adapter="eth1" Use="public"/>
      <gpnp:Network id="net2" IP="192.168.2.0" Adapter="eth2" Use="cluster_interconnect"/>
  <orcl:CSS-Profile id="css" DiscoveryString="+asm" LeaseDuration="400"/>
  <orcl:ASM-Profile id="asm" DiscoveryString="/dev/asm*,/dev/oracleasm/disks/*" SPFile="+OCR/grac4/asmparameterfile/spfileCopyASM.ora"/>
grac43.example.com
    <gpnp:HostNetwork id="gen" HostName="*">
      <gpnp:Network id="net1" IP="192.168.1.0" Adapter="eth1" Use="public"/>
      <gpnp:Network id="net2" IP="192.168.2.0" Adapter="eth2" Use="cluster_interconnect"/>
  <orcl:CSS-Profile id="css" DiscoveryString="+asm" LeaseDuration="400"/>
  <orcl:ASM-Profile id="asm" DiscoveryString="/dev/asm*,/dev/oracleasm/disks/*" SPFile="+OCR/grac4/asmparameterfile/spfileCopyASM.ora"/>

 

Updating profile.xml and using of gpntool put

Please read following Link to get a more detailed sample in updating profile.xml by using :

  • gpnptool unsign
  • gpnptool edit
  • gpnptool sign
  • gpnptool put

 

References

2 thoughts on “Grid Plug and Play ( GPnP ) – new 11.2 feature”

Leave a Reply

Your email address will not be published. Required fields are marked *