3/12/2007

资料收集贴

我想, 有重要的网上找到的参考资料,我们可以把链接放到这里来, 附上简单的介绍। 方便大家查阅।

先贴一个:

高性能SQL http://www।ibm.com/developerworks/cn/db2/library/techarticles/dm-0411rielau/

developerworks上说这个难度是初级,呵呵,不过,建议大家还是好好看看। 这个初级可是没那么容易搞定的:)

3 comments:

匿名 说...

Best practices for tuning DB2 UDB v8.1 and its databases
A handbook for high performance

http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0404mcarthur/index.html

Yonghang Wang 说...

谢谢chaomin~~

Yonghang Wang 说...

HACMP配置

http://www.chinaunix.net 作者:xin9 发表于:2005-03-29 09:18:38

系统环境:AIX V5.2 , DB2 UDB V8.1 ESE
群集软件:HACMP V5.1
安装步骤:
1、 安装操作系统,补丁升级为ML04
补丁下载地址
ftp:// ftp.software.ibm.com/aix/fixes/52/ml
2、安装HACMP V5.1
HACMP 安装配置完成后,有网卡丢包现象,下载补丁IY53044
http://www-1.ibm.com/support/docview.wss?uid=isg1IY53044
2.1 HACMP 规划
两台主机的IP 规划如下表:
Adapter IP Label Nodedb_srv Nodedb_boot Nodedb_sty Nodedb_tty
Network Type ether ether ether rs232
Network Name Net_ether Net_ether Net_ether Net_rs232
Network Attribute public public Public serial
Adapter Function service boot standby
Adapter Identifer 192.168.168.32 192.168.168.28 172.16.1.2 /dev/tty0
Node Name nodedb nodedb nodedb nodedb

Adapter IP Label Nodeapp_srv Nodeapp_boot Nodeapp_sty Nodeapp_tty
Network Type ether ether ether rs232
Network Name Net_ether Net_ether Net_ether Net_rs232
Network Attribute public public Public serial
Adapter Function service boot standby
Adapter Identifer 192.168.168.33 192.168.168.21 172.16.1.1 /dev/tty0
Node Name Nodeapp nodeapp nodeapp nodeapp

两台主机都安装db2 与websphere, 互为主备,
2.2 Nodedb与nodeapp文件
2.2.1 nodedb /etc/hosts file
127.0.0.1 loopback localhost nodedb # loopback (lo0) name/address
192.168.168.28 nodedb_boot nodedb
192.168.168.32 nodedb_srv
172.16.1.2 nodedb_sty nodedb
192.168.168.21 nodeapp_boot
192.168.168.33 nodeapp_srv
172.16.1.1 nodeapp_sty
2.2.2 nodedb /.rhosts file
nodedb
nodeapp
nodedb_boot
nodedb_srv
nodedb_sty
nodeapp_boot
nodeapp_srv
nodeapp_sty
2.2.3 nodeapp /etc/hosts file
127.0.0.1 loopback localhost nodeapp # loopback (lo0) name/address
192.168.168.28 nodedb_boot nodedb
192.168.168.32 nodedb_srv
172.16.1.2 nodedb_sty nodedb
192.168.168.21 nodeapp_boot
192.168.168.33 nodeapp_srv
172.16.1.1 nodeapp_sty
2.2.4 nodeapp /.rhosts file
H85A
H85B
H85A_svr
H85A_boot
H85A_stb
H85B_svr
H85B_boot
H85B_stb

2.3 HACMP配置
2.3.1 拓扑定义
(1)定义CLUSTER
->;Initialization and Standard Configuration
->;Add Nodes to an HACMP Cluster
Add/Change/Show an HACMP Cluster

[输入字段]
* Cluster Name [ERP]

NOTE: HACMP must be RESTARTED
on all nodes in order for change to take effect

(2)定义nodedb节点
->; Extended Configuration
->; Extended Topology Configuration
->;Configure HACMP Nodes
->; Add a Node to the HACMP Cluster
Add a Node to the HACMP Cluster

[输入字段]
* Node Name [nodedb]
Communication Path to Node [] +
(2)定义nodeapp节点
->; Extended Configuration
->; Extended Topology Configuration
->;Configure HACMP Nodes
->; Add a Node to the HACMP Cluster
Add a Node to the HACMP Cluster

[输入字段]
* Node Name [nodedb]
Communication Path to Node [] +

(3) 定义网络
A. 定义IP网络
->; Extended Configuration
->;Extended Topology Configuration
->;Configure HACMP Networks
->; Add a Network to the HACMP Cluster
Add an IP-Based Network to the HACMP Cluster

