1、1POWERHA 常用心跳网络特点和配置最近系统的复习了一下 PowerHA,做了一些相关的试验,今天时间充裕,在博客里把有关于心跳方面的知识总结一下。谈到 PowerHA,不得不谈心跳。记得拜读 IBM 官方网站上浅谈 HACMP 心跳 一文中,作者王荣说了一句颇幽默的话:“我们可以看出使用 HACMP 集群,可谓玩的就是心跳。”的确如此,在个人的学习和实施的过程中,发现心跳的确是要玩的,而且要玩好。一、心跳作用及分类PowerHA 通过以下三种手段,来监控节点是否运行正常:1、RSCT 监控网络接口和设备。.2、AIX LVM 监控硬盘、逻辑卷、卷组状态。3、PowerHA 应用监控应用状
2、态。PowerHA 使用心跳 keep alive (KA)包来监控网络接口、通信设备、和 ip 地址标签有效性。在 PowerHA 中用基于 IP 网络和 non-IP 网络来交换心跳包。其中基于 IP 网络包括:Ethernet (ether)、Token-ring (token)、Fiber Distributed Data Interface - FDDI (fddi)、 Asynchronous Transfer Mode- ATM and ATM LAN Emulation) (atm)、 EtherChannel (ether)、 IP Version 6 (IPV6)、Infi
3、niBand,其中 enther 网络心跳比较常用。基于设备的主要包括:目标模式 SCSI (tmscsi) 、目标模式 SSA (tmssa) 、磁盘心跳信号 (diskhb)、串行 RS232 。磁盘心跳信号 (diskhb)和串行 RS232 在实际环境中用到比较多(个人根据实施经验判断,不一定准确)。二、常用心跳网络配置1、 RS232 串口心跳配置硬件配置建议配置专门用作心跳网络的异步卡。异步卡及串口线的选择配置可以参考: PowerHA 中异步卡和串口线的选择。配置方法:添加 tty 设备:smitty device 中找到 tty.测试 tty 通信是否正常:在连接串口线后,在一
4、台设备上输入:cat /etc/hosts/dev/tty0 另外一台输入:catdbsvr1dbsvr2Create a Concurrent Volume GroupType or select values in entry fields.Press Enter AFTER making all desired changes.TOP Entry FieldsNode Names dbsvr1,dbsvr2PVID 0003714b1331a3edVOLUME GROUP name heartvgPhysicalpartitionSIZE in megabytes 4 +Volume g
5、roup MAJOR NUMBER 56 +#Enhanced Concurrent Mode true +Enable Cross-Site LVM Mirroring Verification false +Warning:Changing the volume group major number may resultin the command being unable to executesuccessfully on a node that does not have themajor number currently available. Please checkMORE.3F1
6、=Help F2=Refresh F3=Cancel F4=ListEsc+5=Reset Esc+6=Command Esc+7=Edit Esc+8=Imagedbsvr1#lspvhdisk0 0003714ba5048a99 rootvg activehdisk1 0003714bd3cf768a rootvg activehdisk2 0003714b7d935335 datavg 4activehdisk3 0003714b27d6164f datavg_1 activehdisk4 none Nonehdisk5 0003714b1331a3ed heartvgdbsvr2#ls
7、pvhdisk1 000531c9c977a892 rootvg activehdisk2 0003714b7d935335 datavghdisk3 none Nonehdisk4 none Nonehdisk0 000531c9a501da2a rootvg activehdisk5 0003714b1331a3ed heartvgStep2: 编辑环境变量dbsvr1#vi /etc/environmentPATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin
8、:/usr/sbin/rsct/binTZ=BEIST-8LANG=en_USLOCPATH=/usr/lib/nls/locNLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.catLC_FASTMSG=truedbsvr2#vi /etc/environmentPATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java14/jre/bin:/usr/java14/bin:/usr/sbin/rsct/binTZ=BEIST-8LANG=en_USLOCPATH=
9、/usr/lib/nls/locNLSPATH=/usr/lib/nls/msg/%L/%N:/usr/lib/nls/msg/%L/%N.catLC_FASTMSG=trueStep3: 测试并行卷组通讯dbsvr1#dhb_read -p hdisk5 -rDHB CLASSIC MODEFirst node byte offset: 61440Second node byte offset: 62976Handshaking byte offset: 65024Test byte offset: 645125Receive Mode:Waiting for response . . .M
10、agic number = 0x87654321Magic number = 0x87654321Magic number = 0x87654321Magic number = 0x87654321Link operating normallydbsvr2#dhb_read -p hdisk5 -tDHB CLASSIC MODEFirst node byte offset: 61440Second node byte offset: 62976Handshaking byte offset: 65024Test byte offset: 64512Transmit Mode:Magic nu
11、mber = 0x87654321Detected remote utility in receive mode. Waiting for response . . .Magic number = 0x87654321Magic number = 0x87654321Link operating normallyStep4: 配置磁盘心跳网络dbsvr1#smitty hacmpInitialization and Standard ConfigurationExtended ConfigurationSystem Management (C-SPOC)Problem Determinatio
12、n ToolsDiscover HACMP-related Information from Configured NodesExtended Topology ConfigurationExtended Resource ConfigurationExtended Cluster Service SettingsExtended Event ConfigurationExtended Performance Tuning Parameters ConfigurationSecurity and Users ConfigurationSnapshot ConfigurationExport D
13、efinition File for Online Planning WorksheetsConfigure an HACMP ClusterConfigure HACMP NodesConfigure HACMP SitesConfigure HACMP NetworksConfigure HACMP Communication Interfaces/Devices6Configure HACMP Persistent Node IP Label/AddressesConfigure HACMP Global NetworksConfigure HACMP Network ModulesCo
14、nfigure Topology Services and Group ServicesShow HACMP TopologyAdd a Network to the HACMP ClusterChange/Show a Network in the HACMP ClusterRemove a Network from the HACMP ClusterSelect a Network Type Move cursor to desired item and press Enter. TOP # Discovery last performed: (Apr 03 15:13) # Discov
15、ered IP-based Network Types ether # Discovered Serial Device Types rs232 # Pre-defined IP-based Network Types XD_data XD_ip atm ether fddi hps ib token # Pre-defined Serial Device Types XD_rs232 diskhb Add a Serial Network to the HACMP ClusterType or select values in entry fields.Press Enter AFTER m
16、aking all desired changes.Entry Fields* Network Name net_diskhb_017* Network Type diskhbConfigure an HACMP ClusterConfigure HACMP NodesConfigure HACMP SitesConfigure HACMP NetworksConfigure HACMP Communication Interfaces/DevicesConfigure HACMP Persistent Node IP Label/AddressesConfigure HACMP Global
17、 NetworksConfigure HACMP Network ModulesConfigure Topology Services and Group ServicesConfigure HACMP NetworksSelect a category Move cursor to desired item and press Enter. Add Discovered Communication Interface and Devices Add Pre-defined Communication Interface and Devices Communication Interfaces
18、Communication devicesSelect a Device Network Move cursor to desired item and press Enter. net_diskhb_01 * Device Name heartdbsvr1* Network Type diskhb* Network Name net_diskhb_01* Device Path /dev/hdisk5*Node name dbsvr1* Device Name heartdbsvr2* Network Type diskhb* Network Name net_diskhb_01* Devi
19、ce Path /dev/hdisk5*Node name 8dbsvr2Step5: 检查集群网络结构Show Cluster TopologyShow Cluster DefinitionShow Topology Information by NodeShow Topology Information by NetworkShow Topology Information by Communication InterfaceCluster Name: gyjt Cluster Connection Authentication Mode: Standard Cluster Message
20、 Authentication Mode: None Cluster Message Encryption: None Use Persistent Labels for Communication: No NODE dbsvr1: heartdbsvr1 /dev/hdisk5 dbsvr1_svc 158.1.1.126 dbsvr1_boot 158.1.1.127 dbsvr1_stb 192.168.1.1 Network net_diskhb_01 heartdbsvr1 /dev/hdisk5 Network net_ether_01 dbsvr1_stb 192.168.1.1
21、 Network net_rs232_01 dbsvr1_tty0 /dev/tty0 NODE dbsvr2: 9Step6: 同步集群配置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 Extend
22、ed 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 Tool3、IP 网络心跳IP 网络心跳 可以使用 IP 别名心跳即在 boot 网卡上添加别名 IP,来
23、跑心跳。也可以用专门的网卡用作心跳通信。a、IP 别名心跳配置注意:心跳地址没有子网限制,但是要注意和 bootip 在不同的子网中。配置方法:在 hacmp 配置完成后 smitty hacmp - Extended Configuration - Extended Topology Configuration - Configure HACMP Networks -change a Network to the HACMP Cluster 下的 IP Address Offset for Heartbeating over IP Aliase 填入需要用作心跳传输的别名 IP 地址。当你输
24、入 hacmp 会自动在四个 bootip 上生成四个 private 的 ip 地址,做心跳用。生成的规则如下:引用cookbook 原文:When PowerHA starts, it buildsup an alias heartbeat network starting from this address, by 10calculating an IP address for each node based on the node number.举例说明:当你输入 10.0.0.1,机器会在启动 HACMP 时,在 a 主机上 boot1 生成 10.0.0.1,boot2 上生成 1
25、0.0.1.1,备机上 boot1 生成 10.0.0.2,boot2 生成10.0.1.2。这四个 ip 就是做心跳用的。b、单独网卡心跳配置准备:如果要是两台机器的话,用一跟网线把两个端口直接连接起来,这样就和其他的四个 boot ip 都在不同的 vlan 内。要是两个以上网卡做心跳的话,就要使用的交换机,但要将做心跳的所有主机的网口和 boot ip 放在不同的 vlan 内。配置步骤:添加 IP 地址:在做为心跳网卡上添加 IP 地址,并修改/etc/hosts 文件。添加心跳网络:smitty hacmp - Extended Configuration - Extended To
26、pology Configuration - Configure HACMP Networks - Add a Network to the HACMP Cluster - # Pre-defined IP-based Network Types 选择 ether 然后添加添加接口:smitty hacmp - Extended Configuration - Extended Topology Configuration - Configure HACMP Communication Interfaces/Devices - Add Communication Interfaces/Devi
27、ces - Add Pre-defined Communication Interfaces and Devices - Communication Interfaces - 选择建立的心跳网络修改网络属性:smitty hacmo - Extended Configuration - Extended Topology Configuration - Configure HACMP Networks - change a Network to the HACMP Cluste,在最后的一个选项中有一个网络的属性,默认的是 public,选择做心跳的网络将其改为 private 即可,其他选项不变。