doc
作者doc·2020-04-12 16:14
项目经理·长春理想

HACMP安装与调试

字数 8584阅读 1226评论 0赞 8

HACMP 的基本设计

各厂商现有的 UNIX 服务器一般都拥有很高的可靠性,在这一点上 IBM 的 P 系列服务器表现尤为突出。但所有 UNIX 服务器均无法达到如 IBM 大型主机 S/390 那样的可靠性级别,这是开放平台服务器的体系结构和应用环境所决定的。使用 IBM 高可用性集群软件 —— HACMP ,可以更好的保护关键业务应用不受故障影响。

HACMP 是 High Availability Cluster Multi-Processing 的缩写。 HACMP 是 IBM 公司在 P 系列 AIX 操作系统上的高可靠集群软件,配置冗余,消除单点故障,保证整个系统连续可用性和安全可靠性。 HACMP 是利用网络来侦测主机及网卡的状况,搭配 AIX 所提供的硬盘镜像等功能,在主机、网卡、硬盘控制卡、硬盘或网络发生故障时,自动切换到另一套备用元件上重新工作 ; 若是主机故障还切换至备份机上继续应用系统的运行。

  • 作为双机系统的两台服务器同时运行 HACMP 软件;
  • 两台服务器的备份方式有三种 :

    • 一台服务器运行应用,另外一台服务器做为备份
    • 两台服务器除正常运行本机的应用外,同时又作为对方的备份主机 ;
    • 两台服务器同时运行相同的应用,需要数据库的支持。
  • 两台主机系统在整个运行过程中,通过 “ 心跳线 ” 相互监测对方的运行情况 ( 包括系统的软硬件运行、网络通讯和应用运行情况等 );
  • 一旦发现对方主机的运行不正常 ( 出故障 ) 时,故障机上的应用就会立即停止运行,本机 ( 故障机的备份机 ) 就会立即在自己的机器上启动故障机上的应用,把故障机的应用及其资源 ( 包括用到的 IP 地址和磁盘空间等 ) 接管过来,使故障机上的应用在本机继续运行 ;
  • 应用和资源的接管过程由 HACMP 软件自动完成,无需人工干预 ;
  • 当两台主机正常工作时,也可以根据需要将其中一台机上的应用人为切换到另一台机 ( 备份机 ) 上运行。 、
  1. hacmp 不是错误避免,只能减少宕机时间,不可能避免。
  2. 不是有了 HA 就 OK 的,它需要包括各种软硬件、仔细的设计规划及管理等, ha 软件只是其中一部分。
  3. hacmp 是通过减少单点故障来减少宕机时间的。
  4. hacmp 的 plan 非常重要,要仔细考虑。
  5. hacmp 既可以减少计划外的宕机时间,也可以减少计划内的宕机时间。 90% 的宕机时间是计划内的,减少计划内的宕机时间只能靠管理员不断提高自己的水平来解决了。
  6. hacmp 是无法解决所有问题的, ha 解决不了诸如硬盘、硬盘适配器、硬盘总线的损坏,当然也解决不了 ha 自身的问题。这些问题应该在操作系统层面上解决。
  7. 可以通过自定义的事件来实现大多数个性化的需求。
  8. hacmp 心跳信号用的是 snmp 协议,同时在 TCP/IP 和非 TCP/IP 网络上跑,非 TCP/IP 包括 RS232/RS422 、 SSA 、 SCSI 等。所以心跳线不只是使用串口线。
  9. 没有配非 TCP/IP 网络的,即没有心跳线的 HA 是可以跑的。前面已经说了心跳信号在 TCP/IP 网络上也在跑。但是,没有非 TCP/IP 网络的 HA 是无法区分 TCP/IP 失败还是节点失败,这样的话网络的失败会造成孤立的节点,备用会对资源进行错误的接管。
  10. hacmp es 最多可支持 128 个节点,但实际很少会见到超过 3 个节点的 Cluster 。
  11. 任何时候都不要 kill ha 进程。
  12. 即使用了 ha ,备份依旧是不可缺少的。

