小程序框架kbone与Hybird混合开发
896
2022-09-02
DB2 HADR TSA安装
前置条件,安装配置好db2 hadr,hadr 库为testdbdb2 hadr安装详见:
[root@tsa01 ~]# cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.56.100 tsa01192.168.56.101 tsa02[db2inst1@tsa02 ~]$ cat /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4::1 localhost localhost.localdomain localhost6 localhost6.localdomain6192.168.56.100 tsa01192.168.56.101 tsa02
一 创建tsa集群1.在所有的集群节点配置环境变量
echo "export CT_MANAGEMENT_SCOPE=2" >>/etc/profile
2.在两个节点都以root执行
[root@tsa01 ~]# /usr/sbin/rsct/install/bin/recfgctRemoved 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/recfgctRemoved 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是否正常
[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节点执行db2haicu
[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. Yes2. No1Create a unique name for the new domain:db2haNodes must now be added to the new domain.How many cluster nodes will the domain 'db2ha' contain?2Enter the host name of a machine to add to the domain:tsa01Enter the host name of a machine to add to the domain:tsa02db2haicu 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. Yes2. No1Creating 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. Yes2. No1Create a unique name for the new domain:db2haNodes must now be added to the new domain.How many cluster nodes will the domain 'db2ha' contain?2Enter the host name of a machine to add to the domain:tsa01Enter the host name of a machine to add to the domain:tsa02db2haicu 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. Yes2. No1Creating 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. Yes2. No1The following is a list of supported quorum device types: 1. Network Quorum 2. Disk Quorum 3. Majority Node SetEnter the number corresponding to the quorum device type to be used: [1]1Specify the network address of the quorum device:192.168.56.1Configuring 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. Yes2. No1Enter 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:3Enter 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:3Enter 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:1Are you sure you want to add the network interface card 'enp0s3' on cluster node 'tsa02' to the network 'db2_public_network_0'? [1]1. Yes2. No1Adding 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_02. 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:1Are you sure you want to add the network interface card 'enp0s3' on cluster node 'tsa01' to the network 'db2_public_network_0'? [1]1. Yes2. No1Adding 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.VendorEnter a value for the high availability configuration parameter: [1]1Setting 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. Yes2. No1Adding 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节点执行db2haicu
[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.VendorEnter a value for the high availability configuration parameter: [1]1Setting 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. Yes2. No1Adding 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. Yes2. No2Do you want to configure mount point monitoring for the HADR database 'TESTDB'? [2]1. Yes2. No2All cluster configurations have been completed successfully. db2haicu exiting ...
DB2 TSA安装完成
DB2
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。