Using Cloning to Add Nodes to a Cluster

You can also use cloning to add nodes to a cluster. Figure 8-2 shows the result of a cloning procedure in which the Oracle Grid Infrastructure home on Node 1 has been cloned to Node 2 in the same cluster, making it a two-node cluster. Newly added nodes to the cluster share the same OCR and voting files.

Figure 8-2 Cloning to Add Nodes to a Cluster

Description of Figure 8-2 follows
Description of "Figure 8-2 Cloning to Add Nodes to a Cluster"

Using Figure 8-2 as an example, the following procedure explains how to add nodes to a cluster using cloning. In this procedure, you make a copy of the image (a clone) that you used to create Node 1, initially, to Node 2.

  1. Prepare Node 2 as described in "Step 1: Prepare the New Cluster Nodes".
  2. Deploy the Oracle Grid Infrastructure home on Node 2, as described in "Step 2: Deploy the Oracle Grid Infrastructure Home on the Destination Nodes".

    Use the tar utility to create an archive of the Oracle Grid Infrastructure home on the Node 1 and copy it to Node 2. If the ___location of the Oracle Grid Infrastructure home on Node 1 is $ORACLE_HOME, then you must use this same directory as the destination ___location on Node 2.

  3. Run the clone.pl script located in the Grid_home/clone/bin directory on Node 2.

    See Also:

    Table 8-1 for more information about the parameters used in the clone.pl script

    The following example is for Linux or UNIX systems:

    $ perl clone.pl ORACLE_HOME=/u01/app/12.1/grid ORACLE_HOME_NAME=OraHome1Grid
       ORACLE_BASE=/u01/app/oracle "'CLUSTER_NODES={node1, node2}'"
       "'LOCAL_NODE=node2'" CRS=TRUE INVENTORY_LOCATION=/u01/app/oraInventory
    

    If you are prompted to run root.sh, then ignore the prompt and proceed to the next step.

    The following example is for Windows systems:

    C:\>perl clone.pl ORACLE_BASE=D:\u01\app\grid ORACLE_HOME=D:\u01\app\grid\12.1.0
    ORACLE_HOME_NAME=OraHome1Grid '"CLUSTER_NODES={node1,node2}"'
    '"LOCAL_NODE=node2"' CRS=TRUE

    Note:

    In the preceding command, ORACLE_HOME_NAME is required when cloning a node to add a node. You can obtain the correct value from node you are cloning from that node's registry, as follows:

    HKEY_LOCAL_MACHINE\SOFTWARE\oracle\KEY_OraCRs12c_home1

    Look for the ORACLE_HOME_NAME parameter key to obtain the value. If the value for the ORACLE_HOME_NAME parameter in the preceding command does not match that of the node you are cloning, then adding the new node will fail.

  4. This step does not apply to Windows.

    In the Central Inventory directory on Node 2, run the orainstRoot.sh script as root. This script populates the /etc/oraInst.loc directory with the ___location of the central inventory. For example:

    [root@node2 root]# /opt/oracle/oraInventory/orainstRoot.sh
    

    You can run the script on more than one destination node simultaneously.

  5. Run the addnode.sh (addnode.bat on Windows) script, located in the Grid_home/addnode directory, on Node 1, as follows:
    $ addnode.sh -silent -noCopy ORACLE_HOME=Grid_home "CLUSTER_NEW_NODES={node2}"
       "CLUSTER_NEW_VIRTUAL_HOSTNAMES={node2-vip}" "CLUSTER_NEW_NODE_ROLES={HUB}"

    Note:

    • Because you already ran the clone.pl script on Node 2, this step only updates the inventories on the node and instantiates scripts on the local node.

    • If you use the -noCopy option with the addnode.sh script, then a copy of the password file may not exist on Node 2, in which case you must copy a correct password file to Node 2.

    • The addnode.sh script runs the cluvfy stage -pre nodeadd verification.

    • Use the CLUSTER_NEW_NODE_ROLES parameter to indicate, in an Oracle Flex Cluster, whether the node you are adding is a Hub Node or a Leaf Node.

    You can add multiple nodes, as follows:

    $ addnode.sh -silent -noCopy ORACLE_HOME=Grid_home "CLUSTER_NEW_NODES={node2,node3,node4}"
       "CLUSTER_NEW_VIRTUAL_HOSTNAMES={node2-vip,node3-vip,}"
       "CLUSTER_NEW_NODE_ROLES={HUB,HUB,LEAF}"
    

    In the preceding syntax example, Node 4 is designated as a Leaf Node and does not require that a VIP be included.

  6. Copy the following files from Node 1, on which you ran addnode.sh, to Node 2:
    Grid_home/crs/install/crsconfig_addparams
    Grid_home/crs/install/crsconfig_params
    Grid_home/gpnp
    
  7. On Node 2, run the Grid_home/root.sh script.

    Note:

    • Ensure that you extend any database homes before you run the root.sh or gridconfig.bat scripts.

    • The cluster in this example has only two nodes. When you add multiple nodes to a cluster, you can run root.sh concurrently on all of the nodes.

    The following example is for a Linux or UNIX system. On Node 2, run the following command:

    [root@node2 root]# Grid_home/root.sh
    

    The root.sh script automatically configures the virtual IP (VIP) resources in the Oracle Cluster Registry (OCR).

    On Windows, run the following command on Node 2:

    C:\>Grid_home\crs\config\gridconfig.bat
    
  8. Run the following cluster verification utility (CVU) command on Node 1:
    $ cluvfy stage -post nodeadd -n destination_node_name [-verbose]

    See Also:

    "cluvfy stage [-pre | -post] nodeadd" for more information about this CVU command