基本概念

  1. 拓扑:一个逻辑概念,包括节点、网络、网卡以及之间的关系。
  2. 资源: ip 地址、文件系统、卷组、应用等。
  3. 资源组:一组资源,包含在接管中所要用的所有资源。一个节点可以有多个资源组。
  4. 应用服务器:启动 / 停止应用的脚本。
  5. 同步:在所有节点中更新配置, ha 4.x 拓扑和资源是分开同步的, 5 以后就只要同步一次就可以了。
  6. 事件:状态的改变。可以通过自定义事件来实现个性化的要求。
  7. 进程:核心进程包括 clstrmgr 和 clsmuxpd 。此外还有, clinfo- 提供显示群集的状态, cllockd- 提供并发控制,在 concurrent 模式下使用。
  8. cascading 模式,有优先级,按优先级来接管资源。优先级高的节点恢复后将回拉资源。
  9. rotating 模式,节点是平等的,按预先定义的顺序接管资源,节点恢复后不会回拉资源。
  10. concurrent 模式,并发模式,应用跑在所有的的节点上,不存在资源接管的问题。

HACMP 的安装调试

选择安装:

Cluster.adt.*

Cluster.base.*

Cluster.cspoc

Cluster.msg

以上是 4.x 下的, 5 把标版和 ES 版合并了,所以小有变化。

安装的时候如果提示有包没有装的话,先装一下。

软件装好了就开始配置吧。

先看 HA4.5 。 5 的变化比较大,回头再说。

Smitty hacmp

HACMP

Move cursor to desired item and press Enter.

Cluster Configuration

Cluster Services

Cluster System Management

Cluster Recovery Aids

RAS Support

Cluster Configuration

Move cursor to desired item and press Enter.

Cluster Topology

Cluster Security

Cluster Resources

Cluster Snapshots

Cluster Verification

Cluster Custom Modification

Restore System Default Configuration from Active Configuration

Advanced Performance Tuning Parameters

Cluster Topology

Move cursor to desired item and press Enter.

Configure Cluster

Configure Nodes

Configure Adapters

Configure Sites

Configure Networks

Configure Global Networks

Configure Network Modules

Configure Topology Services and Group Services

Show Cluster Topology

Synchronize Cluster Topology

Configure Cluster

Move cursor to desired item and press Enter.

Add a Cluster Definition

Change / Show Cluster Definition

Remove Cluster Definition

Add a Cluster Definition

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

**NOTE: Cluster Manager MUST BE RESTARTED

in order for changes to be acknowledged.**

  • Cluster ID [1] #
  • Cluster Name [test_cluster]

注意: Cluster ID 在同一网络内必须是唯一的。

Configure Nodes

Move cursor to desired item and press Enter.

Add Cluster Nodes

Change / Show Cluster Node Name

Remove a Cluster Node

Add Cluster Nodes

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

  • Node Names [servera serverb]

使用一个有意义的标示,如 hostname 。

可以同时添加多个节点,用空格分开。

Configure Networks

Move cursor to desired item and press Enter.

Configure IP-based Networks

Configure Non IP-based Networks

Add an IP-based Network

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

  • Network Name [tcp_1]
  • Network Attribute public +

Network Type [ether] +

Subnet(s) [192.168.1.0/24] +

Configure Adapters

Move cursor to desired item and press Enter.

Configure IP-based Interfaces / IP Labels

Configure Adapters on Non IP-based networks

Configure IP-based Interfaces / IP Labels

Move cursor to desired item and press Enter.

Add Initial Interfaces

Discover IP Topology

Add Multiple IP-based Interfaces

Add Multiple Service IP Labels to a Network

Add IP Labels Requiring Individual Configuration

Change / Show an Interface / IP Label

Remove Interface(s) / Label(s)

Add an Initial Interface

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

  • IP Label [servera_boot]

Network Type ether

Network Name tcp_1

  • Interface Function [boot]

