Java 企业应用
不要温柔的走入那个良夜

From:http://www.db2china.net/home/space.php?uid=171&do=blog&id=1150

Info center:http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp?topic=%2Fcom.ibm.db2.luw.admin.ha.doc%2Fdoc%2Fc0052943.html

manual:https://www.ibm.com/developerworks/mydeveloperworks/blogs/nsharma/resource/HADR-db2haicu_v5.pdf?lang=en

db2的hadr大家都玩过吧, 这里就不在 叙述hadr的创建了.

about the ports using in hadr ,check the /etc/hosts and /etc/services

image

 


hadr发生故障时, 需要手工进行takeover切换. 虽然在 AIX HACMP 或者 OS cluster里可以使用takeover脚本takeover hadr, 但hacmp and cluster本身都是监控OS RESOURCE的, 如果想要监控db2自己的进程, 就需要写event事件了. IBM 的 tivoli 工具提供了进行db2 hadr故障切换的功能,. tivoli system automation. 在 db2 9.5之前, TSA软件是需要 独立安装的. DB2 V9.5里集成安装了.配置工具为 db2haicu.
下面是db2haicu的配置文件  tsa.xml
如下环境 rhelv51, rhelv52 两台linux服务器. 每个上面两块网卡eth0(192.168.1.*) eth1(172.16.4.*), 在eth0上创建 别名ip 192.168.1.113 (db2haicu自动创建)
<DB2Cluster xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:noNamespaceSchemaLocation="db2ha.xsd"
            clusterManagerName="TSA"
            version="1.0">
  <ClusterDomain domainName="db2HAdomain">
          <Quorum quorumDeviceProtocol="network" quorumDeviceName="192.168.1.105"/>

    <PhysicalNetwork physicalNetworkName="db2_public_network_0"
                     physicalNetworkProtocol="ip">

      <Interface interfaceName="eth0" clusterNodeName="rhelv51">
        <IPAddress baseAddress="192.168.1.103"
                   subnetMask="255.255.255.0"
                   networkName="db2_public_network_0"/>
      </Interface>

      <Interface interfaceName="eth0" clusterNodeName="rhelv52">
        <IPAddress baseAddress="192.168.1.104"
                   subnetMask="255.255.255.0"
                   networkName="db2_public_network_0"/>
      </Interface>

    </PhysicalNetwork>

    <PhysicalNetwork physicalNetworkName="db2_private_network_0"
                     physicalNetworkProtocol="ip">

      <Interface interfaceName="eth1" clusterNodeName="rhelv52">
        <IPAddress baseAddress="172.16.4.144"
                   subnetMask="255.255.0.0"
                   networkName="db2_private_network_0"/>
      </Interface>

      <Interface interfaceName="eth1" clusterNodeName="rhelv51">
        <IPAddress baseAddress="172.16.4.14"
                   subnetMask="255.255.0.0"
                   networkName="db2_private_network_0"/>
      </Interface>

    </PhysicalNetwork>
    <ClusterNode clusterNodeName="rhelv51"/>
    <ClusterNode clusterNodeName="rhelv52"/>

  </ClusterDomain>

  <FailoverPolicy>
    <HADRFailover/>
  </FailoverPolicy>

  <DB2PartitionSet>
     <DB2Partition dbpartitionnum="0" instanceName="db2inst1">
       <VirtualIPAddress baseAddress="192.168.1.113" subnetMask="255.255.255.0" networkName="db2_public_network_0"/>
</DB2Partition>
  </DB2PartitionSet>

  <HADRDBSet>
   <HADRDB databaseName="mydb1"
            localInstance="db2inst1"
            remoteInstance="db2inst1"
            localHost="rhelv51"
            remoteHost="rhelv52" />
<!--<VirtualIPAddress baseAddress="192.168.1.113" subnetMask="255.255.255.0" networkName="db2_public_network_0"/> -->

  </HADRDBSet>

</DB2Cluster>
在standby机器上实例用户执行 db2haicu -f tsa.xml
[db2inst1@rhelv52 ~]$ db2haicu -f tsa.xml
Welcome to the DB2 High Availability Instance Configuration Utility (db2haicu).

You can find detailed diagnostic information in the DB2 server diagnostic log file called db2diag.log. Also, you can use the utility called db2pd to query the status of the cluster domains you create.

For more information about configuring your clustered environment using db2haicu, see the topic called 'DB2 High Availability Instance Configuration Utility (db2haicu)' in the DB2 Information Center.

db2haicu determined the current DB2 database manager instance is db2inst1. The cluster configuration that follows will apply to this instance.

