NewStart HA 配置技巧

  • 格式:doc
  • 大小:492.00 KB
  • 文档页数:11

Newstart HA 配置技巧NewStart HA是一款支持多种Linux平台的双机高可用软件,具有稳定可靠,简约易用等特性。

在很多电信级服务器中都有用。

本文主要介绍NewStart HA 的典型配置技巧。

Newstart HA提供命令行工具(cli)及web工具配置方式,下面就两种配置方式分别讲述。

为保证配置顺利进行,以下准备工作要提前做好:1.已安装主流linux操作系统(如suse 9/10/11,rehat5/6,cgslv3/v4等);2.两个节点的主机名不能相同;3.两个节点的心跳链路和工作链路的网卡名都要求相同(如nodeA工作链路网卡名为eth0,则nodeB工作链路网卡名必须为eth0),心跳链路建议配2条或以上,工作链路建议做bonding,然后配置好各个网卡的物理IP;4.串口,HA提供串口线组建串口心跳链路,如机子不具备串口设备,可不配,但要保证总的心跳链路数量在两条或以上;5.确定业务的浮动IP地址值;6.共享存储,如使用该类设备,请分别创建好两个节点上的挂载目录;7.两节点已分别安装好业务应用;8.HA安装程序放置服务器上,如果是iso文件,使用二进制方式上传,如果是光盘,把安装光盘放到服务器CDROM中。

HA程序安装:以上准备工作完成后,就可以进行HA的安装,以iso安装文件为例,挂载安装程序到mnt目录,然后进行安装,如:# mount -o loop nsha-3.0.1.07.iso /mnt#/mnt/install安装过程很简单,需注意3个地方已使用粗体标出,粗斜体表示注解。

NewStart HA Installation ProgramVersion: 3.0.1.07Support email: ha-support@1)NewStart HA Server Program and CLI Administrative Tool12)Web-based Administrative Tool (options)(version: 20121101)23)All components34)Cancel说明:1为主程序和cli管理工具,2为web管理工具,3为以上全部组件select the components to be installed [1-4]?3…(过程省略)please enter the SN: 00TB24-FC0TCF-629A1H-B00D46 //试用SN号…(过程省略)Do you want to start web-based administrative tool automatically as a system service? y(es) or n(o)? y //系统启动时是否自动启动Web管理工具…(过程省略)The component(s) is installed completely.主程序及其组件已安装完成,接下来是license的申请,做完这一步HA的安装才算真正完成,操作如下:1、把两台机子上的/etc/ha.d/lic/newstartha.key文件打包(名字区分好,如newstartha.key_node1/2,二进制(bin)方式下载),然后发送到邮箱:ha-support@进行license文件的申请。

2、收到的license文件后改名为newstartha.lic,用二进制(bin)方式上传到服务器,放到/etc/ha.d/lic/目录,因为每个节点newstartha.lic内容不同,key文件与license文件一一对应,所以不要搞混,否则HA无法启动。

至此,HA安装完成,接下来讲述集群配置方式。

一、命令行工具(cli)配置方式集群的配置主要分两块,分别是集群初始化和服务初始化,必须按以上顺序进行初始化;在开始之前,有几个概念先了解一下:1、仲裁盘:数据安全保障机制,需要在共享磁盘上划分一块小空间, 30M左右,不需格式化,作用是防止服务双挂。

(可选,但推荐配置)2、第三方IP列表:与工作链路位于同一网段的3~5个已存在IP,作用是检测节点自身网络是否正常。

(建议配置)3、HA脚本:类似于/etc/init.d/目录下的脚本,主要是规定如何启动、停止和检测业务程序,HA配置之前要准备好,HA软件也提供了主流应用的相关脚本模版供参考,位于/etc/ha.d/resource.d目录下,包括:apache、tomcat、oracle和sybase等。

