DB2 HADR TSA安装

前置条件,安装配置好db2 hadr,hadr 库为testdb
db2 hadr安装详见:https://www.cndba.cn/hbhe0316/article/4818https://www.cndba.cn/hbhe0316/article/103915https://www.cndba.cn/hbhe0316/article/103915

[root@tsa01 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.100 tsa01
192.168.56.101 tsa02

[db2inst1@tsa02 ~]$   cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.56.100 tsa01
192.168.56.101 tsa02

一 创建tsa集群
1.在所有的集群节点配置环境变量https://www.cndba.cn/hbhe0316/article/103915

echo "export CT_MANAGEMENT_SCOPE=2" >>/etc/profile

2.在两个节点都以root执行

https://www.cndba.cn/hbhe0316/article/103915
https://www.cndba.cn/hbhe0316/article/103915
[root@tsa01 ~]# /usr/sbin/rsct/install/bin/recfgct
Removed symlink /etc/systemd/system/multi-user.target.wants/ctrmc.service.
Removed symlink /etc/systemd/system/graphical.target.wants/ctrmc.service.
0513-071 The ctcas Subsystem has been added.
0513-071 The ctrmc Subsystem has been added.
Enabling ctrmc.service for systemctl ...
Created symlink from /etc/systemd/system/multi-user.target.wants/ctrmc.service to /usr/lib/systemd/system/ctrmc.service.
Created symlink from /etc/systemd/system/graphical.target.wants/ctrmc.service to /usr/lib/systemd/system/ctrmc.service.
0513-059 The ctrmc Subsystem has been started. Subsystem PID is 2327.

[root@tsa02 ~]# /usr/sbin/rsct/install/bin/recfgct
Removed symlink /etc/systemd/system/multi-user.target.wants/ctrmc.service.
Removed symlink /etc/systemd/system/graphical.target.wants/ctrmc.service.
0513-071 The ctcas Subsystem has been added.
0513-071 The ctrmc Subsystem has been added.
Enabling ctrmc.service for systemctl ...
Created symlink from /etc/systemd/system/multi-user.target.wants/ctrmc.service to /usr/lib/systemd/system/ctrmc.service.
Created symlink from /etc/systemd/system/graphical.target.wants/ctrmc.service to /usr/lib/systemd/system/ctrmc.service.
0513-059 The ctrmc Subsystem has been started. Subsystem PID is 2291.

3.每个节点都执行如下,把节点加入集群

[root@tsa01 ~]#  /usr/sbin/rsct/bin/preprpnode tsa01 tsa02
[root@tsa02 ~]#  /usr/sbin/rsct/bin/preprpnode tsa01 tsa02

4.查看db2 hadr是否正常https://www.cndba.cn/hbhe0316/article/103915https://www.cndba.cn/hbhe0316/article/103915

[db2inst1@tsa01 ~]$ db2pd -d testdb -hadr | egrep "HADR_ROLE|HADR_STATE|HADR_CONNECT_STATUS"
                            HADR_ROLE = PRIMARY
                           HADR_STATE = PEER
                  HADR_CONNECT_STATUS = CONNECTED
             HADR_CONNECT_STATUS_TIME = 01/09/2022 11:43:36.616603 (1641699816)

[db2inst1@tsa02 ~]$ db2pd -d testdb -hadr | egrep "HADR_ROLE|HADR_STATE|HADR_CONNECT_STATUS"
                            HADR_ROLE = STANDBY
                           HADR_STATE = PEER
                  HADR_CONNECT_STATUS = CONNECTED
             HADR_CONNECT_STATUS_TIME = 01/09/2022 11:43:37.334665 (1641699817)

5.在tsa02节点执行db2haicuhttps://www.cndba.cn/hbhe0316/article/103915https://www.cndba.cn/hbhe0316/article/103915

[db2inst1@tsa02 ~]$ db2haicu 
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 ...
When you use db2haicu to configure your clustered environment, you create cluster domains. For more information, see the topic 'Creating a cluster domain with db2haicu' in the DB2 Information Center. db2haicu is searching the current machine for an existing active cluster domain ...
db2haicu did not find a cluster domain on this machine. db2haicu will now query the system for information about cluster nodes to create a new cluster domain ...

db2haicu did not find a cluster domain on this machine. To continue configuring your clustered environment for high availability, you must create a cluster domain; otherwise, db2haicu will exit.

Create a domain and continue? [1]
1. Yes
2. No
1
Create a unique name for the new domain:
db2ha
Nodes must now be added to the new domain.
How many cluster nodes will the domain 'db2ha' contain?
2
Enter the host name of a machine to add to the domain:
tsa01
Enter the host name of a machine to add to the domain:
tsa02
db2haicu can now create a new domain containing the 2 machines that you specified. If you choose not to create a domain now, db2haicu will exit.

Create the domain now? [1]
1. Yes
2. No
1
Creating domain 'db2ha' in the cluster ...
One or more hosts are not prepared for clustering. Run the preprpnode command with root authority and then re-run the command.
[db2inst1@tsa02 ~]$ db2haicu 
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 ...
When you use db2haicu to configure your clustered environment, you create cluster domains. For more information, see the topic 'Creating a cluster domain with db2haicu' in the DB2 Information Center. db2haicu is searching the current machine for an existing active cluster domain ...
db2haicu did not find a cluster domain on this machine. db2haicu will now query the system for information about cluster nodes to create a new cluster domain ...

db2haicu did not find a cluster domain on this machine. To continue configuring your clustered environment for high availability, you must create a cluster domain; otherwise, db2haicu will exit.

Create a domain and continue? [1]
1. Yes
2. No
1
Create a unique name for the new domain:
db2ha
Nodes must now be added to the new domain.
How many cluster nodes will the domain 'db2ha' contain?
2
Enter the host name of a machine to add to the domain:
tsa01
Enter the host name of a machine to add to the domain:
tsa02
db2haicu can now create a new domain containing the 2 machines that you specified. If you choose not to create a domain now, db2haicu will exit.

Create the domain now? [1]
1. Yes
2. No
1
Creating domain 'db2ha' in the cluster ...
Creating domain 'db2ha' in the cluster was successful.
You can now configure a quorum device for the domain. For more information, see the topic "Quorum devices" in the DB2 Information Center. If you do not configure a quorum device for the domain, then a human operator will have to manually intervene if subsets of machines in the cluster lose connectivity.

Configure a quorum device for the domain called 'db2ha'? [1]
1. Yes
2. No
1
The following is a list of supported quorum device types:
  1. Network Quorum
  2. Disk Quorum
  3. Majority Node Set
Enter the number corresponding to the quorum device type to be used: [1]
1
Specify the network address of the quorum device:
192.168.56.1
Configuring quorum device for domain 'db2ha' ...
Configuring quorum device for domain 'db2ha' was successful.
The cluster manager found the following total number of network interface cards on the machines in the cluster domain: '4'.  You can add a network to your cluster domain using the db2haicu utility.

Create networks for these network interface cards? [1]
1. Yes
2. No
1
Enter the name of the network for the network interface card: 'enp0s8' on cluster node: 'tsa01'
1. Create a new public network for this network interface card.
2. Create a new private network for this network interface card.
3. Skip this step.
Enter selection:
3
Enter the name of the network for the network interface card: 'enp0s8' on cluster node: 'tsa02'
1. Create a new public network for this network interface card.
2. Create a new private network for this network interface card.
3. Skip this step.
Enter selection:
3
Enter the name of the network for the network interface card: 'enp0s3' on cluster node: 'tsa02'
1. Create a new public network for this network interface card.
2. Create a new private network for this network interface card.
3. Skip this step.
Enter selection:
1
Are you sure you want to add the network interface card 'enp0s3' on cluster node 'tsa02' to the network 'db2_public_network_0'? [1]
1. Yes
2. No
1
Adding network interface card 'enp0s3' on cluster node 'tsa02' to the network 'db2_public_network_0' ...
Adding network interface card 'enp0s3' on cluster node 'tsa02' to the network 'db2_public_network_0' was successful.
Enter the name of the network for the network interface card: 'enp0s3' on cluster node: 'tsa01'
1. db2_public_network_0
2. Create a new public network for this network interface card.
3. Create a new private network for this network interface card.
4. Skip this step.
Enter selection:
1
Are you sure you want to add the network interface card 'enp0s3' on cluster node 'tsa01' to the network 'db2_public_network_0'? [1]
1. Yes
2. No
1
Adding network interface card 'enp0s3' on cluster node 'tsa01' to the network 'db2_public_network_0' ...
Adding network interface card 'enp0s3' on cluster node 'tsa01' to the network 'db2_public_network_0' was successful.
Retrieving high availability configuration parameter for instance 'db2inst1' ...
The cluster manager name configuration parameter (high availability configuration parameter) is not set. For more information, see the topic "cluster_mgr - Cluster manager name configuration parameter" in the DB2 Information Center. Do you want to set the high availability configuration parameter?
The following are valid settings for the high availability configuration parameter:
  1.TSA
  2.Vendor
Enter a value for the high availability configuration parameter: [1]
1
Setting a high availability configuration parameter for instance 'db2inst1' to 'TSA'.
Adding DB2 database partition '0' to the cluster ...
Adding DB2 database partition '0' to the cluster was successful.
Do you want to validate and automate HADR failover for the HADR database 'TESTDB'? [1]
1. Yes
2. No
1
Adding HADR database 'TESTDB' to the domain ...
HADR database 'TESTDB' 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 HADR database 'TESTDB'. Run db2haicu on the primary for HADR database 'TESTDB' to configure the database for automated failover.
All cluster configurations have been completed successfully. db2haicu exiting ...

6.在tsa01节点执行db2haicuhttps://www.cndba.cn/hbhe0316/article/103915

[db2inst1@tsa01 ~]$ db2haicu 
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 ...
When you use db2haicu to configure your clustered environment, you create cluster domains. For more information, see the topic 'Creating a cluster domain with db2haicu' in the DB2 Information Center. db2haicu is searching the current machine for an existing active cluster domain ...
db2haicu found a cluster domain called 'db2ha' on this machine. The cluster configuration that follows will apply to this domain.

Retrieving high availability configuration parameter for instance 'db2inst1' ...
The cluster manager name configuration parameter (high availability configuration parameter) is not set. For more information, see the topic "cluster_mgr - Cluster manager name configuration parameter" in the DB2 Information Center. Do you want to set the high availability configuration parameter?
The following are valid settings for the high availability configuration parameter:
  1.TSA
  2.Vendor
Enter a value for the high availability configuration parameter: [1]
1
Setting a high availability configuration parameter for instance 'db2inst1' to 'TSA'.
Adding DB2 database partition '0' to the cluster ...
Adding DB2 database partition '0' to the cluster was successful.
Do you want to validate and automate HADR failover for the HADR database 'TESTDB'? [1]
1. Yes
2. No
1
Adding HADR database 'TESTDB' to the domain ...
Adding HADR database 'TESTDB' to the domain was successful.
Do you want to configure a virtual IP address for the HADR database 'TESTDB'? [1]
1. Yes
2. No
2
Do you want to configure mount point monitoring for the HADR database 'TESTDB'? [2]
1. Yes
2. No
2
All cluster configurations have been completed successfully. db2haicu exiting ...

DB2 TSA安装完成

版权声明:本文为博主原创文章,未经博主允许不得转载。

DB2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值