db2haicu is collecting information on your current setup. This step may take some time as db2haicu will need to activate all databases for the instance to discover all paths ...
Creating domain db2HAdomain in the cluster ...
Creating domain db2HAdomain in the cluster was successful.
Configuring quorum device for domain db2HAdomain ...
Configuring quorum device for domain db2HAdomain was successful.
Adding network interface card eth0 on cluster node rhelv51 to the network db2_public_network_0 ...
Adding network interface card eth0 on cluster node rhelv51 to the network db2_public_network_0 was successful.
Adding network interface card eth0 on cluster node rhelv52 to the network db2_public_network_0 ...
Adding network interface card eth0 on cluster node rhelv52 to the network db2_public_network_0 was successful.
Adding network interface card eth1 on cluster node rhelv52 to the network db2_private_network_0 ...
Adding network interface card eth1 on cluster node rhelv52 to the network db2_private_network_0 was successful.
Adding network interface card eth1 on cluster node rhelv51 to the network db2_private_network_0 ...
Adding network interface card eth1 on cluster node rhelv51 to the network db2_private_network_0 was successful.
Adding DB2 database partition 0 to the cluster ...
Adding DB2 database partition 0 to the cluster was successful.
The HADR database mydb1 has been determined to be valid for high availability. However, the database cannot be added to the cluster from this node because db2haicu detected this node is the standby for the HADR database mydb1. Run db2haicu on the primary for the HADR database mydb1 to configure the database for automated failover.
All cluster configurations have been completed successfully. db2haicu exiting ...
系统提示到primary上执行db2haicu, 到primary服务器上继续执行db2haicu -f tsa.xml
[db2inst1@rhelv51 ~]$ db2haicu -f tsa.xml
Welcome to the DB2 High Availability Instance Configuration Utility (db2haicu).

You can find detailed diagnostic information in the DB2 server diagnostic log file called db2diag.log. Also, you can use the utility called db2pd to query the status of the cluster domains you create.

For more information about configuring your clustered environment using db2haicu, see the topic called 'DB2 High Availability Instance Configuration Utility (db2haicu)' in the DB2 Information Center.

db2haicu determined the current DB2 database manager instance is db2inst1. The cluster configuration that follows will apply to this instance.

db2haicu is collecting information on your current setup. This step may take some time as db2haicu will need to activate all databases for the instance to discover all paths ...
Configuring quorum device for domain db2HAdomain ...
Configuring quorum device for domain db2HAdomain was successful.
The network adapter eth0 on node rhelv51 is already defined in network db2_public_network_0 and cannot be added to another network until it is removed from its current network.
The network adapter eth0 on node rhelv52 is already defined in network db2_public_network_0 and cannot be added to another network until it is removed from its current network.
The network adapter eth1 on node rhelv52 is already defined in network db2_private_network_0 and cannot be added to another network until it is removed from its current network.
The network adapter eth1 on node rhelv51 is already defined in network db2_private_network_0 and cannot be added to another network until it is removed from its current network.
The IP address 192.168.1.113 is already in use. Enter an IP address that is not used anywhere on the network for your high availability setup.
系统提示 192.168.1.113 地址已经被使用, 到standby机器上 把 ip 地址 down下来, 重新执行 db2haicu -f tsa.xml
[db2inst1@rhelv51 ~]$ db2haicu -f tsa.xml
Welcome to the DB2 High Availability Instance Configuration Utility (db2haicu).

You can find detailed diagnostic information in the DB2 server diagnostic log file called db2diag.log. Also, you can use the utility called db2pd to query the status of the cluster domains you create.

For more information about configuring your clustered environment using db2haicu, see the topic called 'DB2 High Availability Instance Configuration Utility (db2haicu)' in the DB2 Information Center.

db2haicu determined the current DB2 database manager instance is db2inst1. The cluster configuration that follows will apply to this instance.

db2haicu is collecting information on your current setup. This step may take some time as db2haicu will need to activate all databases for the instance to discover all paths ...
Configuring quorum device for domain db2HAdomain ...
Configuring quorum device for domain db2HAdomain was successful.
The network adapter eth0 on node rhelv51 is already defined in network db2_public_network_0 and cannot be added to another network until it is removed from its current network.
The network adapter eth0 on node rhelv52 is already defined in network db2_public_network_0 and cannot be added to another network until it is removed from its current network.
The network adapter eth1 on node rhelv52 is already defined in network db2_private_network_0 and cannot be added to another network until it is removed from its current network.
The network adapter eth1 on node rhelv51 is already defined in network db2_private_network_0 and cannot be added to another network until it is removed from its current network.
Adding DB2 database partition 0 to the cluster ...
Adding DB2 database partition 0 to the cluster was successful.
Creating resource group failed. Refer to db2diag.log and the DB2 Information Center for details.
There was an internal db2haicu error. Refer to db2diag.log and the DB2 Information Center for details.
db2diag.log内容如下:

posted on 2012-08-19 18:56 cpegtop 阅读(636) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: