1。装OS 2。定义/.profiles和tcpip (并编辑/etc/hosts,加/.rhosts文件) 3。定义tty芯跳线 (1) 终端线与各自主机终端的S1口相连 (2) 两主机间S3口互连(S3口为标准芯跳口) (3) 装完OS后,两主机应已自定义了各自的S1口,用lsdev -Cc tty可见输出如下: tty0 Available 01-S1-00-00 Asynchronous Termind (其中可见S1表示此tty与 S1口相连) (4) 现定义芯跳口与S3口 smit->tty->add a tty->rs232->Sa2 Available 01-S3 standard I/O serial port->定义port number=0 (5) 在两主机上都定义完S3芯跳口后,用stty证实该两个芯跳口之间能否正常通信 > 在A机上输入命令stty> 再在B机上输入命令stty>/dev/tty1,回车后A机输出同一信息 > 在B机上输入命令stty> 再在A机上输入命令stty>/dev/tty1,回车后B机输出同一信息 4。做raid (只在主机上进行) (1) 定义所有物理盘属性 smit dev->SSA raid arrays->change/show use of an SSA physical Disk-> ssa0->选物理盘->定义属性(Array candidate disk/Hot spare disk/Aix system disk) (2) 进行raid smit dev->SSA raid arrays->add an ssa raid array->ssa0->raid5-> 定义Member disk与Enable hot spare (3) 查看raid完成状态 smit dev->SSA raid arrays->list status of all defined SSA raid arrays 5。建立卷组并使两机能共享该资源 * lsdev -Cc pdisk 查看物理盘 * lsdev -Cc disk 查看逻辑盘 * lspv 查看 * lsvg 查看所有卷组 * lsvg -o 查看活动卷组 (1) raid完成后在两机上用lsdev -Cc disk看逻辑盘,若不一致,则用rmdev -dl hdisk* (*<>0) 删去除hdisk0外的所有逻辑盘,再用cfgmgr重认设备,则两机将正确识别OS盘 hdisk0和raid逻辑盘hdisk*,此外,还要用命令lspv在两机上均输出逻辑盘的信 息,其中hdisk0卷组名为rootvg,而hdisk*卷组名为none,若hdisk*有原来旧系 统使用过的卷组名,可用varyonvg hdisk*命令激活卷组后再进入smit vg-> remove a volumn group中删去该卷组并再cfgmgr则可正常。 (2) 在主机上smit vg->add a volumn group,定义其中各项参数如下: > Volume group name [raidgroup1] #卷组名 > Physical partition SIZE in megabytes [32] #该卷组物理分区大小 > PHYSICAL volume names [hdisk1] #该卷组物理卷名 > Activate volume group AUTOMATICALLY [no] #重启后是否自动将该 卷组变为活动的,因应用需求为以HA来激活并使用该卷组,故此处系统在启动后 不自动激活该卷组而由HA来激活并使用之。 (3) 完成后,主机上执行lsdev -Cc pdisk与lsdev -Cc disk的输出仍未变,而lspv 的输出中各hdisk*均已带上新定义的卷组名,此时再使用lsvg和lsvg -o两命令, 前者显示系统中所有vg,后者显示了系统中所有被激活的vg,此时两者的输出相同 (因所有卷组名均是激活的),但现用varyoffvg raidgroup1命令后,因raidgroup1 卷组变为非激活的了,故lsvg与lsvg -o的输出不同了,此时再到从机上smit vg-> import a volume group并确定如下参数,则在主机上varyoffvg的卷组raidgroup1 现在在从机上被varyonvg了,表现在lsvg输出除rootvg外还有raidgroup1及lspv 中的hdisk1卷组名由none变成了raidgroup1 > Volume group name [raidgroup1] > PHYSICAL volume name [hdisk1] 6。做HA (1) 在主从机上装OS补丁: bos.data, bos.adt.syscalls, bos.net.tcp.server, bos.adt.libm, sysmgt.websm,x11.dt.tooltalk, x11.dt.lib, x11.base.rte, x11.vsm.rte (2) 在主从机上装HA软件(含HAview的子集不要装) (3) 主机上定义群集拓扑 > 配置群集 smit hacmp->cluster configuration->cluster topology->configure cluster->add a cluster definition->确定cluster ID与cluster name > 配置节点 smit hacmp->cluster configuration->cluster topology->configure nodes->add a cluster nodes->两次确定/etc/hosts中定义的两node名 > 配适配器 smit hacmp->cluster configuration->cluster topology->configure adapters->在主机上分别进行如下8次adapter的定义,完成后重启两机 注意: 重启机器前要编辑/etc/hosts文件,注意其中地址对应的名称要和lable 名大小写一致。 Adapter ip lable syb01_ip h701_boot h701_stdby h701_tty Network type ehter ether ether rs232 Network name ehternet ehternet ehternet rs232net Network attribute public public public serial Adapter function service boot standby service Adapter identifier 162.105.161.12 162.105.161.13 168.100.100.4 /dev/tty1 Adapter hardware address 000629acaaaa Node name node_h701 node_h701 node_h701 node_h701
Adapter ip lable syb02_ip h702_boot h702_stdby h702_tty Network type ehter ether ether rs232 Network name ehternet ehternet ehternet rs232net Network attribute public public public serial Adapter function service boot standby service Adapter identifier 162.105.161.14 162.105.161.15 168.100.100.5 /dev/tty1 Adapter hardware address 000629accccc Node name node_h702 node_h702 node_h702 node_h702 (4) 同步群集资源 smit hacmp->cluster configuration->cluster topology->synchronize cluster topology 遇到错误:connect to remote host refused.原因是/.rhost文件中的+后多了一个 空格符,保证该文件中仅有一个+字符即可解决。 (5) 校验群集资源 smit hacmp->cluster configuration->cluster verification->verify cluster 7。装sybase (1) smit vg->set characteristics of a volume group->change a volume group-> raidgroup1->改Activate volumn group AUTOMATICATTY at system restart为 no->raidgroup2作相同修改(主从机都修改) (2) 在从机上varyoffvg hdisk*,在主机上varyonvg hdisk* (3) 在从机上建sybase逻辑卷 smit->system storage management->logical volume manager->logical volume ->add alogical volume->确定volume group name为rootvg->再确定如下参数 > Logical volume name [lv_sybase] > Volume group name [rootvg] > Number of logical partitions [40] > PHYSICAL volume names [hdisk0] (4) 在从机上将逻辑卷做成文件系统 smit->system storage management->file systems->add/change/show/delete file systems->journaled file systems->add a journaled file system on a previously defined logical volume->add a standard journaled file system ->确定如下参数 > Logical volume name [lv_sybase] > Mount point [/sybase] > Mount AUTOMATICALLY at system restart [yes] (5) 在从机上mount文件系统 smit->system storage management->file systems->mount a file system->确 定如下参数 > File system name [/dev/lv_sybase] > Directory over which to mount [/sybase] (6) 在从机上建用户sybase,其home directory为[/sybase],并编辑其.profile如下, 再将/dev/*lv*改为sybase所有。 PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/sybase.bin: /sybase/install:/sybase:/usr/bin/x11:/sbin:. export PATH TERM=ibm3151 export TERM DSQUERY=SYBASE export DSQUERY SYBASE=/sybase export SYBASE LIBPATH=/sybase/lib export LIBPATH (7) 拷sybase文件到从机 smit->system storage management->file systems->mount a file system-> 确定如下参数 > File system name [/dev/cd0] > Directory over which to mount [/mnt] > Type of file system [cdfs] > Mount as a removable file system [yes] > Mount as a READ-ONLY system [yes] 安装光盘后改/sybase目录为sybase所有,再以sybase用户执行/mnt/sybload -D 命令如下,之后建start_sybase与stop_sybase,注意此两文件应被赋予执行权限。 Current directory is "/sybase": Is this the correct directory for installation? If so,please enter 'y' or 'Y':y Is this a local or remote installation,as defined in your installtion Guide? Please enter L for or R for remote. >L Please enter the full name of the disk file of the global archive: >/mnt/sybimage You specified /mnt/sybimage for the media device. Is this correct? Please enter 'y' or 'Y' to continue:Y Please enter your customer authorization string.letters only >JLBKBKBKGKCMBYBKBFGZBYBKBKBKQPQDRX (/mnt/install/cas) Terminate your entries with a blank line:选择产品1,2 >Adaptive server enterprise,RS6000,11.9.2 >Monitor server for 11.9.2 ASE,RS6000,11.9.2 >回车 The following products were chosen for installation: Choice NO.1:Adaptive server enterprise,RS6000,11.9.2 Choice NO.2:Monitor server for 11.9.2 ASE,RS6000,11.9.2 If this list is correct as shown, Please enter 'y' or 'Y' to continue, Please enter 'q' or 'Q' to quit, Or any other character to make another set to choices:y 即开始拷贝sybase系统文件。 编辑/sybase/start_sybase的内容如下:
编辑/sybase/stop_sybase的内容如下:
( 在主机上重复(2)-(7)步 (9) 在主机上为raidgroup1建数据库设备 smit mklv->raidgroup1->确定如下参数 > Logical volume name: [lv_master] > Number of logical partitions: [3] #raidgroup1卷组每个物理分区32M (见5-(2)),3个分区共96M > Physical volume names: [hdisk1] 如上再进行4次设置,Logical volume name分别为lv_sybproc,lv_tempdb, lv_data1,lv_log1,Number of logical partitions分别为3(96M),20(640M), 330(10560M),64(2048M),Physical volume names均为hdisk1.完成后改 /dev/*lv*为sybase所有。 (10) 将主机上生成的sybase设备import到从机 在主机上varyoffvg raidgroup1后,再到从机上smit exportvg并确定参数raidgroup1, (此时从机不先varyonvg raidgroup1),之后在从机上lsvg可见raidgroup1消 失,再在从机上用smit importvg并确定volume group name为raidgroup1, 完成后改从机上/dev/*lv*为sybase所有,并在从机上varyoffvg raidgroup1 及在主机上varyonvg raidgroup1. 另述:在某机上smit exportvg某vg是将该vg去掉,importvg是装入某vg (注意此时被装入的vg在目标机上须被varyoffvg). (11) 在主机上编辑三个sybase文件 > su - sybase > cd /sybase/init/sample_resoure_files > mkdir /sybase/yijian > cp *.rs /sybase/yijian > cd /sybase/yijian > mv srvbuild.adaptive_server.rs syb.rs > mv srvbuild.backup_server.rs syback.rs > 修改syb.rs如下
sybinit.release_directory:/sybase sybinit.product:sqlsrv sqlsrv.server_name:SYBASE sqlsrv.new_config:yes sqlsrv.do_add_server:yes sqlsrv.network_protocol_list:tcp sqlsrv.network_hostname_list:YYSD_H701 sqlsrv.network_port_list:6000 sqlsrv.master_device_physical_name:/dev/rlv_master sqlsrv.master_device_size:90 sqlsrv.master_database_size:60 sqlsrv.errorlog:USE_DEFAULT sqlsrv.do_upgrade:no sqlsrv.sybsystemprocs_device_physical_name:/dev/rlv_sybproc sqlsrv.sybsystemprocs_device_size:90 sqlsrv.sybsystemprocs_database_size:80 sqlsrv.default_backup_server:SYB_BACKUP > 修改syback.rs如下 sybinit.release_directory:/sybase sybinit.product:bsrv bsrv.server_name:SYB_BACKUP bsrv.do_add_backup_server:yes bsrv.network_protocol_list:tcp bsrv.network_hostname_list:YYSD_H701 bsrv.network_prot_list:6002 bsrv.language:USE_DEFAULT bsrv.character_set:cp850 bsrv.errorlog:USE_DEFAULT > 修改sqlloc.rs如下 sybinit.release_directory:/sybase sqlsrv.server_name:SYBASE sqlsrv.sa_login:sa sqlsrv.sa_password: sqlsrv.default_language:us_english sqlsrv.default_install_list:USE_DEFAULT sqlsrv.default_characterset:cp850 sqlsrv.characterset_install_list:USE_DEFAULT sqlsrv.characterset_remove_list:USE_DEFAULT sqlsrv.sort_order:binary 三个文件改完后以sybase用户登录并执行指令以建立数据库: $srvbuildres -r syb.rs $srvbuildres -r syback.rs $sqllocres -r sqlloc.rs $chown sybase /dev/*lv* $chown -R sybase /sybase 完成后启动sybase证实成功,注意权限统一,且RUN*应有执行权。 (12) 从主机拷三组文件(/sybase/SYBASE.cfg,/sybase/interfaces,/sybase/ install/RUN*)到从机,其中interfaces要改主机名,完成后在主机上 varyoffvg raidgroup1并在从机上先smit exportvg,再smit importvg并 varyonvg该卷组,完成后在从机上执行chown -R sybase /sybase及 chown sybase /dev/*lv*,并启动sybase证实成功。 (13) 在主机上varyoffvg raidgroup1,在从机上export raidgroup1后再执行smit importvg,再引入raidgroup1,完成后在从机上varyonvg raidgroup1,并在从 机上启动sybase证实成功。 8。在主机上设置HA应用服务 (1) 设置HA资源组 smit hacmp->cluster configuration->cluster resources->define resource groups->add a resource group->确定如下参数 > Resource group name [resourcegroup1] > Participting node names [node_h701 node_h702] (2) 定义应用服务 smit hacmp->cluster configuration->cluster resources-> define application servers->add an application server->确定如下参数 > server name [sybase_app] > start script [/sybase/start_sybase] > stop_script [/sybase/stop_sybase] (3) 修改资源组中资源 smit hacmp->cluster configuration->cluster resources->change/show resources for a resource group->确定如下参数 > service IP libel [syb01_ip] > volume group [raidgroup1] > application servers [sybase_app] > inactive takeover activated [true] (4) HA资源同步 同步前先将raidgroup1 varyonvg到主机上,并将两机interfaces文件中的主机 名改为服务地址IP(syb01_ip),同步完成后重启系统。 smit hacmp->cluster configuration->cluster resources->synchronize cluster resources (5) 分别启动主从机的Hacmp服务,再进行主从机切换试验。 9。sybase补丁 (1) 安装补丁光盘,执行cp /mnt/ebf8943.tar /sybase/ebf.tar命令,再用sybase 身份在sybase停掉的情况下执行tar xvf /sybase/ebf.tar命令。 (2) 启动HA与sybase,以sybase身份在sybase启动情况下执行如下语句 > isql -Usa -P -n -i /sybase/scripts/installmaster -o installmaster.txt > isql -Usa -P -n -i /sybase/scripts/installdbccdb -o installdbccdb.txt > isql -Usa -P -n -i /sybase/scripts/instmsgs.ebf -o instmsgs.txt --------------------- 补充:在从机上也安装应用,使集群双机运行两个应用,并互为双机。 1。在从机上建sybase用户,编辑其.profile文件,在rootvg上建sybase逻辑卷 并做成文件系统后mount。 2. 从光盘上拷sybase安装文件,建立SYBASE各系统卷如data,tempdb,log等,再 import该卷组到主机,再用srvbuildres -r ...命令建库建立sybase server. 3。在数据库中执行sp_addserver SYB_BACKUP,null,SYB_JT_BACKUP 4。将停库脚本改为isql -Usa -P -SSYBASE_JT >shutdown SYB_BACKUP <-------------- >shutdown with nowait 5。在主从机上设置HA应用服务后同步
| | |