0% found this document useful (0 votes)
593 views16 pages

DB2 Purescale V11.5.6 Step by Step On RHEL8.1

The document provides step-by-step instructions for setting up IBM Db2 pureScale on two Linux hosts using VirtualBox. It covers installing Db2, creating the pureScale instance with two members and control files, adding a new control file and member, creating databases and storage groups, and adding/replacing disks on the shared storage. The last section describes how to add a third host or new member to the pureScale instance, and how to delete a member.

Uploaded by

legionario15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
593 views16 pages

DB2 Purescale V11.5.6 Step by Step On RHEL8.1

The document provides step-by-step instructions for setting up IBM Db2 pureScale on two Linux hosts using VirtualBox. It covers installing Db2, creating the pureScale instance with two members and control files, adding a new control file and member, creating databases and storage groups, and adding/replacing disks on the shared storage. The last section describes how to add a third host or new member to the pureScale instance, and how to delete a member.

Uploaded by

legionario15
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Step by Step

Setup
IBM Db2 pureScale
Db2 11.5.6
Linux 8.1 (RHEL)
Virtual Box 6.1.30
Part1: Overview and Preparation
Set up two hosts db1 and db2.
2 Linux 8.1 (RHEL) Hosts
Hostnames are db1 and db2

Make sure that same user exists on both of the hosts (nodes). In
my case user is dbp.

Note: The instance owner and fenced user needs to identical


uid/gid across the hosts.

Note: For test purpose, I am using same user as Instance


owner and fenced user.

Setup networking

1 public IP per node


cat /etc/hosts

ifconfig | grep inet

ping db1 from db2


ping db2 from db1

Setup passwordless ssh between root and instance owner

ssh db1
ssh db2

Setup path in the root .bashrc


export PATH=/root/bin:/usr/sbin/rsct/bin:/dbi/db2/V115/bin:$PATH
export PATH=/dbi/db2/V115/instance:$PATH
Setup NTP

dnf install chrony


systemctl enable chronyd
systemctl restart chronyd
systemctl status chronyd

Install DB2 11.5.6 Community Edition

1. Unzip DB2 file

cd /drived/VM_Softwares
tar xf DB2_v11.5.6_linuxx64_server_dec.tar -C /dbe/

2. Install tsamp

/dbe/server_dec/db2/linuxamd64/tsamp/prereqSAM
/dbe/server_dec/db2/linuxamd64/tsamp/installSAM

3. Install GPFS

/dbe/server_dec/db2/linuxamd64/gpfs/installGPFS -i

4. Install DB2 Binaries

mkdir /dbi/db2/V115

cd /dbe/server_dec/

./db2_install -b /dbi/db2/V115 -p SERVER -f PURESCALE

/dbi/db2/V115/adm/db2licm -l

Note: You can also use GUI Mode - /dbe/server_dec/db2setup

Note: Make sure that installation path for Db2 binary is same
on all the hosts.
5. Verify DB2 Installation using db2ls

Create shared disk for DATA (/dev/sdf) and TIE_BREAKER


(/dev/sdg). I have used scsi storage.

fdisk -l | grep 'Disk /dev/sd' | sort

iscsiadm -m discovery -t st -p 192.168.1.245

iscsiadm -m node -T NAS1DATA15G -p 192.168.1.245 -l


iscsiadm -m node -T NAS2TB5G -p 192.168.1.245 -l
iscsiadm -m node -T NAS3DATA20G -p 192.168.1.245 -l
iscsiadm -m node -T NAS4DATA30G -p 192.168.1.245 -l

fdisk -l | grep 'Disk /dev/sd' | sort


Part2: Create the instance
Create the instance using either db2isetup or db2icrt

/dbi/db2/V115/instance/db2isetup

Create 2 Members and 2 CFs


db2icrt \
-m db1 -mnet db1.db.com \
-m db2 -mnet db2.db.com \
-cf db1 -cfnet db1.db.com \
-cf db2 -cfnet db2.db.com \
-instance_shared_dev /dev/sdf \
-tbdev /dev/sdg \
-u dbp dbp;

Create 1 Member and 1 CF


