Analysis of the entire process of DB2 dual-machine Installation

Source: Internet
Author: User
Tags db2 port

DB2 version: 8.1
Operating System: 5.1
Host Name: Host A: H80aB: H80b

User:
Host
Useruseridgroupgroupidhomedirectory
Db2inst1209db2iadm1206/home/db2inst1
Db2fenc1210db2fkg1103/home/db2fenc1
Dasusr1110dasadm1101/home/dasusr1 local)

Machine B
Useruseridgroupgroupidhomedirectory
Db2inst1209db2iadm1206/home/db2inst1
Db2fenc1210db2fkg1103/home/db2fenc1
Dasusr1111dasadm1102/home/dasusr1 (local)
The home directories of the das users on both sides are local, and those of the instance users and fence users are both in the shared volume group. Note: the IDs of instance users and fence users of the two machines must be the same.
Shared vg: 7133vg
Lvnamemountpoint
Db2inst1lv/home/db2inst1
Db2fenc1lv/home/db2fenc1
Lv05/db2log ---------- db2 Log File
Db2databa/db2data ---------- database file of db2inst1
Instance name: db2inst1
Database: testdb

Configuration process:
The following operations are completed on machine:

1. Create a shared volume group 7133vg
Create lv: db2inst1lv, db2fenc1lv, and db2databa
Create a file system:/home/db2inst1,/home/db2fenc1,/db2log,/db2data
2. Create users db2inst1 and db2fenc1
Create group db2iadm1, db2fgrp1
3. Install the database
Create an optical drive File System
Mount/cdrom
Cd/cdrom
./Db2setup
Create a dasusr1 user and a dasadm1 group during installation

4. Set the relevant path permissions to the specified user
Chown-Rdb2inst1: db2iadm1/home/db2inst1
Chown-Rdb2fenc1: db2fgrp1/home/db2fenc1
Chown-Rdb2inst1: db2iadm1/db2data
Chown-Rdb2inst1: db2iadm1/db2log
5. Create instance db2inst1
Cd/usr/opt/db2_08_01/instance
/Db2icrt-udb2fenc1db2inst1
6. Create a database testdb
Su-db2inst1
Db2start
Db2createdatabasetestdbon/db2data
Db2updatedbpath fortestdbusingnewlogpath/db2log
Db2terminate
Db2stop
7. unmount/home/db2inst1
Unmount/home/db2fenc1
Unmount/db2log
Unmount/db2data
Varyoffvg7133vg
The following operations are completed on machine B:
1. Synchronize shared volume groups
Importvg-y7133vghdiskX
Mount/home/db2inst1
Mount/home/db2fenc1
Mount/db2log
Mount/db2data
2. Create users db2inst1 and db2fenc1
Create group db2iadm1, db2fgrp1
Note: the IDs of the above users and groups must be the same as those of machine.
3. Install the database
Create an optical drive File System
Mount/cdrom
Cd/cdrom
./Db2setup
Create a dasusr1 user and a dasadm1 group during installation
4. Create instance db2inst1
Mv/home/db2inst1/sqllib/home/db2inst1/sqllib.
Cd/usr/opt/db2_08_01/instance
/Db2icrt-udb2fenc1db2inst1
Rm-R/home/db2inst1/sqllib
Mv/home/db2inst1/sqllib. a/home/db2inst1/sqllib
Cp/home/db2inst1/sqllib/db2nodes. cfg. B/home/db2inst1/sqllib/db2nodes. cfg (add this command to the ha STARTUP script in the hacmp environment)
5. Modify the/etc/services file
Add the db2 port number against the/etc/services file of machine A. The port numbers of the two machines must be consistent.
6. Start the database
Su-db2inst1
Db2start
Db2connecttotestdb
Installed successfully
Note: The host name in the db2nodes. cfg file must be consistent with the host name running DB2. Therefore, you can save a backup of db2nodes. cfg locally on both machines. Add the command to the hacmp script to overwrite/home/db2inst1/sqllib/db2nodes. cfg with the local db2nodes. cfg file.
The installation and configuration process of hacmp is omitted during the above installation process.

The content of db2nodes. cfg. A on machine a is 0H80a0.
The content of machine B db2nodes. cfg. B is: 0H80b0

(

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.