ITPub博客

首页 > Linux操作系统 > Linux操作系统 > HP-UX MC server cluster 配置实例

HP-UX MC server cluster 配置实例

原创 Linux操作系统 作者:xhailiang 时间:2006-10-02 00:00:00 0 删除 编辑

没有机会配置,在网上摘个实例看看也好.

1.5 配置实例

1.5.1 先决条件
1.5.2 设置主cell 服务器
1.5.3 设置辅cell 服务器
1.5.4 创建集群配置文件
1.5.5 创建软件包配置文件
1.5.6 创建软件包控制脚本
1.5.7 将配置应用于集群
1.5.8 启动集群,检查软件包状态



1.5 配置实例
--------------------

为阐明概念,我们将定义一个非常简单的、具有两个结点和一个共享磁盘的集群的配置实例,我们将只配置一个ServiceGuard软件包,它是共享磁盘上的OmniBack cell服务器。

下面列出的命令与这个配置实例有关,应当根据您具体的环境进行修改。

+-----+ +-----+
| | | |
vg00---| pri |---------vgshared---------| sec |---vg00
c2t6d0 | | c1t1d0 c0t1d0 | | c1t6d0
+-----+ +-----+
| | | |
|15.136.123.211(floatingIP) | |
|15.136.123.209 |15.136.123.210

---------+-|--------------+---------------+-|---------
|192.1.1.1 网桥 |192.1.1.2
-----------+--------------+-----------------+---------

主 cell 服务器主机名: pri.bbn.hp.com 15.136.123.209
辅 cell 服务器主机名: sec.bbn.hp.com 15.136.123.210
移动 cell 服务器主机名: ob2cs.bbn.hp.com 15.136.123.211
子网: 15.136.120.0
OB cell 服务器软件包名: ob2
软件包内的服务器名: ob2mon

1.5.1 先决条件
-------------

在配置ServiceGuard 之前必须存在具备下列先决条件:

- 主、辅主机上已安装OmniBack

- 主、辅主机上已安装ServiceGuard

- 至少有一个共享磁盘,确保共享总线上的SCSI 卡地址不冲突。

- 尽管可以使用一个局域网卡传送数据和心跳,仍建议您配置荣誉局域网接口。

- 保留用于OmniBack 软件包的IP

1.5.2 设置主主机上的cell服务器
---------------------------------

## Create shared vg
pri> mkdir /dev/vgshared
pri> mknod /dev/vgshared/group c 64 0x070000
pri> pvcreate -f /dev/rdsk/c1t1d0
pri> vgcreate vgshared /dev/dsk/c1t1d0
## Create shared lvol
pri> lvcreate -l 100 /dev/vgshared
pri> newfs -F vxfs /dev/vgshared/rlvol1
## Mount shared lvol
pri> mkdir /omni_shared
pri> mount /dev/vgshared/lvol1 /omni_shared
## Change cell server name to relocatable package hostname
pri> /opt/omni/sbin/install/omnichhost.ksh pri.bbn.hp.com
ob2cs.bbn.hp.com
## Modify OB/SG configuration file
pri> vi /etc/opt/omni/sg/sg.conf
SHARED_DISK_ROOT=/omni_shared
CS_SERVICE_HOSTNAME=ob2cs.bbn.hp.com
## If socket file exist, remove it or else omniforsg will fail
pri> find /var/opt/omni -type s -exec rm {} ;
## Move OB config/db to shared lvol
pri> /opt/omni/sbin/install/omniforsg.ksh -primary
## Unmount/deactivate shared lvol
pri> umount /dev/vgshared/lvol1
pri> vgchange -a n vgshared

1.5.3 设置辅助主机上的 cell服务器
-----------------------------------

## Import shared volume group
sec> mkdir /dev/vgshared
sec> mknod /dev/vgshared/group c 64 0x0n0000
sec> vgimport /dev/vgshared /dev/dsk/c0t1d0
## Mount/activate shared lvol
sec> mkdir /omni_shared
sec> vgchange -a y /dev/vgshared
(if problems activating, try vgchange -c n vgshared first)
sec> mount /dev/vgshared/lvol1 /omni_shared
## Create link to shared disk
sec> /opt/omni/sbin/install/omniforsg.ksh -secondary /omni_shared
## Unmount/deactivate shared lvol
sec> umount /dev/vgshared/lvol1
sec> vgchange -a n vgshared

1.5.4 创建集群配置文件
---------------------------------

## Create cluster configuration directory
pri> mkdir -p /etc/cmcluster/ob
sec> mkdir -p /etc/cmcluster/ob
## Generate cluster config ascii file
pri> cd /etc/cmcluster
pri> cmquerycl -v -C cluster.ascii -n pri -n sec
## Customize cluster configuration file as required
pri> vi cluster.ascii
CLUSTER_NAME cluster_train
FIRST_CLUSTER_LOCK_VG /dev/vgshared
NODE_NAME pri
NETWORK_INTERFACE lan1
HEARTBEAT_IP 192.1.1.1
NETWORK_INTERFACE lan0
HEARTBEAT_IP 15.136.123.209
FIRST_CLUSTER_LOCK_PV /dev/dsk/c1t1d0
NODE_NAME sec
NETWORK_INTERFACE lan1
HEARTBEAT_IP 192.1.1.2
NETWORK_INTERFACE lan0
HEARTBEAT_IP 15.136.123.210
FIRST_CLUSTER_LOCK_PV /dev/dsk/c0t1d0
VOLUME_GROUP /dev/vgshared
## Check cluster configuration file
pri> cmcheckconf -v -C cluster.ascii

1.5.5 创建软件包配置文件
---------------------------------

## Generate OB package configuration file
pri> cd /etc/cmcluster/ob
pri> cmmakepkg -p pkg.ascii
## Customize package configuration file as required
pri> vi pkg.ascii
PACKAGE_NAME ob2
NODE_NAME pri
NODE_NAME sec
RUN_SCRIPT /etc/cmcluster/ob/control.sh
HALT_SCRIPT /etc/cmcluster/ob/control.sh
SERVICE_NAME obmon
SUBNET 15.136.120.0

1.5.6 创建软件包控制脚本
-----------------------------

## Create OB package control script
pri> cd /etc/cmcluster/ob
pri> cmmakepkg -s control.sh
pri> chmod +x control.sh
## Customize package control script as required
pri> vi control.sh
VG[0]=vgshared
LV[0]="/dev/vgshared/lvol1"; FS[0]="/omni_shared"
IP[0]=15.136.123.211
SUBNET[0]=15.136.120.0
SERVICE_NAME[0]=obmon
SERVICE_CMD[0]="/etc/cmcluster/ob/csfailover.ksh start"
SERVICE_RESTART[0]=
## Copy csfailover script to OB package directory
pri" cp /opt/omni/newconfig/etc/opt/omni/sg/csfailover.ksh
/etc/cmcluster/ob

1.5.7 将配置应用于集群
--------------------------------------

## Copy package scripts to hosts in cluster
pri> cd /etc/cmcluster/ob
pri> rcp *sh sec:/etc/cmcluster/ob
## Check cluster configuration file
pri> cd /etc/cmcluster
pri> cmcheckconf -C cluster.ascii -P ob/pkg.ascii
## Generate and distribute binary configuration file
pri> vgchange -a y vgshared
pri> cmapplyconf -C cluster.ascii -P ob/pkg.ascii
pri> vgchange -a n vgshared

1.5.8 启动集群,检查软件包状态
-------------------------------------------

## mark vg as sharable
pri> cmruncl -v
pri> vgchange -c y vgshared
pri> cmhaltcl -v
## final start up of cluster
pri> cmruncl -v
pri> cmviewcl -v
## If package not enable for switching
pri> cmmodpkg -e ob2
## Test failover by killing one of the OB daemons

注:故障结束时,OB软件包将被禁止转到该结点,因此需要用cmmodpkg -e -n ob2重新启用。


注: 在 SG 环境下,共享卷组需要已独占方式激活,为此需要将卷组标记为高可用集群的成员:

vgchange -c y vgshared

一旦设置之后,不清除标志就不能正常激活卷组。




(http://www.fanqiang.com)

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/308563/viewspace-171876/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-02-17

  • 博文量
    270
  • 访问量
    414261