小型机操作系统及HACMP安装操作配置手册
第一部分:AIX操作系统安装
本文档是针对AIX6.1操作系统编写的,介绍了两种安装方法,一种是通过光驱引导系统,执行通过光盘安装的全新安装方法;二是从磁带机引导系统执行通过mksysb备份带的恢复操作系统的安装方法。
1.1 BOS基本的操作系统安装
Step 1. 安装准备
硬件需求
Only Common Hardware Reference Platform (CHRP) machines are supported.
To see if you have a CHRP machine, log into the machine as the root user, and run the following command:
bootinfo –p
Power7 服务器支持情况
P780:
AIX 6.1 with the 6100-04 Technology Level and Service Pack 3, or later
AIX 6.1 with the 6100-03 Technology Level and Service Pack 5, or later, available June 25, 2010
AIX 6.1 with the 6100-02 Technology Level and Service Pack 8, or later, available June 25, 2010
P770:
AIX 6.1 with the 6100-04 Technology Level and Service Pack 3, or later
AIX 6.1 with the 6100-03 Technology Level and Service Pack 5, or later, available June 25, 2010
AIX 6.1 with the 6100-02 Technology Level and Service Pack 8, or later, available June 25, 2010
Power6 服务器支持情况
P595:
AIX 6.1 with the 6100-00 Technology Level and Service Pack 5, or later
AIX 6.1 with the 6100-01 Technology Level, or later
P570:支持
Power5 服务器支持情况
支持
Power4 服务器支持情况
Required Levels of Hardware Management Console (HMC) and 微码版本
主机微码版本要求
Platform firmware version 3 or later.
To determine your platform firmware level, type the following at the command prompt:
lscfg –vp | grep –p Platform
The last six digits of the ROM level represent the platform firmware date in the format YYMMDD.
Firmware with dates between 020413 and 021024, or that has firmware level 2xYYMMDD, is considered Version 2.
Firmware with dates between 021025 and 040602, or that has firmware level 3xYYMMDD, is considered Version 3。
HMC版本要求,HMC Release 3 Version 2.0 or later。
Step 2. 光盘启动
放入操作系统介质光盘的第一张光盘到光驱中。
确认外围硬件设备连接好,已经加电, (such as CD-ROM drives, tape drives, DVD drives, and terminals) are turned on。
Power on 系统
当系统 beeps twice, 按 F5 on the keyboard (or 5 on an ASCII terminal),系统会从默认的引导设备启动。
按F1 选择console(or 1 on an ASCII terminal) and press Enter。
按1选择安装语言为English。
选择第2项,修改安装设置,如下图
Step 3. 安装选项设置
In the Installation and Settings screen, verify the installation settings are correct by checking the method of installation (new and complete overwrite), the disk or disks you want to install, the primary language environment settings, and the more options menu. If the default choices are correct, type 0 and press Enter to begin the BOS installation. The system automatically reboots after installation is complete. Go to step 4. Otherwise, go to sub-step 2.
To change the System Settings, which includes the method of installation and disk where you want to install, type 1 in the Choice field and press Enter.
Type 1 for New and Complete Overwrite in the Choice field and press Enter. The Change Disk(s) Where You Want to Install screen now displays.
In the Change Disk(s) Where You Want to Install screen:
Select hdisk0 by typing a 1 in the Choice field and press Enter. The disk will now be selected as indicated by >>>. To unselect the destination disk, type the number again and press Enter.
To finish selecting disks, type a 0 in the Choice field and press Enter. The Installation and Settings screen displays with the selected disks listed under System Settings.
Change the Primary Language Environment Settings to English (United
States). Use the following steps to change the Cultural Convention, Language, and Keyboard to English.
Type 2 in the Choice field on the Installation and Settings screen
to select the Primary Language Environment Settings option.
b. Type the number corresponding to English (United States) as the
Cultural Convention in the Choice field and press Enter.
Select the appropriate keyboard and language options.You do not need to select the More Options selection, because you are using the default options in this scenario. For more information about the installation options available in AIX 6.1 and greater, see BOS installation options.
Verify that the selections are correct in the Overwrite Installation
Summary screen, as follows:
Note: The default options change based on machine and console type.
按回车键开始安装BOS操作系统. 安装完成后系统会自动重新启动。
操作系统启动后,检查操作系统版本,并验证软件包一致性
# oslevel –s
# lppchk –v
1.2 安装bundles软件
BOS操作系统安装完成后,下面将进行操作系统扩展软件包的安装
以root用户登录系统。
通过指定输入设备和正在安装的捆绑软件来安装完整的捆绑软件软件。也可以预览捆绑软件安装以了解将安装什么软件以及在文件系统上需要多少空间来安装捆绑软件。请在命令行上输入 smit install_bundle。
需要安装的bundles软件包包括:
App-DEV
Alt_Disk_Install
CDE
Graphic
Server
PerfTools
openssh_server(需要Expansion Pack 光盘)
放入操作系统的第一张光盘,选择需要安装的bundle软件包。
安装时根据提示更换光盘介质
安装单独的软件包
选择表中的软件进行安装
需求/用途 |
操作系统软件包名称 |
备注 |
hacmp/Oracle数据库软件需要 |
rsct.compat.basic.hacmp |
RSCT软件包 |
rsct.compat.clients.hacmp |
||
rsct.basic.rte |
||
rsct.basic.hacmp |
||
rsct.core.sec |
||
rsct.core.rmc |
||
bos.rte.lvm.rte |
CLVM软件包,For RAC |
|
bos.clvm.enh |
||
bos.cifs_fs.rte |
安装该包,否则Oracle安装时会报错 |
|
bos.data |
|
|
bos.adt.base |
|
|
bos.adt.lib |
|
|
bos.adt.libm |
|
|
bos.perf.perfstat |
|
|
bos.perf.libperfstat |
|
|
bos.perf.proctools |
|
|
xlC.aix61.rte:9.0.0.1 |
|
|
xlC.rte:9.0.0.1 |
|
|
bos.net.tcp.client |
|
|
bos.net.tcp.server |
|
|
bos.rte.SRC |
|
|
bos.rte.libc |
|
|
bos.rte.libcfg |
|
|
bos.rte.libcur |
|
|
bos.rte.libpthreads |
|
|
bos.rte.odm |
|
安装以上列表中的软件包,全部进行安装,安装方法smit install
1.3 打FIX补丁
根据《AIX版本策略》要求,将操作系统的补丁安装到相应的TL及SP补丁级别,Update Installed Software to Latest Level。
#smit update_all
1.4 验证软件安装
验证内容为文件大小、校验和值或符号链接方面,及可安装软件产品(文件集)的文件是否符合软件重要产品数据(SWVPD)数据库信息
运行命令
#lppchk –v
If the installation is OK, this commands should return nothing。
1.5 重启系统
软件安装结束后,需要reboot操作系统
# shutdown –Fr
操作系统重新启动后,登陆系统,检查操作系统版本安装是否正确?
# oslevel –s
二、通过磁带安装
对于配置好的AIX操作系统,先不要设置ip地址、磁盘镜像等用户信息,即是一个干净的操作系统,我们将其备份到磁带上,做成mksysb标准带,来定制安装其它的服务器分区。
2.1 设置启动顺序
1. 给主机上电,等主机面板的荧光条显示“OK”,您就可以打开机器上的电源开关按钮,启动机器。
2. 将定制的AIX 5L操作系统备份带放入磁带机
3. 当图形终端显示如下信息时按‘1’键。进入“System Management Services”图形功能菜单。
4. 在“System Management Services”图形菜单中,您可以看到5个功能选项:
5.
选择第5个选项, Select Boot Option ,然后回车。
6. 出现如下菜单,选择第1项 Select Install or Boot Device
7. 提示选择设备类型,这里选择第2项 Tape
8. 提示选择介质类型,这里选择第1项SCSI设备
9. 提示选择Media Adapter,这里选择第1项(如果第1项没有出现Tape,逐个试直到出现磁带机),再根据提示选择1 SCSI Tape。
10. 系统出现下面的菜单,选择Service Mode Boot
11. 系统提示是否退出 System Management Services?,回答yes,选中1然后回车。
12. 系统开始从磁带设备启动,出现安装语言等选项
13. 选择3 ,进入系统维护模式
选择5 ,Instal from a System Backup
14. 确认安装设备,选择安装到的磁盘,开始安装出现如下界面:
操作系统安装完成后,会自动重新启动操作系统,检查操作系统版本
#oslevel –s
操作系统软件及补丁安装完成后,接下来对系统进行相应的配置。
3.1 设置主机名
hostname设置:smit hostname,主机名需符合规范
3.2 登陆提示符PS1设置
编辑/etc/profile文件,vi /etc/profile,加入
PS1=`whoami`@`hostname`:’$PWD>’
3.3 配置网卡绑定、IP地址
网卡绑定配置
双网卡绑定主、备网卡工作模式etherchannel设置方法:
说明:本系统有4块物理网卡,分别为ent0、ent1、ent2、ent3,绑定ent0与ent1两块网卡,设置ent0为主网卡、ent1为备份网卡,注意两块网卡不能是一对双口卡。
增加EtherChannel,
#smit etherchannel
选择网卡ent0
选择备份网卡 Backup Adapter “ent1”
确认后系统提示生成ent4虚拟网卡
配置IP地址时选择ent4对应的逻辑网卡en4进行配置。
IP地址配置
配置ip地址不要使用smit mktcpip,因为使用mktcpip每配置一个IP地址时,都会更改/etc/hosts表增加一条主机名的映射关系。建议使用smit chinet配置ip地址,然后手工修改hosts表。
Smit chinet
配置default gateway:smit mkroute,如配置缺省网关时指定DESTINATION Address 为 0,并输入缺省网关地址,其它项不填写。
配置静态路由
配置静态路由时也使用smit菜单进行配置,以保证系统重新启动后,路由不会丢失。举例配置带外管理到11.159.0.0网段,走11.159.20.1,子网掩码为255.255.0.0
#smit route
检查路由配置
检查当前路由表:#netstat –rn
检查ODM库中的路由表信息:#lsattr –El inet0
3.4 设置系统时区及时间
时区设置为Asia/Shanghai
smit systemàChange / Show Date and TimeàChange Time Zone Using System Defined Values
选择正确的时区,时区设置完成后需要重新引导操作系统。
3.5参数设置
1.操作系统参数设置
操作系统基本参数
更改用户最大进程数,设置10240
chdev –l sys0 –a maxuproc=’10240’
启用完全核心转储
chdev –l sys0 –a fullcore=’true’
总是允许系统转储
sysdumpdev ‘-K’
2、VMM 参数
例:
vmo –p –o minperm%=5
vmo –p –o maxclient%=90
vmo –p –o maxperm%=90
-p参数表示重启操作系统后,修改仍然生效
3、网络参数
例:
no –p –o rfc1323 = 1
-p参数表示重启操作系统后,修改仍然生效
3.6 安全设置
关闭不使用的系统服务
tcpip服务
vi /etc/rc.tcpip
注释掉不使用的服务,如关闭DNS服务
inetd服务
vi /etc/inetd.conf
如注释掉telnet服务,在telnet 前面增加“ # ”
执行下面的命令,使修改生效。
# refresh –s inetd
禁止不用的用户登录
禁止系统生成的不使用的用户的login、rlogin,如ssh,daemon, bin, sys, adm, uucp, nuucp, printq, guest, nobody, lpd, and sshd.
禁用方法:
# chuser login=false rlogin=false uucp
3.7 LVM管理
创建vg
卷组时使用选项 B或 S,-s指定PPSize,-V指定major number
#mkvg –B –s 256 –V 100 –y vgname hdisk3 hdisk4
创建裸设备LV,-t指定用途裸设备为raw
创建裸设备
#mklv –y lvname –t raw –G group –U user vgname 100
创建条带化Stripe的LV,使用-S参数根据不同的存储设备指定条带SIZE,条带宽度一般不要超过4块磁盘
#mklv –y lvname –t raw –S512K –G group –U user vgname 100 hdisk3 hdisk4 hdisk5
创建文件系统
先创建类型为jfs2的逻辑卷,如果文件系统位于存储磁盘,建议先创建条带化的LV,条带宽度一般不要超过4块磁盘
#mklv –y lvname –t jfs2 vgname 100
在LV上创建文件系统,如果是本地卷组自动mount参数-A 设置yes;如果是共享卷组参数 –A设置 no,不要自动mount
#crfs –v jfs2 –d lvname –m /home/db/oracle –A yes
3.8 创建用户、组
在ha环境下,创建组及用户时需要保持各节点一致,包括名称、ID、home 目录等属性。
创建组
mkgroup –A id=320 db2
创建用户
mkuser –a id=321 pgrp=db2 groups=db2 home=/home/db/db2 db2inst1
3.9镜像rootvg
rootvg中所有的lvm都创建完成后,即操作系统配置完成后,需要对rootvg的磁盘创建镜像,并确保所有文件系统已经mount上。
增加hdisk1到rootvg中
#extendvg rootvg hdisk1
将hdisk0的lv镜像到hdisk1磁盘上
#smit mirrorvg
选择rootvg
选择镜像到磁盘hdisk1
生成bootimage
#bosboot –ad hdisk0
#bosboot –ad hdisk1
设置启动顺序
#bootlist –m normal hdisk0 hdisk1
重新引导操作系统
rootvg镜像完成后,需要重新启动操作系统,否则镜像不会生效。
第二部分:HACMP安装和配置手册
1.1注意事项
在规划之前,请注意下面几项内容:
Ø 操作系统的版本和补丁,两个节点的版本要保持一致
Ø 建议Cluster中node名称和主机名称保持一致。例如节点名称采用WAS 和DB2,cluster的名称为DB2WAScluster。
Ø 确定IP地址的切换是采用alias 方式还是replacement 方式,建议采用IP alias方式,如果采用IP alias方式,默认网关需要在HA同步之后再添加。
Ø 确定节点之间的心跳采用何种方式,建议使用串口方式。
Ø 确定资源组的切换方式,由于目前版本cluster的资源组切换方式比较灵活,通过下表,可以同之前的版本的资源切换方式(cascading,rotating,concurrent)进行对比。
RG maping |
Startup |
Failover |
Fallback |
|||||
|
OHNO |
OFAN |
OAAN |
FOPN |
FDNP |
BOEN |
FBHP |
NFB |
Cascading |
Y |
|
|
Y |
|
|
Y |
|
CWOF+IT+DNP |
|
Y |
|
|
Y |
|
|
Y |
Rotating |
|
Y |
|
Y |
|
|
|
Y |
Concurrent |
|
|
Y |
|
|
Y |
|
Y |
1.2资源组的操作策略
STARTUP
Online on home node only=OHNO
Online on first available node=OFAN
Online on all available nodes=OAAN
FALLOVER
Fallover to next priority node in the list=FOPN
Fallover using dynamic node priority=FDNP
Bring offline (On error node only)=BOEN
FALLBACK
Fallback to higher priority node in the list=FBHP
Never fallback=NFB
1.3 Cluster拓扑结构
下图是cluster非常典型的拓扑结构。
1.4 Cluster配置规划
拓扑规划
Cluster node:
Cluster name |
Node name(same as hostname) |
Communication path(hostname_bt1) |
DB2WAScluster |
DB2 |
DB2_boot1 |
WAS |
WAS_boot1 |
Cluster network:
network name |
network type |
subnetwork mask |
using alias |
Network attr |
net_ether_01 |
ether |
255.255.255.0 |
yes |
public |
net_diskhb_01 |
diskhb |
n/a |
n/a |
n/a |
Cluster adapter
node |
Label |
Address |
network name |
Adapter function |
note |
DB2 |
DB2boot1 |
192.168.1.20 |
net_ether_01 |
boot1 |
ent0 |
DB2boot2 |
192.168.2.20 |
net_ether_01 |
boot2 |
ent4 |
|
DB2persistent |
10.66.228.35 |
net_ether_01 |
persistent |
|
|
DB2service |
10.66.228.37 |
net_ether_01 |
service |
|
|
DB2_diskhb_01 |
/dev/diskhb |
net_diskhb_01 |
Concurrent vg |
|
|
WAS |
WASboot1 |
192.168.1.19 |
net_ether_01 |
boot1 |
ent0 |
WASboot2 |
192.168.2.19 |
net_ether_01 |
boot2 |
ent4 |
|
WASpersistent |
10.66.228.36 |
net_ether_01 |
persistent |
|
|
WASservice |
10.66.228.38 |
net_ether_01 |
service |
|
|
WAS_diskhb_01 |
/dev/diskhb |
net_diskhb_01 |
Concurrent vg |
|
应用脚本规划
Application server
app Name |
Start Script |
Stop Script |
DB2_app |
/hacmp/DB2serverstart.sh |
/hacmp/DB2serverstop.sh |
WAS_app |
/hacmp/WASserverstart.sh |
/hacmp/WASserverstop.sh |
资源组和属性规划
Resource group
ResourceGroup Name |
Part. Node Name |
Startup attr |
Failover attr |
Fallback |
DB2_grp |
DB2,WAS |
OHNO |
FOPN |
FBHP |
WAS_grp |
WAS,DB2 |
OHNO |
FOPN |
FBHP |
Resource group attribute
Resource Group Name |
DB2_rg |
WAS_rg |
Service IP |
DB2_svc |
WAS_svc |
Application Servers |
DB2_app |
WAS_app |
Volume Group |
DB2vg WASvg |
|
Filesystems |
ALL |
安装HACMP软件之前,确保操作系统安装了如下bundle:Server,APP-DEV,CDE,Alt_Disk_Install。如果没有,请使用smitty easy_install安装。
放入HACMP安装光盘到光驱。
Smitty osted
Install and Update Software
Move cursor to desired item and press Enter.
Install Software Update Installed Software to Latest Level (Update All) Install Software Bundle Update Software by Fix (APAR) Install and Update from ALL Available Software
|
选择“Install Software”
INPUT device / directory for software
Move cursor to desired item and press Enter.
/dev/cd0 (IDE DVD-ROM Drive) |
选择光驱“/dev/cd0”
Install Software
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * INPUT device / directory for software /dev/cd0 * SOFTWARE to install [_all_latest] PREVIEW only? (install operation will NOT occur) no COMMIT software updates? Yes SAVE replaced files? No AUTOMATICALLY install requisite software? Yes EXTEND file systems if space needed? Yes OVERWRITE same or newer versions? No VERIFY install and check file sizes? No Include corresponding LANGUAGE filesets? Yes DETAILED output? No Process multiple volumes? Yes ACCEPT new license agreements? No Preview new LICENSE agreements? No |
software to install àF4选择,
SOFTWARE to install
Move cursor to desired item and press F7. Use arrow keys to scroll. ONE OR MORE items can be selected. Press Enter AFTER making all selections.
[TOP]
> cluster.adt.es ALL + 6.1.0.3 ES Client CLINFO Samples + 6.1.0.3 ES Client Clstat Samples + 6.1.0.3 ES Client Include Files + 6.1.0.3 ES Client LIBCL Samples + 6.1.0.3 ES Web Based Monitor Demo
> cluster.doc.en_US.es ALL |
通过ECS+7 or F7 选择需要安装的软件,除了cluster.hativoli 和 cluster.haview其他都要选择。
回车后修改下面的选项:
Preview only? =Yes (如果实际安装,此处为No)
ACCEPT new license agreements? =Yes
Install Software Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * INPUT device / directory for software /dev/cd0 * SOFTWARE to install [cluster.adt.es] PREVIEW only? (install operation will NOT occur) yes COMMIT software updates? Yes SAVE replaced files? No AUTOMATICALLY install requisite software? Yes EXTEND file systems if space needed? Yes OVERWRITE same or newer versions? No VERIFY install and check file sizes? No Include corresponding LANGUAGE filesets? Yes DETAILED output? No Process multiple volumes? Yes ACCEPT new license agreements? Yes Preview new LICENSE agreements? No |
其他选项保持默认值,
回车后,结果如下
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
[TOP] geninstall –I “a –cgNpQqwXY –J” -Z –p -d /dev/cd0 –f File 2>&1
File: I:cluster.adt.es.client.include 6.1.0.3 I:cluster.adt.es.client.samples.clinfo 6.1.0.3 I:cluster.adt.es.client.samples.clstat 6.1.0.3 I:cluster.adt.es.client.samples.libcl 6.1.0.3 I:cluster.adt.es.java.demo.monitor 6.1.0.3 I:cluster.doc.en_US.es.html 6.1.0.3 I:cluster.doc.en_US.es.pdf 6.1.0.3 I:cluster.es.cfs.rte 6.1.0.3 I:cluster.es.client.lib 6.1.0.3 I:cluster.es.client.rte 6.1.0.3 [MORE...122] |
通过下翻,可以看到如下部分
COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. [MORE…122] MISSING REQUISITES: The following filesets are required by one or more of the selected filesets listed above. They are not currently installed and could not be found on the installation media.
Bos.clvm.enh 6.1.0.13 # Fileset Update bos.data 6.1.0.13 # Base Level Fileset rsct.basic.hacmp 2.4.2.0 # Base Level Fileset rsct.basic.rte 2.4.2.0 # Base Level Fileset rsct.basic.sp 2.4.2.0 # Base Level Fileset rsct.opt.storagerm 2.4.5.0 # Base Level Fileset
GROUP REQUISITES: The dependencies of one or more of the selected filesets listed above are defined by a group requisite. A group requisite must pass a specified number of requisite tests. The following describe group requisite failures for filesets that you selected. (See the “Requisite Failure Key” below for details of group member failures.) |
可以看到,如果安装要cluster软件,还需要安装一些文件,这些文件都在操作系统的安装光盘中。退出后,根据安装需要的文件,然后重复上面的过程安装cluster软件。
到http://www14.software.ibm.com/webapp/set2/sas/f/hacmp/home.html下载补丁,根据相应的版本选择最新的补丁集(这个步骤非常重要,如果不安装最新的补丁,可能会出现许多不可预知的问题)上传到服务器某个目录中,例如/tmp/HA_patch/
smitty update_all à
Update Installed Software to Latest Level (Update All) Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * INPUT device / directory for software [/tmp/HA_patch] |
输入补丁存放的目录
Update Installed Software to Latest Level (Update All)
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * INPUT device / directory for software /tmp/HA_patch * SOFTWARE to update update_all PREVIEW only? (update operation will NOT occur) no COMMIT software updates? No SAVE replaced files? Yes AUTOMATICALLY install requisite software? Yes EXTEND file systems if space needed? Yes VERIFY install and check file sizes? No DETAILED output? No Process multiple volumes? Yes ACCEPT new license agreements? No PREVIEW new LICENSE agreements? No
|
回车,结果如下,
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
[TOP] geninstall –I “agqwX –J” -Z -d /tmp/HA53_patch –f File 2>&1
File: cluster.adt.es.client.include 6.1.0.5 cluster.adt.es.client.samples.clstat 6.1.0.5 cluster.doc.en_US.es.html 6.1.0.5 cluster.doc.en_US.es.pdf 6.1.0.5 cluster.es.cfs.rte 6.1.0.5 cluster.es.client.lib 6.1.0.5 cluster.es.client.rte 6.1.0.5 cluster.es.client.utils 6.1.0.5 cluster.es.client.wsm 6.1.0.5 cluster.es.cspoc.cmds 6.1.0.5 [MORE 189] |
安装完成后,通过下面的命令检查文件的一致性,如果没有输出,表示没有问题
# lppchk –v # lppchk –c cluster* |
执行shutdown –Fr重新启动操作系统(此步骤很关键)。
4.1主机名称
需要在两台主机上分别完成。
1、smitty hostnameà
Set Hostname Please refer to Help for information concerning hostname / INTERNET address mapping
Type or select values in entry fields. Press Enter AFTER making all desired changes.
*Hostname (symbolic name of your machine) [DB2server] |
输入主机名称,例如DB2server
回车后,结果如下
COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below.inet0 changed Usage: /usr/sbin/osted [HexNumber or InternetAddress or HostName] |
命令行方法:
#chdev –l inet0 –a hostname=’DB2server’ |
2、smitty hostnameà
Set Hostname Please refer to Help for information concerning hostname / INTERNET address mapping Type or select values in entry fields. Press Enter AFTER making all desired changes. *Hostname (symbolic name of your machine) [WASserver] |
输入主机名称,例如WASserver
回车后,结果如下
COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below.inet0 changed Usage: /usr/sbin/osted [HexNumber or InternetAddress or HostName] |
命令行方法:
#chdev –l inet0 –a hostname=’WASserver’ |
之后可以采用hostname命令进行检查。
4.2网络配置
需要在两台主机上分别完成。
分别配置每个节点的两个网卡boot IP地址。之前要确认好需要配置的网卡,如配置ent0的网卡 IP地址,ent4的网卡 IP地址
smitty chinetà
Available Network Interfaces
Move cursor to desired item and press Enter.
En0 00-08 Standard Ethernet Network Interface en1 05-08 Standard Ethernet Network Interface en4 06-08 Standard Ethernet Network Interface en5 00-08 Standard Ethernet Network Interface et0 00-08 IEEE 802.3 Ethernet Network Interface et1 05-08 IEEE 802.3 Ethernet Network Interface et2 06-08 IEEE 802.3 Ethernet Network Interface |
选择相应的网络接口,如en0
Change / Show a Standard Ethernet Interface
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] Network Interface Name en0 INTERNET ADDRESS (dotted decimal) [192.168.1.19] Network MASK (hexadecimal or dotted decimal) [255.255.255.128] Current STATE up Use Address Resolution Protocol (ARP)? Yes BROADCAST ADDRESS (dotted decimal) [] Interface Specific Network Options (‘NULL’ will unset the option) rfc1323 [] tcp_mssdflt [] tcp_nodelay [] tcp_recvspace [] tcp_sendspace [] Apply change to DATABASE only no |
根据规划进行配置。
回车后,结果如下
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
En1 changed |
同样方法配置其他的网络接口如en2的IP地址,配置完成后通过命令ifocnifg –a或者netstat –in查看
#ifconfig –a En0: flags=5e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),PSEG,LARGESEND,CHAIN> inet 196.168.1.19 netmask 0xffffffc0 broadcast 196.168.1.127 tcp_sendspace 131072 tcp_recvspace 65536 en2: flags=5e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),PSEG,LARGESEND,CHAIN> inet 192.168.2.19 netmask 0xffffffc0 broadcast 172.168.1.127 tcp_sendspace 131072 tcp_recvspace 65536 lo0: flags=e08084b<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT> inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255 inet6 ::1/0 tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1 |
命令行方法:
# chdev –l ‘en0’ –a netaddr=’192.168.1.19’ –a netmask=’255.255.255.128’ –a state=’up’ # chdev –l ‘en2’ –a netaddr=’192.168.2.19’ –a netmask=’255.255.255.128’ –a state=’up’ |
采用同样的方法在其它的主机完成配置。
之后可以采用ifconfig –a或者netstat –in命令进行检查。
4.3修改/etc/hosts
需要在两台主机上分别完成。
修改每个节点的/etc/hosts内容包括下面的内容:
127.0.0.1 loopback localhost DB2server # loopback (lo0) name/address # cluster:DB2WAS_cluster 192.168.1.20 DB2serverboot1 192.168.2.20 DB2serverboot2 10.66.228.35 DB2serverper 10.66.228.37 DB2serverservice DB2server
192.168.1.19 WASserverboot1 192.168.2.19 WASserverboot2 10.66.228.36 WASserverper 10.66.228.38 WASserverservice WASserver
|
说明:
如果客户应用环境需要使用主机名称,可以在service IP之后在添加一个主机名称。
如果客户是Oracle RAC环境,还需要进行额外配置,请参考相关的内容。
4.4增强并发VG配置
1、磁盘心跳的VG创建
在DB2server上完成如下工作:
(1)smitty mkvgà
Add an Original Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] VOLUME GROUP name [diskhbvg] Physical partition SIZE in megabytes 512 * PHYSICAL VOLUME names [hidsk2] Activate volume group AUTOMATICALLY no at system restart? Volume Group MAJOR NUMBER [300] Create VG Concurrent Capable? No Auto-varyon in Concurrent Mode? Enhance Concurrent
|
可以用lvgenmajor查看diskhbvg的major号。
# lvgenmajor diskhbvg
300
(2)varyoffvg diskhbvg
Exportvg diskhbvg
然后在WASserver上执行如下命令:
importvg –C –y diskhbvg –V 300 hdisk2
然后切换到DB2server上执行
importvg –C –y diskhbvg –V 300 hdisk2 (将hiskhbvg再次导入到odm库中)
2、磁盘心跳通信测试,方法如下:
将dhb_read命令的路径/usr/sbin/rsct/bin/添加到/etc/enviroment中的PATH后面,然后在两台小机上分别重新login使path 生效
在DB2server上面执行: dhb_read –p hdiskpower0 –r
在WASserver上面执行: dhb_read –p hdiskpower0 –t
如果在两台节点出现如下输入表明磁盘心跳的连接以及配置都是正确的。
DB2server:
DHB CLASSIC MODE
First node byte offset: 61440
Second node byte offset: 62976
Handshaking byte offset: 65024
Test byte offset: 64512
Receive Mode:
Waiting for response . . .
Magic number = 0x87654321
Magic number = 0x87654321
Magic number = 0x87654321
Magic number = 0x87654321
Link operating normally
WASserver:
DHB CLASSIC MODE
First node byte offset: 61440
Second node byte offset: 62976
Handshaking byte offset: 65024
Test byte offset: 64512
Transmit Mode:
Magic number = 0x87654321
Detected remote utility in receive mode. Waiting for response . . .
Magic number = 0x87654321
Magic number = 0x87654321
Link operating normally
4.5应用脚本
需要在两台主机上分别完成。
执行下面的命令创建脚本,具体内容可以后再修改。
# mkdir /hacmp # cd /hacmp # echo “banner start DB2” > /hacmp/DB2serverstart.sh # echo “banner stop DB2” > /hacmp/DB2serverstop.sh # echo “banner start WAS” > /hacmp/WASserverstart.sh # echo “banner stop WAS” > /hacmp/WASserverstop.sh # ls –l total 32 -rw-r–r-- 1 root system 21 Apr 10 05 :27 DB2serverstop.sh -rw-r–r-- 1 root system 22 Apr 10 05 :26 DB2serverstart.sh -rw-r–r-- 1 root system 21 Apr 10 05 :28 WASSERVERstop.sh -rw-r–r-- 1 root system 22 Apr 10 05 :27 WASSERVERstart.sh # chmod 755 *.sh # ls –l total 32 -rwxr-xr-x 1 root system 21 Apr 10 05:27 DB2SERVERstop.sh -rwxr-xr-x 1 root system 22 Apr 10 05:26 DB2SERVERstart.sh -rwxr-xr-x 1 root system 21 Apr 10 05:28 WASSERVERstop.sh -rwxr-xr-x 1 root system 22 Apr 10 05:27 WASSERVERstart.sh |
4.6卷组信息
两个节点的VG信息必须要同步。大概步骤如下:
在DB2server的小机上创建VG, (最好使用smitty mkvg来创建)
Move cursor to desired item and press Enter. Add an Original Volume Group Add a Big Volume Group Add a Scalable Volume Group
|
回车后
Add an Original Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] VOLUME GROUP name [db2vg] Physical partition SIZE in megabytes 512 * PHYSICAL VOLUME names [hidskpower0] Activate volume group AUTOMATICALLY no at system restart? Volume Group MAJOR NUMBER [100] Create VG Concurrent Capable? No Auto-varyon in Concurrent Mode? No |
创建另外一个WASvg
Add an Original Volume Group Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields]
VOLUME GROUP name [wasvg] Physical partition SIZE in megabytes 512 * PHYSICAL VOLUME names [diskpower1] Activate volume group AUTOMATICALLY no at system restart? Volume Group MAJOR NUMBER [200] Create VG Concurrent Capable? No Auto-varyon in Concurrent Mode? No |
然后varyoffvg db2vg和wasvg :varyoffvg db2vg 和 varyoffvg wasvg两条命令。
利用命令行模式创建DB2vg和WASvg。
#mkvg –f –y db2vg –s 512 -n -V 100 hdiskpower0 #mkvg –f –y wasvg –s 512 -n -V 200 hdisk4power1 #varyoffvg db2vg #varyoffvg wasvg |
-f:强制创建VG
-y:指定VG名称
-s: 指定pp大小
-n:不要在启动时active该VG
-V:指定VG的major Number号
-Q:指定PV的Quorum是否开启或关闭,开启-Q后面加y,关闭-Q后面加n
在WASserver上:
#chdev –l hdiskpower0 –a pv=yes #chdev –l hdiskpower1 –a pv=yes #chdev –l hdiskpower2–a pv=yes # #importvg –y db2vg –V 100 hdiskpower0 #importvg –y wasvg –V 200 hdiskpower1
#chvg –a n –Q y db2vg #chvg –a n –Q y wasvg
#varyoffvg db2vg #varyoffvg wasvg |
完成后的信息如下:
DB2server: #lspv hdisk0 00c895d6d5bf4111 rootvg active hdisk1 00c895d6f40eac99 rootvg active hdiskpower0 00c895d66e2df345 db2vg hdiskpower1 00c895d66e4791f7 wasvg hdiskpower2 00c895d66e603f4f diskhbvg |
WASserver: #lspv hdisk0 00c895f6d5f502a4 rootvg active hdisk1 00c895f6f40a0890 rootvg active hdiskpower0 00c895d66e2df345 db2vg hdiskpower1 00c895d66e4791f7 wasvg hdiskpower2 00c895d66e603f4f diskhbvg |
下面的配置在一个主机上完成即可。
5.1配置拓扑
1、配置cluster
smitty hacmp
Extended Configuration
Extended Topology Configuration
Configure an HACMP Cluster
Add/Change/Show an HACMP Cluster
Add/Change/Show an HACMP Cluster Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Cluster Name [DB2WAScluster]
NOTE: HACMP must be RESTARTED on all nodes in order for change to take effect |
输入cluster的名称,如DB2WAS_cluster
回车后,结果如下
COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. Current cluster configuration: Cluster Name: DB2WAS_cluster Cluster Connection Authentication Mode: Standard Cluster Message Authentication Mode: None Cluster Message Encryption: None Use Persistent Labels for Communication: No There are 0 node(s) and 0 network(s) defined No resource groups defined |
2、配置node
smitty hacmp
Extended Configuration
Extended Topology Configuration
Configure an HACMP Nodes
Add a Node to the Hacmp Cluster
Add a Node to the HACMP Cluster Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Node Name [DB2] Communication Path to Node [DB2serverboot1] + |
输入node的名称,并且从列表中选择“Communication Path to Node“,建议选用,
回车后,结果如下
COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. |
同样的方法配置另外的node
Add a Node to the HACMP Cluster
Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Node Name [WAS] Communication Path to Node [WASserverboot1] |
3、自动发现拓扑
smitty hacmp
Extended Configuration
Discover HACMP-related Information form configured Nodes
Extended Configuration Move cursor to desired item and press Enter. Discover HACMP-related Information from Configured Nodes Extended Topology Configuration Extended Resource Configuration Extended Cluster Service Settings Extended Event Configuration Extended Performance Tuning Parameters Configuration Security and Users Configuration Snapshot Configuration Export Definition File for Online Planning Worksheets
Extended Verification and Synchronization HACMP Cluster Test Tool |
回车后,结果如下,
COMMAND STATUS Command: OK stdout: yes stderr: no Before command completion, additional instructions may appear below. [TOP] Discovering IP Network Connectivity Retrieving data from available cluster nodes. This could take a few minutes….
Discovered [8] interfaces IP Network Discovery completed normally Discovering Volume Group Configuration Initializing.. Gathering cluster information, which may take a few minutes… Processing… Storing the following information in file /usr/es/sbin/cluster/etc/config/clvg_config [MORE…65] |
5.2配置网络
1、配置network
smitt hacmp
Extended Configuration
Extended Topology Configuration
Configure HACMP networks
Configure HACMP Networks
Move cursor to desired item and press Enter.
Add a Network to the HACMP Cluster Change / Show a Network in the HACMP Cluster Remove a Network from the HACMP Cluster |
选择“Add a Network to the HACMP cluster“
因为之前已经运行过discover,所以自动发现到了网络的类型。
Select a Network Type
Move cursor to desired item and press Enter.
[TOP] # Discovery last performed: (Apr 10 05:40) # Discovered IP-based Network Types ether
# Discovered Serial Device Types Diskhb
# Pre-defined IP-based Network Types XD_data XD_ip atm [MORE…12] |
选择ether,如果是添加diskhb网络,就选择diskhb
Add an IP-Based Network to the HACMP Cluster
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * Network Name [net_ether_01] * Network Type ether * Netmask [255.255.255.128] * Enable IP Address Takeover via IP Aliases [Yes] IP Address Offset for Heartbeating over IP Aliases [] |
根据网络规划适当调整网络掩码。
回车后,结果如下
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
|
同样的方法添加串口网络
Add an IP-Based Network to the HACMP Cluster
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * Network Name [net_diskhb_0] * Network Type diskhb |
5.3配置通讯接口和设备
1、配置通讯接口
smitt hacmp
Extended Configuration
Extended Topology Configuration
Configure HACMP Communication interface/Devices
Add Communication Interfaces/Devices
Configure HACMP Communication Interfaces/Devices Move cursor to desired item and press Enter. Add Communication Interfaces/Devices Change/Show Communication Interfaces/Devices Remove Communication Interfaces/Devices Update HACMP Communication Interface with Operating System Settings |
选择“Add Communication Interfaces/Devices“
Select a category
Move cursor to desired item and press Enter.
Add Discovered Communication Interface and Devices Add Pre-defined Communication Interfaces and Devices |
选择“Add Discovered Communication Interface and Devices“
因为刚才已经自动发现拓扑,所以会自动找到相应的网络设备。
Select a category
Move cursor to desired item and press Enter.
# Discovery last performed: (Apr 10 05:40) Communication Interfaces Communication Devices |
选择“Communication Interfaces“
Select a Network Name
Move cursor to desired item and press Enter.
ALL net_ether_01 |
选择“net_ether_01 “
Select one or more Discovered Communication Interfaces to Add
Move cursor to desired item and press F7. Use arrow keys to scroll. ONE OR MORE items can be selected. Press Enter AFTER making all selections.
# Network / Node # Interface IP Label IP Address
# net_ether_01 / DB2 > en0 DB2serverboot1 192.168.1.20 > en4 DB2serverboot2 172.168.2.20
# net_ether_01 / WAS > en0 WASserverboot1 192.168.1.19 > en4 WASserverboot2 172.168.2.19 |
选择所有的boot IP
回车后,结果如下
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
|
2、配置通讯设备
同样的方法添加串口
smitt hacmp
Extended Configuration
Extended Topology Configuration
Configure HACMP Communication interface/Devices
Add Communication Interfaces/Devices
Configure HACMP Communication Interfaces/Devices
Move cursor to desired item and press Enter.
Add Communication Interfaces/Devices Change/Show Communication Interfaces/Devices Remove Communication Interfaces/Devices Update HACMP Communication Interface with Operating System Settings |
选择“Add Communication Interfaces/Devices“
Select a category
Move cursor to desired item and press Enter.
Add Discovered Communication Interface and Devices Add Pre-defined Communication Interfaces and Devices |
选择“Add Discovered Communication Interface and Devices“
因为刚才已经自动发现拓扑,所以会自动找到相应的网络设备。
Select a category
Move cursor to desired item and press Enter.
# Discovery last performed: (Apr 10 05:40) Communication Interfaces Communication Devices |
选择“Communication Devices“
Select Point-to-Point Pair of Discovered Communication Device to Add
Move cursor to desired item and press F7. Use arrow keys to scroll. ONE OR MORE items can be selected. Press Enter AFTER making all selections.
# Node Device Pvid > DB2 hdiskpower2 00c895d66e2df345 > WAS hdiskpower2 00c895d66e2df345
|
选择所有的串口
回车后,结果如下
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
|
3、查看通讯接口和设备
Configure HACMP Communication Interfaces/Devices
Move cursor to desired item and press Enter.
Add Communication Interfaces/Devices Change/Show Communication Interfaces/Devices Remove Communication Interfaces/Devices Update HACMP Communication Interface with Operating System Settings |
选择“Change/Show Communication Interfaces/Devices”
Select a Communication Interface/Device to Change/Show
Move cursor to desired item and press Enter. Use arrow keys to scroll.
# Node / Network # Interface/Device IP Label/Device Path IP Address
# DB2 / net_ether_01 En0 DB2serverboot1 192.168.1.20 En2 DB2serverboot2 192.168.2.20
# WAS / net_ether_01 En0 WASserverboot1 192.168.1.19 En2 WASserverboot2 192.168.2.19 # DB2 / net_diskhb_02 Hdiskpower2 DB2_hdisk2_01 /d # WAS / net_diskhb_02 Hdiskpower2 WAS_hdisk2_01 /d
|
5.4配置永久IP
smitt hacmp
Extended Configuration
Extended Topology Configuration
Configure HACMP Persistent Node IP Label/Addresses
Extended Topology Configuration Move cursor to desired item and press Enter. Configure an HACMP Cluster Configure HACMP Nodes Configure HACMP Sites Configure HACMP Networks Configure HACMP Communication Interfaces/Devices Configure HACMP Persistent Node IP Label/Addresses Configure HACMP Global Networks Configure HACMP Network Modules Configure Topology Services and Group Services Show HACMP Topology |
选择“Configure HACMP Persistent Node IP Label/Addresses”
Configure HACMP Persistent Node IP Label/Addresses
Move cursor to desired item and press Enter.
Add a Persistent Node IP Label/Address Change / Show a Persistent Node IP Label/Address Remove a Persistent Node IP Label/Address |
选择“Add a Persistent Node IP Label/Address”
Select a Node
Move cursor to desired item and press Enter.
DB2 WAS |
选择“DB2”
Add a Persistent Node IP Label/Address
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * Node Name DB2 * Network Name [net_ether_01] * Node IP Label/Address [DB2serverper] |
Network Name选择“net_ether_01”
Node IP Label/Address选择“DB2persistent”
回车后,结果如下
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
|
同样的方法配置第二个节点的永久IP
Add a Persistent Node IP Label/Address
Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * Node Name WAS * Network Name [net_ether_01] * Node IP Label/Address [WASserverper] |
5.5配置高可用资源
1、配置服务IP
smitt hacmp
Initialization and Standard Configuration
Configure Resources to Make Highly Available
Configure Resources to Make Highly Available Move cursor to desired item and press Enter. Configure Service IP Labels/Addresses Configure Application Servers Configure Volume Groups, Logical Volumes and Filesystems Configure Concurrent Volume Groups and Logical Volumes |
选择“Configure Service IP Labels/Addresses”
Configure Service IP Labels/Addresses Move cursor to desired item and press Enter. Add a Service IP Label/Address Change/Show a Service IP Label/Address Remove Service IP Label(s)/Address(es) |
选择“Add a Service IP Label/Address”
Add a Service IP Label/Address (standard) Type or select values in entry fields. Press Enter AFTER making all desired changes. [Entry Fields] * IP Label/Address [DB2serverservice] * Network Name [net_ether_01] |
IP Label/Address选择“DB2service”
Network Name 选择“net_ether_01”
回车后,结果如下
COMMAND STATUS
Command: OK stdout: no stderr: no
Before command completion, additional instructions may appear below. |
同样的方法配置另外一个service ip
Add a Service IP Label/Address (standard)
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * IP Label/Address [WASserverservice] * Network Name [net_ether_01] |
2、配置应用脚本
smitt hacmp
Initialization and Standard Configuration
Configure Resources to Make Highly Available
Configure Resources to Make Highly Available
Move cursor to desired item and press Enter.
Configure Service IP Labels/Addresses Configure Application Servers Configure Volume Groups, Logical Volumes and Filesystems Configure Concurrent Volume Groups and Logical Volumes |
选择“Configure Application Servers”
Configure Application Servers
Move cursor to desired item and press Enter.
Add an Application Server Change/Show an Application Server Remove an Application Server |
选择“Add an Application Server”
Add Application Server
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * Server Name [DB2_app] *StartScript [/hacmp/DB2serverstart.sh] *StopScript [/hacmp/DB2serverstop.sh] |
回车后,结果如下
COMMAND STATUS
Command: OK stdout: no stderr: no
Before command completion, additional instructions may appear below. |
同样的方法配置另外一个app srever
Add Application Server
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * Server Name [WAS_app] *StartScript [/hacmp/WASserverstart.sh] *StopScript [/hacmp/WASserverstop.sh] |
5.6配置资源组和属性
1、配置资源组
smitt hacmp
Extended Configuration
Extended Resource Configuration
HACMP Extended Resource Group Configuration
HACMP Extended Resource Group Configuration
Move cursor to desired item and press Enter.
Add a Resource Group Change/Show a Resource Group Change/Show Resources and Attributes for a Resource Group Remove a Resource Group Show All Resources by Node or Resource Group |
选择“Add a Resource Group”
Add a Resource Group (extended)
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * Resource Group Name [DB2_grp] *ParticipatingNodes(Default Node Priority) [DB2 WAS] + Startup Policy Online On Home Node Only Fallover Policy Fallover To Next Priority Node In T> Fallback Policy Fallback To Higher Priority Node In> |
回车后,结果如下
COMMAND STATUS
Command: OK stdout: no stderr: no
Before command completion, additional instructions may appear below. |
同样的方法添加其它resource group
Add a Resource Group (extended)
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * Resource Group Name [WAS_grp] * Participating Nodes (Default Node Priority) [WAS DB2]
Startup Policy Online On Home Node Only Fallover Policy Fallover To Next Priority Node In T> Fallback Policy Fallback To Higher Priority Node In> |
2、修改资源组属性
smitt hacmp
Extended Configuration
Extended Resource Configuration
HACMP Extended Resource Group Configuration
Change/Show Resources and Attributes for a Resource Group
HACMP Extended Resource Group Configuration
Move cursor to desired item and press Enter.
Add a Resource Group Change/Show a Resource Group Change/Show Resources and Attributes for a Resource Group Remove a Resource Group Show All Resources by Node or Resource Group |
选择“Change/Show Resources and Attributes for a Resource Group”
Change/Show Resources and Attributes for a Resource Group
Move cursor to desired item and press Enter.
DB2_grp WAS_grp |
选择“DB2_grp”
Change/Show All Resources and Attributes for a Resource Group
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[TOP] [Entry Fields] Resource Group Name DB2_grp Participating Nodes (Default Node Priority) DB2 WAS
Startup Policy Online On Home Node Only Fallover Policy Fallover To Next Priority Node In T> Fallback Policy Fallback To Higher Priority Node In> Fallback Timer Policy (empty is immediate) []
Service IP Labels/Addresses [DB2service] Application Servers [DB2_app]
Volume Groups [DB2vg] Use forced varyon of volume groups, if necessary false Automatically Import Volume Groups false Filesystems (empty is ALL for VGs specified) [] Filesystems Consistency Check fsck Filesystems Recovery Method sequential Filesystems mounted before IP configured false Filesystems/Directories to Export []
Filesystems/Directories to NFS Mount [] Network For NFS Mount []
Tape Resources [] Raw Disk PVIDs [] Fast Connect Services [] Communication Links []
Primary Workload Manager Class [] Secondary Workload Manager Class []
Miscellaneous Data [] |
如果有NFS资源,建议同样修改“Filesystems mounted before IP configured” 为true
COMMAND STATUS
Command: OK stdout: no stderr: no
Before command completion, additional instructions may appear below. |
相同方法配置其它的资源组
Change/Show All Resources and Attributes for a Resource Group
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[TOP] [Entry Fields] Resource Group Name DB2_grp Participating Nodes (Default Node Priority) DB2 WAS
Startup Policy Online On Home Node Only Fallover Policy Fallover To Next Priority Node In T> Fallback Policy Fallback To Higher Priority Node In> Fallback Timer Policy (empty is immediate) []
Service IP Labels/Addresses [WASservice] Application Servers [WAS_app]
Volume Groups [WASvg] Use forced varyon of volume groups, if necessary false Automatically Import Volume Groups false Filesystems (empty is ALL for VGs specified) [] Filesystems Consistency Check fsck Filesystems Recovery Method sequential Filesystems mounted before IP configured false Filesystems/Directories to Export []
Filesystems/Directories to NFS Mount [] Network For NFS Mount []
Tape Resources [] Raw Disk PVIDs [] Fast Connect Services [] Communication Links []
Primary Workload Manager Class [] Secondary Workload Manager Class []
Miscellaneous Data [] |
5.7核实与同步cluster
smitt hacmp
Extended Configuration
Extended Verification and Synchronization
Extended Configuration
Move cursor to desired item and press Enter.
Discover HACMP-related Information from Configured Nodes Extended Topology Configuration Extended Resource Configuration Extended Cluster Service Settings Extended Event Configuration Extended Performance Tuning Parameters Configuration Security and Users Configuration Snapshot Configuration Export Definition File for Online Planning Worksheets
Extended Verification and Synchronization HACMP Cluster Test Tool |
选择“Extended Verification and Synchronization”
HACMP Verification and Synchronization
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * Verify, Synchronize or Both [Both] * Automatically correct errors found during [Yes] verification?
* Force synchronization if verification fails? [No] * Verify changes only? [No] * Logging [Standard] |
回车后,结果如下
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
[TOP]
Verification to be performed on the following: Cluster Topology Cluster Resources
Verification will automatically correct verification errors.
Retrieving data from available cluster nodes. This could take a few minutes….
Verifying Cluster Topology… [MORE…74] |
5.8添加默认路由
由于默认路由与service IP/persist IP在相同网络掩码中,在cluster没有同步之前,无法进行配置默认路由。
同步cluster之后,永久IP会随机绑定到一个网络接口上,此时就可以配置默认路由。如下:
# ifconfig –a En0: flags=5e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),PSEG,LARGESEND,CHAIN> inet 192.168.1.19 netmask 0xffffffc0 broadcast 192.168.1.127 inet 10.66.228.36 netmask 0xffffffc0 broadcast 10.66.128.127 tcp_sendspace 131072 tcp_recvspace 65536 en2: flags=5e080863,c0<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,CHECKSUM_OFFLOAD(ACTIVE),PSEG,LARGESEND,CHAIN> inet 192.168.2.19 netmask 0xffffffc0 broadcast 192.168.2.127 tcp_sendspace 131072 tcp_recvspace 65536 lo0: flags=e08084b<UP,BROADCAST,LOOPBACK,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT> inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255 inet6 ::1/0 tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1 |
smitty mkroute
Add Static Route
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] Destination TYPE net * DESTINATION Address [0] (dotted decimal or symbolic name) * Default GATEWAY Address [10.66.228.1] (dotted decimal or symbolic name) COST [0] Network MASK (hexadecimal or dotted decimal) [255.255.255.128] Network Interface [] (interface to associate route with) Enable Active Dead Gateway Detection? No Is this a Local (Interface) Route? No Policy (for Multipath Routing Only) Default (Global) Weight (for Weighted Multipath Routing Policy) [1] Apply change to DATABASE only no |
DESTINATION Address输入0代表default
另外输入网关IP和子网掩码
回车后,结果如下
COMMAND STATUS
Command: OK stdout: yes stderr: no
Before command completion, additional instructions may appear below.
Inet0 changed |
可以通过ifconfig 和netstat –rn查看。
5.9特殊考虑
Oracle RAC
如果客户使用oralce RAC产品,请进行下面的特殊配置。
因为RAC需要在两个节点之间进行数据传输,所以需要单独建立一个Oracle RAC的互联私网。可以在两个节点间的网卡间直连一根网线,不通过交换机。
例如, 两个节点都用en1作Oracle RAC的互联私网接口,配置步骤如下:
分别在两个节点上配置相应网卡的IP地址。
下面的信息加入到/etc/hosts:
#oracle pribate network only for Oracle RAC 172.169.1.1 DB2serveroracle 172.169.1.2 WASserveroracle |
新建一个网络,参考4.1.4添加一个网络到cluster
将两个communication interface 加入到这个网络,参考4.1.5配置通讯接口
将网络的属性从public 修改成private。如下
Configure HACMP Networks
Move cursor to desired item and press Enter.
Add a Network to the HACMP Cluster Change / Show a Network in the HACMP Cluster Remove a Network from the HACMP Cluster |
选择“Change / Show a Network in the HACMP Cluster”
Select a Network Name to Change/Show
Move cursor to desired item and press Enter.
Net_ether_01(192.168.1.0/25 192.168.2.0/25) net_ether_02(172.169.1.0/25) |
选择刚刚添加的网络“net_ether_02(172.169.1.0/24) ”
Change/Show an IP-Based Network in the HACMP Cluster
Type or select values in entry fields. Press Enter AFTER making all desired changes.
[Entry Fields] * Network Name [net_ether_02] * Network Type ether * Netmask [255.255.255.128] * Enable IP Address Takeover via IP Aliases [Yes] IP Address Offset for Heartbeating over IP Aliases [] * Network attribute private |
注意Network attribute=private.
另外,RAC还需要创建一个concurrent resource group.其中包括enhanced concurrent VG和application server.
系统参数调整
为了cluster更加稳定,建议调整下面的系统参数,
chdev –l sys0 –a maxuproc=4096 (修改每个用户的最大进程数量)
chdev –l sys0 –a minpout=24 –a maxpout=33
/usr/es/sbin/cluster/utilities/clchsyncd ‘10’ (ps –ef|grep syncd 查看)
两个节点的时间,要尽量保持一致,否则使用命令date进行修改,或者使用时间服务器。
1、启动HA之前
分别两个节点上运行指令#netstat –in,检查IP address,确认网卡都使用boot IP adress,没有service IP存在。
分别两个节点上运行指令#lsvg –o,检查varyon 的VG,确认共享VG为varyoff状态。
确认无其他节点正在启动HACMP。
在DB2server主机上执行# smitty clstart ,然后不修改任何参数,按回车执行。当返回OK后,ESC+0或者F10退出。
在DB2server主机上执行# tail –f /tmp/hacmp.out,查看HACMP启动状态,当此文件不再变化时,说明cluster启动完毕。
在DB2server主机上执行#netstat –in 查看当前网卡IP Lable和IP 地址,有service IP地址存在。
在DB2server主机上执行#lsvg –o检查varyon 的VG,确认共享VG为varyon状态。
此时,HACMP系统已正常工作,如果在资源组中有application server,则会将数据库及相关应用自动启动。
之后可以采用上面相同的方法启动WASserver主机。
在DB2server主机上执行# smitty clstop ,然后不修改任何参数,按回车执行。当返回OK后,ESC+0或者F10退出。
在DB2server主机上执行# tail –f /tmp/hacmp.out,查看HACMP启动状态,当此文件不再变化时,说明cluster停止完毕。
在DB2server主机上执行#netstat –in 查看当前网卡IP Lable和IP 地址,没有service IP地址存在。
在DB2server主机上执行#lsvg –o检查varyon 的VG,确认共享VG为varyoff状态。
此时,HACMP系统已停止工作,如果在资源组中有application server,则会将数据库及相关应用自动停止。
之后可以采用上面相同的方法停止WASserver主机。
如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!
赞2
添加新评论2 条评论
2013-08-22 12:36
2013-07-17 12:43