0% found this document useful (0 votes)
143 views4 pages

Db2 Pacemaker On RHEL 8.1

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

Db2 Pacemaker on RHEL 8.

1
Db2 11.5.5
By Subodh Khaire
Thanks to Srikanth Pentyala

Steps
1. Install DB2 on Node 1(db1) and Node 2(db2)
2. Create DB2 (dbp) Instance on db1 and db2
3. Setup HADR databases on db1 and db2 – DB_HADR
4. Setup HADR_PEER_WINDOW to minimum 60 seconds
5. Setup password-less ssh for root and Instance owner (dbp)
6. Install pacemaker software
7. Create Cluster and add instance and database resources
8. Install packages on third host
9. Configure Quorum

Setup

Operating System RHEL 8.1


DB2 Version DB2 11.5.5
Hostname db1 and db2, db3 for qnet
Instance Name dbp
Database Name DB_HADR

Install Packages
yum -y install binutils
yum -y install cpp
yum -y install dnf
yum -y install gcc-c++
yum -y install ksh
yum -y install libstdc++
yum -y install libstdc++.so.6
yum -y install patch
yum -y install perl
yum -y install perl-Sys-Syslog
yum -y install python2
yum -y install sg3_utils

Install Pacemaker
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-
8.noarch.rpm
tar -zxf Db2_v11.5.5.0_Pacemaker_20201118_RHEL8.1_x86_64.tar.gz
cd /drived/VM_Softwares/Db2_v11.5.4.0_Pacemaker_RHEL8.1/RPMS
dnf install */*.rpm

Verify Pacemaker Packages


rpm -q corosync
rpm -q pacemaker
rpm -q crmsh

Edit /etc/hosts
127.0.0.1 localhost.db.com localhost
# Public
192.168.1.101 db1.db.com db1
192.168.1.102 db2.db.com db2
192.168.1.103 db3.db.com db3

Verify HADR
db2pd –db DB_HADR –hadr
OR
./hadr_get_status.sh

Disable the DB2 Fault Monitor


ps -ef | grep db2fmcd
/dbi/db2/V1155/bin/db2fmcu -d
ps -ef | grep db2fmcd
Copy the db2cm utility to instance sqllib/adm directory
cp /drived/VM_Softwares/Db2_v11.5.5.0_Pacemaker_RHEL8.1/Db2/db2cm
/home/dbp/sqllib/adm

chmod 755 /home/dbp/sqllib/adm/db2cm

Copy the resource agent scripts (db2hadr, db2inst, db2ethmon) from


/tmp/Db2agents into /usr/lib/ocf/resource.d/heartbeat/ on both hosts
/home/dbp/sqllib/adm/db2cm -copy_resources
/drived/VM_Softwares/Db2_v11.5.5.0_Pacemaker_RHEL8.1/Db2agents -host db1

/home/dbp/sqllib/adm/db2cm -copy_resources
/drived/VM_Softwares/Db2_v11.5.5.0_Pacemaker_RHEL8.1/Db2agents -host db2

Check the tools (db2ethmon, db2hadr, db2inst) have been copied OK:
ls -alL /usr/lib/ocf/resource.d/heartbeat/db2*

Create Cluster
cd /home/dbp/sqllib/adm

./db2cm -create -cluster -domain ha_domain -host db1 -publicEthernet enp0s8 -


host db2 -publicEthernet enp0s8

Create the instance resource model


cd /home/dbp/sqllib/adm

./db2cm -create -instance dbp -host db1


./db2cm -create -instance dbp -host db2

Create the HADR database resources


/home/dbp/sqllib/adm/db2cm -create -db DB_HADR -instance dbp

Verify the cluster


crm status
crm config show
Configure a QDevice quorum
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-
8.noarch.rpm
cd /drived/VM_Softwares/Db2_v11.5.5.0_Pacemaker_RHEL8.1/
dnf install corosync-qnetd-*.rpm
dnf install corosync-qnetd-debuginfo-*.rpm

./db2cm -create -qdevice db3

Check QDevice from Primary/Standby


corosync-qdevice-tool -s

Check QDevice from QDevice Node (Third Node)

corosync-qnetd-tool –l

Kill the primary Instance

ps –ef | grep db2sysc


kill -9 <db2sysc_pid>

Shutdown Primary

Delete Cluster

/home/dbp/sqllib/adm/db2cm -delete -cluster

You might also like