DB2 Dual Machine Installation detailed

Source: Internet
Author: User
Tags db2 db2 port file system create database port number

On their own machine to do DB2 two-machine installation experiment, reference to some articles, and finally the two-machine done. Let's discuss the process and see what else needs to be improved?

DB2 Version: 8.1

Operating system: 5.1

Host Name: A machine: h80a B Machine: h80b

User:

A machine

User UserID Group GroupID homedirectory

Db2inst1 209 DB2IADM1 206/home/db2inst1

DB2FENC1 210 DB2FGRP1 103/home/db2fenc1

DASUSR1 dasadm1 101/HOME/DASUSR1 (local)

B Machine

User UserID Group GroupID homedirectory

Db2inst1 209 DB2IADM1 206/home/db2inst1

DB2FENC1 210 DB2FGRP1 103/home/db2fenc1

DASUSR1 dasadm1 102/HOME/DASUSR1 (local)

The DAS user home directory on both sides is local, and the home directory for both the instance user and the fence user is on the shared volume group

Note: The ID number of the instance user and fence user of the two machines is the same as the ID number of the group.

Shared VG:7133VG

Lvname Mountpoint

Db2inst1lv/home/db2inst1

Db2fenc1lv/home/db2fenc1

Lv05/db2log----------DB2 log file

Db2databa/db2data----------Db2inst1 Database file

Instance Name: Db2inst1

Database: TestDB

Configuration process:

The following operations are done on a machine:

1. Set up 7133VG of shared volume group

Create Lv:db2inst1lv,db2fenc1lv,db2databa

To create a file system:/home/db2inst1,/home/db2fenc1,/db2log,/db2data

2. Create User Db2inst1 and DB2FENC1

Create Group DB2IADM1,DB2FGRP1

3. Installing the Database

Setting up the optical drive file system

Mount/cdrom

Cd/cdrom

./db2setup

Establish DASUSR1 users and DASADM1 groups 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 DATABASE TestDB

Su-db2inst1

Db2start

Db2createdatabasetestdbon/db2data

Db2updatedbcfgfortestdbusingnewlogpath/db2log

Db2terminate

Db2stop

7.unmount/home/db2inst1

Unmount/home/db2fenc1

Unmount/db2log

Unmount/db2data

Varyoffvg7133vg

The following operations are done on the B-machine:

1. Synchronizing Shared volume groups

Importvg-y7133vghdiskx

Mount/home/db2inst1

Mount/home/db2fenc1

Mount/db2log

Mount/db2data

2. Create User Db2inst1 and DB2FENC1

Create Group DB2IADM1,DB2FGRP1

Note: The ID number of the above user and group will be the same as on machine a

3. Installing the Database

Setting up the optical drive file system

Mount/cdrom

Cd/cdrom

./db2setup

Establish DASUSR1 users and DASADM1 groups during installation

4. Create Instance Db2inst1

Mv/home/db2inst1/sqllib/home/db2inst1/sqllib.a

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's startup script in the HACMP environment)

5. Modify the/etc/services file

To add a DB2 port number against the/etc/services file of a machine, the port number of the two machines should be consistent

6. Start the database

Su-db2inst1

Db2start

Db2connecttotestdb

Installation Successful

Note: The hostname in the Db2nodes.cfg file must be consistent with the host name running DB2, so you can save a db2nodes.cfg backup locally on both machines

Add a command to overwrite/home/db2inst1/sqllib/db2nodes.cfg with a local db2nodes.cfg file in a hacmp script

The installation process above omits the HACMP installation configuration process

The contents of a machine db2nodes.cfg.a are:

0h80a0

The contents of B-Machine db2nodes.cfg.b are:

0h80b0

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.