db2ha_sample_HADR.xml
The sample file db2ha_sample_DPF_HADR.xml
is
an example of an XML input file that you pass to Db2® high availability
instance configuration utility (db2haicu) to specify a new cluster
domain. db2ha_sample_HADR.xml
is located
in the sqllib/samples/ha/xml
directory.
Features
The db2ha_sample_HADR.xml
sample
demonstrates how to use db2haicu with an XML input
file to define a cluster domain with the following details:
- quorum device: network
- computers in the cluster (cluster domain nodes): two
- failover policy: HADR
- database partitions: one
- virtual (service) IP addresses: none
- shared mount points for failover: none
XML source
<!-- ================================================================= -->
<!-- = Db2 High Availability configuration schema = -->
<!-- = Schema describes the elements of Db2 High Availability = -->
<!-- = IBM Tivoli System Automation for Multiplatforms (SA MP) = -->
<!-- = that are used in the configuration of a HA cluster = -->
<!-- ================================================================= -->
<DB2Cluster xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="db2ha.xsd" cluster ManagerName="TSA" version="1.0">
<!-- ================================================================= -->
<!-- = ClusterDomain element = -->
<!-- = This element encapsulates the cluster configuration = -->
<!-- = specification = -->
<!-- = Creating cluster domain of name db2HAdomain = -->
<!-- = Creating an IP quorum device (IP 19.126.4.5) = -->
<!-- = The IP must be pingable at all times by each of the nodes in = -->
<!-- = the cluster domain = -->
<!-- ================================================================= -->
<ClusterDomain domainName="db2HAdomain">
<Quorum quorumDeviceProtocol="network" quorumDeviceName="19.126.4.5"/>
<!-- ================================================================= -->
<!-- = Physical network element = -->
<!-- = The physical network specifies the network type, protocol = -->
<!-- = IP address, subnet mask, and NIC name = -->
<!-- = Define two logical groupings of NICs = -->
<!-- = Define two logical groupings of NICs = -->
<!-- ================================================================= -->
<PhysicalNetwork physicalNetworkName="db2_public_network_0"
physicalNetworkProtocol="ip">
<Interface interfaceName="eth0" clusterNodeName="hasys01">
<IPAddress baseAddress="19.126.52.139"
subnetMask="255.255.255.0" networkName="db2_public_network_0"/>
</Interface>
<Interface interfaceName="eth0" clusterNodeName="hasys02">
<IPAddress baseAddress="19.126.52.140"
subnetMask="255.255.255.0" networkName="db2_public_network_0"/>
</Interface>
</PhysicalNetwork>
<PhysicalNetwork physicalNetworkName="db2_private_network_0"
physicalNetworkProtocol="ip">
<Interface interfaceName="eth1" clusterNodeName="hasys01">
<IPAddress baseAddress="192.168.23.101"
subnetMask="255.255.255.0" networkName="db2_private_network_0"/>
</Interface>
<Interface interfaceName="eth1" clusterNodeName="hasys02">
<IPAddress baseAddress="192.168.23.102"
subnetMask="255.255.255.0" networkName="db2_private_network_0"/>
</Interface>
</PhysicalNetwork>
<!-- =============================================================== -->
<!-- = ClusterNodeName element = -->
<!-- = The set of nodes in the cluster domain = -->
<!-- = Here the defined set of nodes in the domain is = -->
<!-- = hasys01, hasys02 = -->
<!-- =============================================================== -->
<ClusterNode clusterNodeName="hasys01"/>
<ClusterNode clusterNodeName="hasys02"/>
</ClusterDomain>
<!-- ================================================================= -->
<!-- = Failover policy element = -->
<!-- = The failover policy specifies the failover order of the = -->
<!-- = cluster nodes = -->
<!-- = In the current sample the failover policy is to restart = -->
<!-- = instance in place (LocalRestart) = -->
<!-- ================================================================= -->
<FailoverPolicy>
<HADRFailover></HADRFailover>
</FailoverPolicy>
<!-- ================================================================= -->
<!-- = Db2 Partition element = -->
<!-- = The Db2 partition type specifies a Db2 Instance Name, = -->
<!-- = partition number = -->
<!-- ================================================================= -->
<DB2PartitionSet>
<DB2Partition dbpartitionnum="0" instanceName="db2inst1">
</DB2Partition>
</DB2PartitionSet>
<!-- ================================================================= -->
<!-- = HADRDBSet = -->
<!-- = Set of HADR Databases for this instance = -->
<!-- = Specify the databaseName, the name of the local instance on = -->
<!-- = this machine controlling the HADR database, the name of the = -->
<!-- = remote instance in this HADR pair, the name of the local = -->
<!-- = hostname and the remote hostname for the remote instance = -->
<!-- ================================================================= -->
<HADRDBSet>
<HADRDB databaseName="HADRDB" localInstance="db2inst1"
remoteInstance="db2inst1" localHost="hasys01" remoteHost="hasys02"/>
</HADRDBSet>
</DB2Cluster>