[输入字段]
* Network Name [net_ether]
* Network Type ether
* Netmask [255.255.255.0] +
* Enable IP Address Takeover via IP Aliases [No] +
IP Address Offset for Heartbeating over IP Aliases []
B. 定义非IP网络
->; Extended Configuration
->;Extended Topology Configuration
->;Configure HACMP Networks
->; Add a Network to the HACMP Cluster
选择# Pre-defined Serial Device Types 中的rs232
Add a Serial Network to the HACMP Cluster
[输入字段]
* Network Name [net_rs232]
* Network Type rs232

(4) 定义网络接口
A. 定义IP网络接口
定义nodedb_boot接口:
->; Extended Configuration
->; Extended Topology Configuration
->;Configure HACMP Communication Interfaces/Devices
->; Add Communication Interfaces/Devices
选择 Add Pre-defined Communication Interfaces and Devices
选择 Communication Interfaces
选择net_ether (0.0.0.0/0)
Add a Communication Interface

[输入字段]
* IP Label/Address [nodedb_boot] +
* Network Type ether
* Network Name net_ether
* Node Name [nodedb] +
Network Interface []

定义Nodedb_sty接口:
->; Extended Configuration
->; Extended Topology Configuration
->;Configure HACMP Communication Interfaces/Devices
->; Add Communication Interfaces/Devices
选择 Add Pre-defined Communication Interfaces and Devices
选择 Communication Interfaces
选择net_ether (0.0.0.0/0)
Add a Communication Interface

[输入字段]
* IP Label/Address [Nodedb_sty] +
* Network Type ether
* Network Name net_ether
* Node Name [nodedb] +
Network Interface []

定义nodeapp_boot接口:
->; Extended Configuration
->; Extended Topology Configuration
->;Configure HACMP Communication Interfaces/Devices
->; Add Communication Interfaces/Devices
选择 Add Pre-defined Communication Interfaces and Devices
选择 Communication Interfaces
选择net_ether (0.0.0.0/0)
Add a Communication Interface

[输入字段]
* IP Label/Address [nodeapp_boot] +
* Network Type ether
* Network Name net_ether
* Node Name [nodeapp] +
Network Interface []

定义nodeapp_sty接口:
->; Extended Configuration
->; Extended Topology Configuration
->;Configure HACMP Communication Interfaces/Devices
->; Add Communication Interfaces/Devices
选择 Add Pre-defined Communication Interfaces and Devices
选择 Communication Interfaces
选择net_ether (0.0.0.0/0)
Add a Communication Interface

[输入字段]
* IP Label/Address [nodeapp_sty] +
* Network Type ether
* Network Name net_ether
* Node Name [nodeapp] +
Network Interface []

B. 定义非IP网络接口
定义nodedb_tty接口:
->; Extended Configuration
->; Extended Topology Configuration
->;Configure HACMP Communication Interfaces/Devices
->; Add Communication Interfaces/Devices
选择 Add Pre-defined Communication Interfaces and Devices
选择 Communication Device
选择 net_rs232
Add a Communication Device
[输入字段]
* Device Name [Nodedb_sty]
* Network Type rs232
* Network Name net_rs232
* Device Path [/dev/tty0]
* Node Name [nodedb]

定义nodeapp_tty接口:
->; Extended Configuration
->; Extended Topology Configuration
->;Configure HACMP Communication Interfaces/Devices
->; Add Communication Interfaces/Devices
选择 Add Pre-defined Communication Interfaces and Devices
选择 Communication Device
选择 net_rs232
Add a Communication Device
[输入字段]
* Device Name [nodeapp_tty]
* Network Type rs232
* Network Name net_rs232
* Device Path [/dev/tty0]
* Node Name [nodeapp]

2.3.2 定义应用服务及资源组
定义Was应用服务器:
->;Initialization and Standard Configuration
->;Configure Application Servers
->;Add an Application Server
Add Application Server

[输入字段]
* Server Name [was]
* Start Script [/usr/bin/wasstart]
* Stop Script [/usr/bin/wasstop]

定义共享资源组
定义rgwas资源组
->;Initialization and Standard Configuration
->;Configure HACMP Resource Group
->;Add a Resource Group
选择Cascading
Add a Resource Group with a Cascading Management Policy (standard)

[输入字段]
* Resource Group Name [rgwas]
*Participating Node Names (Default Node Priority) [nodeapp nodedb] +