Interface IP Address [198.162.1.1]

  • Node Name [servera]

Netmask []

就这样把所有节点中的 boot 、 service 和 standby 网卡都设好。注意 Network Name 要和 hosts 里的 label 一样。 Ip 地址和 netmask 可以自动从 hosts 中获得。

下面设置心跳:

Add a Non IP-based Network

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

  • Network Name [serialnet0]
  • Network Type [rs232]

Add a Non IP-based Adapter

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

  • Adapter Label [servera_tty]

Network Type rs232

Network Name serialnet0

  • Device Name [/dev/tty3]
  • Node Name [servera]

把所有的节点的心跳都配置好拓扑就 ok 了。

下面同步拓扑结构:

Synchronize Cluster Topology

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

Ignore Cluster Verification Errors? [No]

  • Emulate or Actual? [Actual]
  • Skip Cluster Verification [No]

Note:

Only the local node's default configuration files

keep the changes you make for topology DARE

emulation. Once you run your emulation, to

restore the original configuration rather than

running an actual DARE, run the SMIT command,

"Restore System Default Configuration from Active

Configuration."

We recommend that you make a snapshot before

running an emulation, just in case uncontrolled

cluster events happen during emulation.

NOTE:

If the Cluster Manager is active on this node,

synchronizing the Cluster Topology will cause

the Cluster Manager to make any changes take

effect once the synchronization has successfully

completed.

HACMP 全攻略之安装与配置 2

HACMP 全攻略之安装与配置 2- 资源组的配置

下面开始定义资源

首先增加一个资源组:

Define Resource Groups

Move cursor to desired item and press Enter.

Add a Resource Group

Change / Show a Resource Group

Remove a Resource Group

Change / Show Resource Group Processing Order

Add a Resource Group

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

  • Resource Group Name [test_app]
  • Node Relationship cascading +
  • Site Relationship ignore +
  • Participating Node Names / Default Node Priority [servera serverb] +

在这确定接管方式和顺序。

下面增加 Application Servers

Define 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

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

  • Server Name [test_s ]
  • Start Script []
  • Stop Script []

脚本要写绝对路径。

然后设置资源组属性:

Change/Show Resources/Attributes for a Resource Group

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

Resource Group Name test_app

Node Relationship cascading

Site Relationship ignore

Participating Node Names / Default Node Priority servera serverb

Dynamic Node Priority [] +

Service IP label [servera_svc] +

Filesystems (default is All) [] +

Filesystems Consistency Check fsck +

Filesystems Recovery Method sequential +

Filesystems/Directories to Export [] +

Filesystems/Directories to NFS mount [] +

Network For NFS Mount [] +

Volume Groups [servera_vg] +

Concurrent Volume groups [] +

Raw Disk PVIDs [] +

Connections Services [] +

Fast Connect Services [] +

Tape Resources [] +

Application Servers [test_s] +

Communication Links [] +

Primary Workload Manager Class [] +

Secondary Workload Manager Class [] +

Miscellaneous Data []

Automatically Import Volume Groups false +

Inactive Takeover Activated false +

Cascading Without Fallback Enabled false +

Disk Fencing Activated false +

Filesystems mounted before IP configured false +

配置好了就开始同步:

Synchronize Cluster Resources

Type or select values in entry fields.

Press Enter AFTER making all desired changes.

[Entry Fields]

Ignore Cluster Verification Errors? [No] +

Un/Configure Cluster Resources? [Yes] +

  • Emulate or Actual? [Actual] +
  • Skip Cluster Verification [No] +

Note:

Only the local node's default configuration files

keep the changes you make for resource DARE

emulation. Once you run your emulation, to

restore the original configuration rather than

running an actual DARE, run the SMIT command,

"Restore System Default Configuration from Active

Configuration."

We recommend that you make a snapshot before

running an emulation, just in case uncontrolled

cluster events happen during emulation.

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

8

添加新评论0 条评论

Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

相关资料

X社区推广