(And later add member and CF)
db2icrt \
-m db1 -mnet db1.db.com \
-cf db2 -cfnet db2.db.com \
-instance_shared_dev /dev/sdf \
-tbdev /dev/sdg \
-u dbp dbp;

Review /etc/fstab for GPFS file system.

cat /etc/fstab
Set below Db2 registry parameters.

db2set DB2_SD_ALLOW_SLOW_NETWORK=ON
db2 TERMINATE

Once the setup is complete, make sure to verify the members


and components using below command.

db2instance -list

Review db2nodes.cfg file

cat /home/dbp/sqllib/db2nodes.cfg

Verify the tiebreaker

db2cluster -cm -list -tiebreaker

db2cluster -cm -set -tiebreaker -disk /dev/sdg

db2cluster -cm -list -tiebreaker


Part3: Add new CF and member
Add a new CF

db2stop member 0

db2iupdt -add -cf db1 -cfnet db1.db.com dbp

Add new member

db2stop cf 128

db2iupdt -add -m db2 -mnet db2.db.com dbp


Part 4: Create Database and add Storage
Verify DFTDBPATH

db2 get dbm cfg | grep DFTDBPATH

cat /etc/fstab | grep db2sd

db2cluster -cfs -list -filesystem

cd /db2sd_20210718043911

ls –l

Create Database

db2 CREATE DATABASE TEST

Add new Storage to cluster

iscsiadm -m discovery -t st -p 192.168.1.245

cat /etc/fstab

db2cluster -cfs -list -filesystem

db2cluster -cfs -list -filesystem db2fs1

fdisk -l | grep 'Disk /dev/sd' | sort

db2cluster -cfs -create -filesystem db2sd2 -disk


/dev/sdh -mount /db2sd2

db2cluster -cfs -list -filesystem


cat /etc/fstab

db2cluster -cfs -verify -configuration -


filesystem db2sd2

mkdir /db2sd2/dbp
chmod 777 /db2sd2/dbp

db2pd -db TEST -storagegroups

db2pd -db TEST -tablespaces

db2 "create stogroup second on '/db2sd2'"

db2 "create tablespace test1 using stogroup second"

db2pd -db TEST -storagegroups

db2pd -db TEST -tablespaces


Part 5: Add/Replace existing Disk
Verify existing Filesystem/Disk Configuration

db2cluster -cfs -list -filesystem

db2cluster -cfs -list -filesystem db2fs1

df -h /db2sd_20220416003720

Mount Shared Disk

fdisk -l | grep 'Disk /dev/sd' | sort

iscsiadm -m discovery -t st -p 192.168.1.245

iscsiadm -m node -T NAS4DATA30G -p 192.168.1.245 -l

fdisk -l | grep 'Disk /dev/sd' | sort

Add disk to existing Shared Storage

db2cluster -add -filesystem db2fs1 -disk /dev/sdi

Verify Disk is added to existing Shared Storage

db2cluster -cfs -list -filesystem db2fs1

df -h /db2sd_20220416003720

Remove Old Disk from Shared Storage

db2cluster -cfs -remove -filesystem db2fs1 -disk /dev/sdg

db2cluster -cfs -list -tiebreaker


db2cluster -cfs -set -tiebreaker -disk /dev/sdi
db2cluster -cfs -list -tiebreaker

db2cluster -cfs -remove -filesystem db2fs1 -disk /dev/sdg

Verify Disk is removed from existing Shared Storage

db2cluster -cfs -list -filesystem db2fs1

df -h /db2sd_20220416003720
Part 6: Add third host or new member
Add third host or new member
1. Install DB2
2. Create users
3. Setup networking
4. Setup passwordless ssh
5. Setup ntp
6. Setup Shared Storage
7. Add as a member using db2isetup or db2iupdt

db2iupdt -add -m db3 -mnet db3.db.com dbp

db2instance –list
Part 7: Delete a member from pureScale
Instance
lsrpnode

db2stop

db2instance –list

db2iupdt -drop -m db3 dbp

db2instance –list
Logout ISCSI

To log out of a specific system target, enter the following command:

iscsiadm --mode node --target <IQN> --portal x.x.x.x --logout


iscsiadm -m node -T NAS3DATA -p 192.168.1.245 --logout

To log out of all your established sessions, enter the following command:

iscsiadm --mode node --logoutall=all

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy