Database Host: Use VMwareworkstation to virtualize the operating system of two machines: RedHatEL5.3 database software: DB2V9.7 virtual machine, saving the trouble in installing the operating system environment. 2.2 logical topology 2.3 network configuration 2.3.1 Host IP configuration Linux1130.30.3.252 (255.2
Database Host: Use VMware workstation to virtualize two machines
Operating System: Red Hat EL 5.3
Database software: DB2 V9.7
Virtual Machine, the installation process of the operating system environment is omitted.
2.2 logical topology
2.3 network configuration 2.3.1 Host IP configuration
Linux1 130.30.3.252 (255.255.255.0)
Linux2 130.30.3.136 (255.255.255.0)
2.3.2/etc/hosts file configuration
/Etc/hosts of Linux1
130.30.3.252 linux1
130.30.3.136 linux2
/Etc/hosts of Linux2
130.30.3.252 linux1
130.30.3.136 linux2
2.3.3 verify network connectivity
Verify that the network connectivity is normal and configured correctly
Ping linux1
Ping linux2
Ping 130.30.3.252
Ping 130.30.3.136
3DB2 software installation 3.1 System Kernel Parameter Adjustment
Log on as a root user, edit the/etc/sysctl. conf file, modify the kernel parameters to be adjusted, and add the following:
Kernel. sem = 250 256000 32 1024
Kernel. shmmax = 268435456
Kernel. shmall = 8388608
Kernel. msgmax = 65535
Kernel. msgmnb = 65535
Kernel. shmall = 2097152
Kernel. shmmax = 2147483648
Kernel. shmmni = 4096
# Semaphores: semmsl, semmns, semopm, semmni
Kernel. sem = 250 32000 100 128
Fs. file-max = 65536
Net. ipv4.ip _ local_port_range = 1024 65000
Net. core. rmem_default = 262144
Net. core. rmem_max = 262144
Net. core. wmem_default = 262144
Net. core. wmem_max = 262144
Run sysctl-p to load sysctl settings from the/etc/sysctl. conf file.
Run the ipcs-l command to display and verify the current Kernel Parameter settings
# Ipcs-l
------ Shared Memory Limits --------
Max number of segments = 4096 // SHMMNI
Max seg size (kbytes) = 32768 // SHMMAX
Max total shared memory (kbytes) = 8388608 // SHMALL
Min seg size (bytes) = 1
------ Semaphore Limits --------
Max number of arrays = 1024 // SEMMNI
Max semaphores per array = 250 // SEMMSL
Max semaphores system wide = 256000 // SEMMNS
Max ops per semop call = 32 // SEMOPM
Semaphore max value = 32767
------ Messages: Limits --------
Max queues system wide = 1024 // MSGMNI
Max size of message (bytes) = 65536 // MSGMAX
Default max size of queue (bytes) = 65536 // MSGMNB
3.2 adjust user resource restrictions
Set the operating system hard limit of DB2 instance user Data, nofiles, and fsize resources to unlimited.
You can set this by modifying the file/etc/security/limits. conf.
* Soft nproc 3000
* Hard nproc 16384
* Soft nofile 65536
* Hard nofile 65536
You can use the ulimit-Hdnf command to query the value limit.
3.3 create a file system
Create the following file system on the master node:
Create PV and volume group
[Root @ linux1 db2] # pvcreate/dev/sdb1
[Root @ linux1 db2] # vgcreate datavg/dev/sdb1
Create LV and File System
[Root @ linux1 ~] # Lvcreate-n db2homelv-L 1G/dev/datavg
Logical volume "db2homelv" created
[Root @ linux1 ~] # Lvcreate-n hafs01lv-L 2G/dev/datavg
Logical volume "hafs01lv" created
# Mkfs. ext3/dev/datavg/db2homelv
# Mkfs. ext3/dev/datavg/hafs01lv
# Mkdir/db2home
# Mkdir/db2bak
Mount a File System
# Mount/dev/datavg/db2homelv/db2home
# Mount/dev/datavg/hafs01lv/db2bak
Add a mount point entry
# Vi/etc/fstab
/Dev/datavg/db2homelv/db2home ext3 defaults 1 2
/Dev/datavg/hafs01lv/db2bak ext3 defaults 1 2
Create the following file system on the slave host Node
[Root @ linux2 ~] # Vgcreate datavg/dev/sdb1
Volume group "datavg" successfully created
[Root @ linux2 ~] # Lvcreate-n db2homelv-L 1G/dev/datavg
Logical volume "db2homelv" created
[Root @ linux2 ~] # Mkfs. ext3/dev/datavg/db2homelv
[Root @ linux2 ~] # Mkdir/db2home
[Root @ linux2 ~] # Mount/dev/datavg/db2homelv/db2home
[Root @ linux2 ~] # Vi/etc/fstab
/Dev/datavg/db2homelv/db2home ext3 defaults 1 2
3.4 create users and groups
Create the following user groups and users on the master and slave nodes respectively to ensure that the two machines use the same UID and GID.
Create user group
Run the following command to create a group (for example, db2iadm1) for the instance owner and create a group (for example, db2fadm1) for the user who wants to execute a UDF or stored procedure ), create a group for the Management Server (for example, dasadm1 ):
Groupadd-g 999 db2iadm1
Groupadd-g 998 db2fadm1
Groupadd-g 997 dasadm1
Create user
Use the following command to create a user for each group created in the previous step. Each user's home directory will be the previously created shared DB2 home directory (db2home ).
Useradd-u 999-g db2iadm1-m-d/db2home/db2inst1 db2inst1
Useradd-u 998-g db2fadm1-m-d/db2home/db2fenc1 db2fenc1
Useradd-u 997-g dasadm1-m-d/db2home/dasusr1 dasusr1
Set the initial password of the new user
# Passwd db2inst1
# Passwd db2fenc1
# Passwd dasusr1
Modify file system owner
# Chown db2inst1: db2iadm1/db2home
# Chown db2inst1: db2iadm1/db2bak
3.5 install DB2 Software
Install the DB2 database software on the master and slave nodes in sequence. We recommend that you use root to install the software. Non-root users may have some restrictions on installation.
Decompress the installation and download media
[Root @ linux1 db2] # tar zxvf v9.7_linuxia32_server.tar.gz
Run the db2_install command
[Root @ linux1 server] #./db2_install
Select the DB2 installation directory to change the installation directory. The default installation directory in linux is/opt/ibm/db2/V9.7.
Default directory used to install the product-/opt/ibm/db2/V9.7
**************************************** *******************
Do you want to select another directory for installation? [Yes/No]
No
Select ESE to install DB2
Specify one of the following keywords to install the DB2 product.
ESE
CONSV
WSE
EXP
PE
CLIENT
RTCL
Press "help" to display the product name again.
Press "exit" to exit.
**************************************** *******************
ESE
After the installation is completed, a message indicating successful installation is displayed.
Initializing DB2 installation.
The total number of tasks to be executed is: 46
The total estimated time for all tasks to be executed is: 1876
Task #1 start
Description: The license agreement is being checked.
Estimated time: 1 second
Task #1 ends
.......................................
....................................... S
The execution has been completed successfully.
For more information, see the DB2 Installation Log On "/tmp/db2_install.log.18940.
3.6 configure NTP Network Time Synchronization
We recommend that you synchronize the time and date on the cluster node (but not required ).