配置过程:1、集群初始化:cluster-init进入cli,运行cluster-init,然后按向导操作,如:cli:~>cluster-init…(此处打印省略)Please input cluster name:oracle_cluster //自定义集群名称Input the first node name and IP:suse11-sp1-1 192.168.1.192Input the second node name and IP:suse11-sp1-2 192.168.1.193How long between heartbeats(in seconds)[1]:直接回车都是推荐配置,下同How long to declare heartbeat has broken(in seconds)[60]:直接回车Do you want to enable watchdog device ? (yes/no)[no]:直接回车Please choose multicast heartbeat channel:0) eth21) bond0Select a multicast heartbeat channel [0, 1]:0 //选取网口心跳链路Another multicast heartbeat channel? (yes/no)[yes]:no //是否再增加一条网口心跳,因下面会配串口心跳,总数已达两条,这里不添加Do you want to add a serial heartbeat channel? (yes/no)[yes]:直接回车Input serial heartbeat channel[/dev/ttyS0]:直接回车Another serial heartbeat channel? (yes/no)[yes]:no //是否再增加一条串口心跳Do you want to enable worklink_hb ? (yes/no)[yes]:直接回车Do you want to add third-party ip list ? [recommended 3-5 ip] (yes/no)[yes]:直接回车 //是否配置第三方IP列表Please input a third-party ip address:192.168.1.190Another thirdpart ip address? (yes/no)[yes]:直接回车Please input a third-party ip address:192.168.1.200Another thirdpart ip address? (yes/no)[yes]:直接回车Please input a third-party ip address:192.168.1.201Another thirdpart ip address? (yes/no)[yes]:noDo you want to add a lock disk(recommend) ? (yes/no)[yes]:直接回车//是否配置仲裁机制,推荐,Please input the partition name (/dev/sdb):/dev/sdb1 //选取仲裁分区Warning:All data in /dev/sdb1 will be destroyed, sure to format it? (yes/no)[no]:yesDo you want to enable kernel panic ? (yes/no)[no]:直接回车Please run service-init to initialize you services.集群初始化完成,接下来进行服务初始化。

2、服务初始化:service-initcli中运行service-init,按向导操作,如:cli:~>service-init…(此处打印省略)Input service name:oracle //输入服务名Is it enabled?(yes/no)[yes]:直接回车Do you want to configure preferred node ? (yes/no)[no]:yes //是否选取服务优先运行节点Please choose preferred node:0) suse11-sp1-11) suse11-sp1-2Select a node: [0, 1]:0Input start time out[60]:直接回车Input stop time out[120]:直接回车Input check interval[30]:直接回车Input check time out[60]:直接回车Input max error count[1]:直接回车Restart after check result is failed?(yes/no)[no]:直接回车Start service anyway when float IP exist?(yes/no)[no]:直接回车Do you want to add a application? (yes/no)[yes]:直接回车====== Application ======Input name of application[oracle_app_0]:直接回车Input script of application[/etc/ha.d/resource.d/oracle]:/home/script/oracle.ps//HA脚本位置Is resource critical?[yes]:直接回车Is resource enable?[yes]:直接回车Add another application? (yes/no)[no]:直接回车Do you want to add a pubnic? (yes/no)[yes]:直接回车====== PubNIC ======Input PubNIC name[oracle_net_card_0]:直接回车Is resource critical?[yes]:直接回车Please choose network device:0) eth21) bond0Select a network device [0, 1]:1 //选取工作链路Add another pubnic? (yes/no)[no]:直接回车====== IP ======Input IP name[oracle_ip_0]:直接回车Input IP address:192.168.1.196 //浮点/业务IPInput netmask[255.255.255.0]:PubNIC of service:0) oracle_net_card_0 suse11-sp1-1:bond0 suse11-sp1-2:bond0 Select a PubNIC: [0, 0]:0Is resource critical?[yes]:直接回车Add another IP? (yes/no)[no]:直接回车Do you want to add a raw disk? (yes/no)[no]: //是否增加裸设备Do you want to add a diskmount? (yes/no)[no]:yes //是否增加磁阵设备====== diskmount ======Input diskmount name[oracle_diskmount_1]:直接回车Is resource critical?[yes]:直接回车Is resource enable?[yes]:直接回车0) disk //支持普通的块设备,如/dev/sdb21) nfs //支持nfs设备2) lvm //支持逻辑卷设备,如/dev/vg01/lv013) cancelplease choose a disk type? [0, 3]:0Input block disk device[/dev/hda1]:/dev/sdb2Input mountpoint:/home/db //磁阵挂载目录Input type of file system[ext3]:直接回车Input user[root]:oracle //挂载目录的操作用户Input group[root]:oinstall //操作用户的群组Input mode[755]:直接回车Input options[rw]:直接回车Input the quota of the device[90]:直接回车do you want to stop service when the disk is readonly?[yes]:直接回车Add another diskmount? (yes/no)[no]:直接回车Add another service? (yes/no)[no]:直接回车Please run cluster-start to start the HA system,or run cluster-restart to restart the HA system.到这里,服务初始化完成,也意味着整个集群初始化完成。