Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to build DB2 Database distributed Environment DPF on Linux

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "how to build DB2 database distributed environment DPF on Linux". In daily operation, I believe many people have doubts about how to build DB2 database distributed environment DPF on Linux. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to build DB2 database distributed environment DPF on Linux". Next, please follow the editor to study!

The partition architecture of DB2 is generally suitable for statistical and analytical applications, which is mainly used to support large-scale data processing and high concurrent data access. Its characteristics make it possible for many low-cost computers to form clusters to work together to improve the efficiency of massive data processing. DB2 database partition adopts Share-nothing architecture, and the database is divided into separate partitions in a non-shared environment, each partition has its own resources, such as memory, CPU and disk, as well as its own data, indexes, configuration files and transaction logs.

This article describes and records the installation process of db210.5 in Linux virtualized environment. For more information, please see the following:

First, create users and groups

1. Use root users to add system users

/ usr/sbin/groupadd-g 1997 db2igrp

# group where instance resides, and all users who join this group have DBA permissions / usr/sbin/groupadd-g 1998 db2fgrp

# group/usr/sbin/useradd-u 1997-g db2igrp-d / cbusdb/db2inst1 db2inst1 where fenced users are located

# db2inst1 user / usr/sbin/useradd-u 1998-g db2fgrp-d / cbusdb/db2fenc1 db2fenc1

# db2fenc1 user / usr/sbin/groupadd db2fadmin

/ usr/sbin/useradd-g db2fadmin db2admin

2. Use root users to add database accounts

/ opt/ibm/db2/V10.5/instance/db2icrt-s ese-u db2fenc1 db2inst1

# on all machines, use root users to create db2 admin server:

/ opt/ibm/db2/V10.5/instance/dascrt-u db2admin# starts db2admin server:

Db2admin start

3. Modify the node configuration file

# vim / cbusdb/db2inst1/sqllib/db2nodes.cfg0 cbusdb01 0

1 cbusdb01 1

2 cbusdb02 0

3 cbusdb02 1

4. Modify instance parameters

Su-db2inst1

Db2iauto-on db2inst1

Db2set DB2_SKIPINSERTED=on

Db2set DB2_USE_ALTERNATE_PAGE_CLEANING=ondb2set DB2_EVALUNCOMMITTED=on

Db2set DB2_SKIPDELETED=on

Db2set DB2COMM=TCPIP

Db2set DB2FCMCOMM=TCPIP4

Db2set DB2RSHCMD=/bin/rsh

# Note if the ssh is configured, it needs to be modified here to

Db2set DB2RSHCMD=/usr/bin/ssh

Db2set DB2CODEPAGE=1386

Db2set DB2TERRITORY=86

Db2set DB2_PARALLEL_IO=*

5. Configure the service port

DB2c_db2inst1 61000/tcp

DB2_db2inst1 61001/tcp

DB2_db2inst1_1 61002/tcp

DB2_db2inst1_2 61003/tcp

DB2_db2inst1_3 61004/tcp

DB2_db2inst1_4 61005/tcp

DB2_db2inst1_END 61008/tcp

6. Adjust the system parameters and set the resources required for dpf

/ sbin/sysctl-w kernel.sem= "32000 32 1024" / sbin/sysctl-w kernel.msgmnb=16384

/ sbin/sysctl-w kernel.msgmni=1024

/ sbin/sysctl-w kernel.msgmax=8192

/ sbin/sysctl-w kernel.shmmni=4096

/ sbin/sysctl-w kernel.shmall=2097152

/ sbin/sysctl-w kernel.shmmax=1073741824

7. Modify environment variables

Cat. / sqllib/db2profile > .profile

Vi .bash _ profile # adds the following information:

/ cbusdb/db2inst1/sqllib/db2profile

Second, configure the host name

Modify the following files on the two hosts:

# vi / etc/sysconfig/network

#-

# NETWORKING=yes