修改资源组属性
修改rgwas资源组属性:
->;Initialization and Standard Configuration
->;Configure HACMP Resource Group
->; Change/Show Resources for a Cascading Resource Group(standard)
Change/Show Resources for a Cascading Resource Group

[输入字段]
Resource Group Name wlyres
Participating Node Names (Default Node Priority) nodeapp nodedb
* Service IP Labels/Addresses [] +
Volume Groups [wasvg] +
Filesystems (empty is ALL for VGs specified) [] +
Application Servers [was] +

定义Service IP
定义nodedb的service IP地址:
->;Initialization and Standard Configuration
->;Configure Resources to Make Highly Available
->;Configure Service IP Labeles/Addresses
->;Add a service IP Labeles/Addresses
Add a Service IP Label/Address (standard)

[输入字段]
* IP Label/Address [nodeapp_srv] +
* Network Name [net_ether] +

定义db2数据库服务
->;Initialization and Standard Configuration
->;Configure Application Servers
->;Add an Application Server
Add Application Server

[输入字段]
* Server Name [db2]
* Start Script [/usr/bin/hadb2start]
* Stop Script [/usr/bin/hadb2stop]

定义共享资源组
定义rgdb2资源组
->;Initialization and Standard Configuration
->;Configure HACMP Resource Group
->;Add a Resource Group
选择Cascading
Add a Resource Group with a Cascading Management Policy (standard)

[输入字段]
* Resource Group Name [rgdb2]
*Participating Node Names (Default Node Priority) [nodedb nodeapp] +

修改资源组属性
修改rgdb2资源组属性:
->;Initialization and Standard Configuration
->;Configure HACMP Resource Group
->; Change/Show Resources for a Cascading Resource Group(standard)
Change/Show Resources for a Cascading Resource Group

[输入字段]
Resource Group Name rgdb2
Participating Node Names (Default Node Priority) nodedb nodeapp
* Service IP Labels/Addresses [] +
Volume Groups [db2vg] +
Filesystems (empty is ALL for VGs specified) [] +
Application Servers [db2] +

(8) 定义Service IP
定义nodedb的service IP地址:
->;Initialization and Standard Configuration
->;Configure Resources to Make Highly Available
->;Configure Service IP Labeles/Addresses
->;Add a service IP Labeles/Addresses
Add a Service IP Label/Address (standard)

[输入字段]
* IP Label/Address [nodedb2_srv] +
* Network Name [net_ether] +

2.3.3 同步HACMP配置
->;Initialization and Standard Configuration
->; Verify and Synchronize HACMP Comfiguration
Verify and Synchronize HACMP Comfiguration

[输入字段]
* Verify, Synchronize or Both [Both] +
Force synchronization if verification fails? [No] +
* Verify changes only? [No] +
* Logging [Standard] +

9、 HACMP服务的启动和停止
启动:
#smitty clstart
Start Cluster Services
[输入字段]
* Start now, on system restart or both now +
Start Cluster Services on these nodes [nodedb] +
BROADCAST message at startup? true +
Startup Cluster Lock Services? false +
Startup Cluster Information Daemon? false +
Reacquire resources after forced down ? false +

停止:
#smitty clstop
Stop Cluster Services
[输入字段]
* Stop now, on system restart or both now +
Stop Cluster Services on these nodes [nodedb] +
BROADCAST cluster shutdown? true +
* Shutdown mode graceful+


注:
DB2版本8开始,原来的DB2企业版和企业扩展版合并为企业服务器版,无论对于分区数据库和非分区数据库,在实例目录下都会有db2nodes.cfg文件,该文件记录了服务器节点信息。
在单分区数据库安装模式下,需要建立db2nodes.cfg文件的副本,存放在本地硬盘上,文件名称一致,但内容不同。在HA执行db2启动脚本时将该文件cp到/home/db2inst1/sqlli目录下。
1、在nodedb上创建db2nodes.cfg文件,文件内容为
0 nodedb 0
2、将rc.db2pe.ee文件cp到/usr/bin目录下,并创建db2 脚本hadb2start,内容如下
#db2start script nodedb
cp /usr/bin/db2nodes.cfg /home/db2inst1/sqllib/db2nodes.cfg
rc.db2pe.ee db2inst1 start
db2 停止脚本
# db2 stop script nodedb
rc.db2pe.ee db2inst1 stop
在nodeapp上,也创建db2nodes.cfg文件,文件内容更改为nodeapp就可以了,其他步骤相同。
将脚本加入到ha的db2应用服务器中间就可以了。脚本会自动启动db2相关实例。