1 系統需求 1.1 硬件需求 l 主機 2—4台服務器 l CD-ROM l 共享磁盤陣列 l Ethernet網絡卡 每台服務器至少2片網絡卡,用於公網(public net)、心跳線(private net)建議使用具有故障恢復和MAC地址切換能力的Intel 網卡。 l SCSI適配器 兼容硬件產品 l RS232聯接線 Null-modem serial cables l 硬盤空間 /usr文件系統至少有10Mb以上空閒空間 l 內存 64Mb以上 1.2 軟件需求 l Reliant HA 安裝軟件(License 數同節點數) l UNIXWare7操作系統(License 數同節點數) l C++ UDK (至少一套)
2 安裝ReliantHA 2.1 硬件安裝 l 系統硬件安裝。 l RS232串口線安裝、聯接。 l 將兩台服務器的網卡心跳線直連,公網線接到交換設備
2.2 軟件安裝 2.2.1 UNIXWare7系統安裝 l 在集群中的每個節點安裝完成UNIXWare7操作系統 l 安裝配置共網(public net)網卡,並確認網絡通 l 在共享盤櫃劃分數據庫空間和應用程序存放的文件系統 l 將數據庫和應用程序裝入共享盤櫃,並分別在兩服務器加同樣用戶 l 輸入ReliantHA License,使用scoadmin->License Manager 2.2.2 ReliantHA的安裝(在兩台服務器分別安裝) 1. 用root用戶登入 2. 將UDK開發包的光盤,放入第一台服務器的CD-ROM中 3. #pkgadd –d cdrom1 –q udk 4. 將帶有ReliantHA的光盤(UW7 3of3),放入CD-ROM中 5. 輸入以下命令開始安裝 #pkgadd –d cdrom1 –q ReliantHA 6. 系統顯示: The following sets are available: 1 NSlive1 Netscape LiveWire 1.01 for SCO UnixWare 7 (i386) 1.01 2 NSproxy25 Netscape Proxy Server 2.5 for SCO UnixWare 7 (i386) 2.5 3 ReliantHA ReliantHA Host Monitoring Software (IA32) 1.1.0 4 TTA Tarantella for SCO UnixWare 7 (i386) 1.0 5 afps SCO Advanced File and Print Server (i386) 4.0.1 6 arcserve Data Management Services (IA32) 7 Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,quit]: 3 選擇3,安裝ReliantHA產品 7. 接下來,系統開始安裝: 提示下列信息 What is the size of the cluster? Enter number of nodes[ 2..4 / quit]? 如果HA環境下只有兩台服務器,則選擇2 What is the private network IP address number of SYSA [ 192.168.0.1 ] 回車 What is the private network IP address number of SYSB [ 192.168.0.2 ] 回車 SYSA's IP address is: 192.168.0.1 SYSB's IP address is: 192.168.0.2 Is this correct? [y/n/quit]? 選擇y What is this system [SYSA / SYSB / SYSC / SYSD or quit]?:在test1輸入SYSA,test2輸入SYSB,以區分雙機身份 What is the private network device name [e.g. /dev/msw_0]?:回車 軟件安裝完成後,顯示下列信息 ## Executing set postinstall script. Processing of packages for set <ReliantHA> is completed. 8. 安裝完成。 9. 將ReliantHA升級包(可從SCO網站下載)COPY在/ home目錄下,mv改名為rha112,執行#pkgadd –d /home/rha112升級ReliantHA版本 2.2.3 配置private network l 使用netcfg命令,配置心跳線網卡-〉ReliantHA private network l 重新啟動服務器 2.2.4 配置MAC Switch Driver (MSW) l MSW的配置,使用mkmswtab命令 #/sbin/mkmswtab -i /dev/msw_0 /dev/net1 /dev/term/00t /dev/net1為心跳線網卡,/dev/term/00t為IP心跳線 l 執行mkmswtab後系統將生成/etc/mswtab ,/etc/sdltab文件 #cat /etc/mswtab #MSW tab - control file for msw device driver #This file automatically generated by mkmswtab /dev/msw_0 1 00:AA:00:BD:6F:AA /dev/net1 0 0 /dev/sdl_0 0 1
#cat /etc/sdltab #SDL tab - control file for sdl device driver #This file automatically generated by sdltab /dev/sdl_0 /dev/term/00t
l 重新啟動主機。 2.2.5 測試MSW的安裝 l 使用mswconfig命令檢測兩條私網狀態,應該都為ONLINE #mswconfig -l Listing MAC Switch interface /dev/msw_0 MAC Address 00:AA:00:BD:6F:AA, 1 Interface, Status ONLINE Heartbeat ENABLED, Interval 560 msec, Misses 6 Interface 0: /dev/net1 unit 0 ONLINE, max peers 3, current peers 1 Peer MACs: 00:AA:00:A8:07:0D - ONLINE Bound SAP info: muxid 0x15, SAP 0xf00d, dlpistate 0x3, Heartbeat muxid 0x14, SAP 0x0000, dlpistate 0x0 muxid 0x13, SAP 0x0000, dlpistate 0x0 muxid 0x12, SAP 0x0000, dlpistate 0x0
Interface 2: /dev/sdl_0 unit 0 (SLOW) ONLINE, max peers 1, current peers 1 Peer MACs: 00:AA:00:A8:07:0D - ONLINE Bound SAP info: muxid 0x15, SAP 0xf00d, dlpistate 0x3, Heartbeat muxid 0x14, SAP 0x0000, dlpistate 0x0 muxid 0x13, SAP 0x0000, dlpistate 0x0 muxid 0x12, SAP 0x0000, dlpistate 0x0
2.2.6 設置HA集群組 l 在兩台服務器上執行下面命令,配置信任關系 echo "+" >> /etc/hosts.equiv echo "+" >> /.rhosts l 在任意一台主機運行(只執行一次) #/sbin/mkcluster -i /dev/msw_0 test1 test2 test1、test2為各節點的hostname l 驗證/etc/clustertab #cat /etc/clustertab The following example from the /etc/clustertab file shows a four-node cluster using the MAC switch driver: #NodeID NodeName Device Physical Address 1 test1 /dev/msw_0 00:AA:00:A5:7F:61 2 test2 /dev/msw_0 00:AA:00:A5:1E:9C l 重新啟動主機 l 檢驗LLT的安裝 #lltstat –a
2.2.8 配置舉例 l IP別名 編輯/usr/opt/reliant/etc/hvipalias test 01:AA:00:3F:19:DB /dev/net0 net0 168.33.114.100 255.255.0.0 check1 check2 field 1: 虛擬主機名 field 2: 可切換的MAC地址 field 3: 網卡設備名 field 4: 網卡接口名 field 5: 虛擬IP地址 field 6: 子網掩碼 field 7: 用於網絡檢測的主機IP,可設置為路由器 field 8: 第二個用於網絡檢測的主機IP
用於網絡檢測的主機名和IP地址要加入/etc/hosts文件!! l 將SCO提供的配置文件sybase.hl保存在/usr/opt/reliant/build目錄下 內容為: #include "defines.hl"
Cluster { { SYSA,SYSB } // nodes { } // cluster attributes Application // under control of Reliant { App1 { SYSA,SYSB } // priority { AutoStartUp AutoSwitchOver } // application attributes Process(/home/syb) { Pdisk(/dev/dsk/c1b0t13d3s0)此處修改為實際用於安裝應用的硬盤名 PMOUNT(/home/sybase,vxfs,/dev/dsk/c2b0t0d3s2) 此處修改為安裝sybase和MBFE應用的文件系統 PMOUNT(/home/MBFE,vxfs,/dev/dsk/c2b0t0d3s3) Ip ( test )此處修改為hvipalias中虛擬主機名 { Nw(Nw_01, 01:AA:00:3F:19:DB)修改為與hvipalias中相同 } } } }
l 編譯sybase.hl 在安裝過UDK的第一台服務器上執行 #hvgen sybase 編譯生成/usr/opt/reliant/conf/sybase文件 l 將SCO提供的startdb,stopdb,syb復制到兩台服務器的/home目錄下,並賦執行權 l 編輯/usr/opt/reliant/bin/Process_Online,在第一行加入’/home/startdb&’ l 編輯/usr/opt/reliant/bin/Process_Offline,在第一行加入’/home/stopdb&’ l 將/usr/opt/reliant/conf/sybase文件復制到SYSB中 #rcp /usr/opt/reliant/conf/sybase SYSB:/usr/opt/reliant/conf/.
2.2.9 啟動Reliant l #hvstart sybase l #hvdisp –a 觀察狀態 l 啟動/home下的應用監控程序 #/home/monitor l #hvshut –a將停止兩台服務器上的雙機軟件,#hvshut –l則只關閉本機的雙機軟件。