# HOSTNAME=cbusdb01

#-

# vi / etc/hosts

#-

# 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 cbusdb01#::1 localhost localhost.localdomain localhost6 localhost6.localdomain6#192.168.1.122 cbusdb01

# 192.168.1.123 cbusdb02

#-

3. Configure rsh

Rsh is a service that runs shell remotely. DB2 uses rsh services to run commands to start and stop database servers, as well as most administrative commands.

1. Install rsh

# yum install rsh*

2. Configure the security file of rsh

# vi / etc/securetty

# add the content

#-

# rsh

# rlogin

# rexec

#-

3. Modify the configuration parameter of rsh / etc/xinetd.d/rsh # # it is recommended to configure ssh secret-free login in production environment.

# vi / etc/xinetd.d/rsh

Service shell

{

Socket_type = stream

Wait = no

User = root

Log_on_success + = USERID

Log_on_failure + = USERID

Server = / usr/sbin/in.rshd

Disable = no

}

4. Modify the configuration file rlogin of rsh

# vi / etc/xinetd.d/rlogin

Service login

{

Disable = no

Socket_type = stream

Wait = no

User = root

Log_on_success + = USERID

Log_on_failure + = USERID

Server = / usr/sbin/in.rlogind

}

4. Log in without secret, and create a .rhosts file in the home directory of the instance user db2inst1

Cat $HOME/.rhosts

Cbusdb01 db2inst1

Cbusdb02 db2inst1

5. CentOS7.0 needs to download xinetd separately.

Yum install xinetd # below this version can not be downloaded

6. Restart the rsh service

Service xinetd restart

7. Verify the rsh service

Rsh cbusdb01 date

Rsh cbusdb02 date

# db2_all echo hi did not return

Yum install ksh

Configure the clock server

1. Install the ntp server

# yum install ntp*

# ntpdate-u 202.112.10.36

# ntpdate cn.pool.ntp.org

# service ntpd start

# chkconfig ntpd on

2. Modify ntp configuration

# allow synchronization time of other machines in the private network

Restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# Internet time server

Server 210.72.145.44 perfer # China National time receiving Center server 202.112.10.36

# 1.cn.pool.ntp.orgserver 59.124.196.83

# 0.asia.pool.ntp.org# allows upper-level time servers to actively modify local time

Restrict 210.72.145.44 nomodify notrap noquery

Restrict 202.112.10.36 nomodify notrap noquery

Restrict 59.124.196.83 nomodify notrap noquery

# when an external time server is not available, use local time as the time service

Server 127.0.0.1

Fudge 127.0.0.1 stratum 10

3. Modify the time zone

Cp-f / usr/share/zoneinfo/Asia/Shanghai / etc/localtime

Clock-w

4. Configure the clock server on node 2

* / 5 * / usr/sbin/ntpdate cbusdb01

5. Configure nfs service

1 、 yum install nfs*

# yum install portmap rpcbind # install nfs client

2. Configure resources that need to be shared

# vi / etc/exports

/ cbusdb * (rw,sync,no_root_squash)

/ cbusdblog * (rw,sync)

3. Start nfs server

Service rpcbind start

Service nfs start

Service nfslock restart

4. Export resources

Exportfs-rv

5. Show all shared volumes on NFS Server

Showmount-e

6. Mount the shared directory on the client

# mount 192.168.1.122:/cbusdb / cbusdb

# vi / etc/fstab

Cbusdb01:/cbusdb / cbusdb nfs rw,timeo=300,retrans=5,hard,intr,bg,nolock,suid

VI. Close selinux

Vim / etc/sysconfig/selinux

# SELINUX=disabled

7. Testing and creating databases

1. Start the database

# db2start

2. Create a database

# db2 "create db cbusdb on / cbusdblog using codeset gbk territory cn"

At this point, the study on "how to build a DB2 database distributed environment DPF on Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report