Before you read this section, be sure that you are familiar with the SC2.2 software. This section assumes that you know how to set up SC2.2 and HA-NFS, and that you know how to use your volume manager. Along with the other required patches for DB2, the following patches are required for the HA agent:
Solaris 2.6: 105210-17 (or later) 105786-05 (or later)
Note: | There are no required patches for Solaris 7 (Solaris 2.7). |
Note: | Using NIS to define the information for the HA instance is not recommended, because NIS can introduce a single point of failure. |
The hadb2_setup command is the central point of the programs that come with the DB2 HA agent. It can be used to set up an instance, to modify it, or to delete it. It can also be used to turn the hadb2_setup service on and off. With this command, there is no need to manually edit the hadb2tab file.
Note: | The hadb2_setup command performs actions only on the machine on which it runs. Changes made to one machine should also be made to the other machines in the cluster. |
The following arguments are supported:
To add an EE instance: --------------------- hadb2_setup -a -i <instance> -f [on|off] -h <logical_host> -p [DATA|ADMIN] -t EE For example: hadb2_setup -a -i db2ee -f off -h log1 -p DATA -t EE To add an EEE instance: ---------------------- hadb2_setup -a -i <instance> -f [on|off] -h <nfs_host> -l <mount_point> \ -r <ha-nfs_dir> -p [DATA|ADMIN] -t EEE -n "<node_info>" For example: hadb2_setup -a -i db2eee -f off -h ha-sun1 -l /export/ha_home \ -r /log0/home -p DATA -t EEE -n "log0[0,10,20],log1[30,40,50]" To delete an instance: --------------------- hadb2_setup -d -i <instance> To modify an instance: --------------------- hadb2_setup -m -i <instance> [-f [on|off] | -l <mount_point> | \ -h <host> | -p [DATA|ADMIN] | -r <ha-nfs_dir> | -t [EE|EEE] ] Other options: ------------- -s <on|off> Bring hadb2 up or down (for all HA instances) -y Assume yes for safety checks
To turn the hadb2 service on or off, specify the -s switch. This is equivalent to using the hareg command with the -n and -y switches, and specifying the hadb2 service. For more information about the hareg(1m) command, refer to the Sun Cluster documentation.
The fault monitor for the instance can be turned off using the -f switch. This has the effect of stopping the fault monitor for the instance on the local machine, as well as modifying the hadb2tab file to reflect the fact that fault monitoring is turned off.
For EE instances, turning off fault monitoring on all machines is recommended in case the instance fails over. For EEE instances, fault monitoring must be turned off on all machines that are hosting database partitions for the instance before it is shut down manually.
To delete an instance, use the -d switch. This only removes the instance from the hadb2tab file, and does not remove or modify any other files or directories. Since the hadb2tab file is the main configuration file for the HA-DB2 agent, removing an instance from this file makes the control methods unaware of its existence.
To modify an instance, use the -m switch. This only changes information in the hadb2tab file, and does not remove or modify any other files or directories. The -m switch can be used with any switch that pertains to information in the hadb2tab file. The db2nodes.cfg file and the hadb2-eee.cfg file must be changed manually after the initial setup, because the hadb2_setup command does not support modifying these files.
Adding an instance is somewhat more involved.
For EE instances, the following arguments are required:
hadb2_setup -a -i <instance> -f <fm> -h <logical_host> -t <EEE_or_EE> -p <purpose>
where instance is the name of the instance to be added, fm specifies whether fault monitoring is initially turned on or off, logical_host is the associated logical host, EEE_or_EE is set to EE, and purpose can be either DATA or ADMIN.
For EEE instances, the following arguments are required:
hadb2_setup -a -i <instance> -f <fm> -h <nfs_host> -t <EEE_or_EE> -p <purpose> -l <mount_point> -r <HA-NFS_directory> -n <node_info>
where instance is the name of the instance to be added, fm specifies whether fault monitoring is initially turned on or off, nfs_host is the host name for the logical host that is exporting the HA-NFS file system, EEE_or_EE is set to EEE, purpose can be either DATA or ADMIN, mount_point is the local mount point for the HA-NFS directory, HA-NFS_directory is the HA-NFS directory, and node_info is the information that associates database partitions with a logical host. For example:
hadb2_setup -a -i db2eee -f on -h jolt -l /export/ha_home -p DATA -t EEE -r /log1/home -n "log0[0,1],log1[2,3]"
When adding an EEE instance, the node information must be enclosed by quotation marks. In this example, the instance "db2eee" will be associated with two logical hosts, "log0" and "log1". Database partitions "0" and "1" of the "db2eee" instance will be associated with the logical host "log0", and database partitions "2" and "3" will be associated with logical host "log1".
Use the hadb2_setup command to add an instance to all machines in the cluster. The instance can then be started by forcing a cluster reconfiguration, or by turning hadb2 service off and then on. This can be done, either through the hareg command, or with the -s switch of the hadb2_setup command. If the instance does not start, see Troubleshooting.
When the hadb2_setup command adds an EEE instance, the following actions are performed transparently:
To prevent configuration errors, and to ensure that the HA instance will be able to start after the hadb2_setup command runs, the command performs a significant amount of testing before a new instance is added.
The db2nodes.cfg file is created and seeded with information corresponding to the current cluster status. For example, if logical host "log0" is being hosted by the machine "crackle", the entries for the database partitions associated with "log0" will contain the machine name "crackle" and the high speed interconnect for "crackle":
scadmin@crackle(193)# cat db2nodes.cfg 0 crackle 0 204.152.65.33 1 crackle 1 204.152.65.33 2 thrash 0 204.152.65.34 3 thrash 1 204.152.65.34
The hadb2-eee.cfg file is created only on the basis of the node information that is specified on the command. There is one line per database partition:
sphere % cat hadb2-eee.cfg NODE:log0 0 NODE:log0 1 NODE:log1 2 NODE:log1 3
The .rhost file is required for DB2 UDB EEE, and should contain all host names (or IP addresses) for each machine in the cluster. For example:
crackle db2eee 204.152.65.1 db2eee 204.152.65.17 db2eee thrash db2eee 204.152.65.2 db2eee 204.152.65.18 db2eee crackle db2eee jolt db2eee bump db2eee thrash.torolab.ibm.com db2eee crackle.torolab.ibm.com db2eee
In accordance with a file system layout for SMS tables spaces, the hadb2_setup command sets up a number of directories and symbolic links. These include: