Red Hat Cluster
software:
Linux advanced server2.1,kernel 2.4.9-e3
一定要安装clumanager-1.0.11-1.i386.rpm包,该包 有两个重要软件:cluconfig和cluadmin
hardware:
PE1750 with PERC4/di and PERC3/DC(bios disabledm cluster mode, id=6):privateIP:192.168.0.2, pub IP: 192.168.1.2, hostname:PE1750.dell.com
PV220S:三个Utra160磁盘
主机private网络连线用反转线进行连接
首先在每台服务器的perc3/di or perc4/di上创建一个lun,在linux下应该认作sda,接着在不连接PV220S的情况下,采用DOSA盘自动安装linux adv2.1,
安装完毕后,在服务器上分别安装clumanager-1.0.11-1.i386.rpm包(位于adv svr2.1第二张盘上)
修改每个主机的/etc/hosts文件,注释掉localhost行的内容,写入本地主机、对方主机和虚拟主机相应的public ip地址和主机名:(两台主机配置相同)注意:请不要添加private IP.
192.168.1.1 PE1650.dell.com PE1650 (public IP)
192.168.1.2 PE1750.dell.com PE1750(public IP)
192.168.1.3 virtualsvr.dell.com virtualsvr(virtual public IP)
关闭PE1750.
在PE1650上的PERC3/dc上创建3个lun,在linux下应认作sdb, sdc, sdd,
进入PE1650linux环境,用fdisk程序创建三个ext2 partition:sdb1(100M),sdc1(100M),sdd1(application partition)
用mkfs格式化三个分区。
进入/etc/sysconfig/rawdevices文件,增加两行内容:(两台主机设置相同)
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1
以上两行代表把sdb1和sdc1用作quorum drive,每个分区的空间不能小于10M。
启动PE1750,进入PERC3/dc bios, 接受PE1650的lun配置。
确保PE1650开机并进入linux环境,
进入PE1750 linux环境,
以root身份运行cluconfig进行cluster的配置:
Red Hat Cluster Manager Configuration Utility (running on PE1750)
Enter cluster name [Red Hat Cluster Manager]:virtualsvr.dell.com --cluster虚拟主机名
Enter IP address for cluster alias [NONE]:192.168.1.3 --cluster虚拟地址
--------------------------------
Information for Cluster Member 0
--------------------------------
Enter name of cluster member [PE1750]: --本地成员,回车即可
Enter number of heartbeat channels (minimum = 1) [1]: 1 --一块网卡作心跳线(也可串口心跳)
Channel type: .net or serial [net]: --第一块网卡做心跳
Enter hostname of the cluster member on heartbeat channel 0 [PE1750]: --第一个心跳线成员名称
Information about Quorum Partitions
Enter Primary Quorum Partition [/dev/raw/raw1]:
Enter Shadow Quorum Partition [/dev/raw/raw2]:
Information About the Power Switch That Power Cycles Member 'PE1750'
Choose one of the following power switches:
o NONE
o RPS10
o BAYTECH
o APCSERIAL
o APCMASTER
o WTI_NPS
o SW_WATCHDOG
Power switch [NONE]:
--------------------------------
Information for Cluster Member 1
--------------------------------
Enter name of cluster member:PE1650.dell.com --对方成员名
Enter hostname of the cluster member on heartbeat channel 0: PE1650.dell.com --对方心跳线成员名称
Information about Quorum Partitions
Enter Primary Quorum Partition [/dev/raw/raw1]:
Enter Shadow Quorum Partition [/dev/raw/raw2]:
Information About the Power Switch That Power Cycles Member 'PE1650.dell.com'
Choose one of the following power switches:
o NONE
o RPS10
o BAYTECH
o APCSERIAL
o APCMASTER
o WTI_NPS
o SW_WATCHDOG
Power switch [NONE]:
Save the cluster member information? yes/no [yes]: --对配置信息进行保存
Save the cluster member information? yes/no [yes]:
Writing to configuration file...done
Configuration information has been saved to /etc/cluster.conf.
----------------------------
Setting up Quorum Partitions
----------------------------
Running cludiskutil -I to initialize the quorum partitions: done
Saving configuration information to quorum partitions: done
Do you wish to allow remote monitoring of the cluster? yes/no [yes]: --是否允许远程主机进行cluster监视访问
Configuration on this member is complete.
To configure the next member, invoke the following command on that system:
# /sbin/cluconfig --init=/dev/raw/raw1
Refer to the Red Hat Cluster Manager Installation and Administration Guide
for details.
运行service cluster start启动PE1750 cluster服务
PE1750本地主机配置完成
进入PE1650主机的/sbin目录,执行cluconfig -–init=/dev/raw/raw1
显示信息如下:
Information about Channel 0
/sbin/cluconfig: [: PE1650: unary operator expected
Looking for host PE1650 (may take a few seconds)...
Information about Channel 1
/sbin/cluconfig: [: PE1650: unary operator expected
Looking for host PE1650 (may take a few seconds)...
Information about Quorum Partitions
Information About the Power Switch That Power Cycles Member 'PE1750'
Note: Operating a cluster without a remote power switch does not pr
maximum data integrity guarantees.
Press <Return> to continue. --按回车继续
Cluster name: virtualsvr.dell.com
Cluster alias IP address: 192.168.1.3
--------------------
Member 0 Information
--------------------
....
--------------------
Member 1 Information
--------------------
...
--------------------------
Power Switch 0 Information
--------------------------
Power switch IP address or hostname: haha
Type: NONE
Login or port: unused
Password: unused
--------------------------
Power Switch 1 Information
--------------------------
Power switch IP address or hostname: hehe
Type: NONE
Login or port: unused
Password: unused
Save the cluster member information? yes/no [yes]: --是否进行保存
Writing to configuration file...done
Configuration information has been saved to /etc/cluster.conf.
Saving configuration information to quorum partitions: done
Do you wish to allow remote monitoring of the cluster? yes/no [yes]:
----------------------------------------------------------------
Configuration on this member is complete.
Execute "/sbin/service cluster start" to start the cluster software.
这时,双机软件基本配置已经完成,在两台主机上分别运行service cluster start启动服务
通过cluadmin进行管理,如下所示:
cluadmin> cluster status
Cluster Status Monitor (virtualsvr.dell.com) 11:16:11
Cluster alias: virtualsvr.dell.com
========================= M e m b e r S t a t u s ==========================
Member Status Node Id Power Switch
-------------- ---------- ---------- ------------
PE1650.dell.com Up 0 Good
PE1750.dell.com Up 1 Good
========================= H e a r t b e a t S t a t u s ====================
Name Type Status
------------------------------ ---------- ------------
PE1750 <--> PE1650 network ONLINE
========================= S e r v i c e S t a t u s ========================
Last Monitor Restart
Service Status Owner Transition Interval Count
-------------- -------- -------------- ---------------- -------- -------
cluadmin>
通过状态可以看到双机状态正常,但未加入任何服务,通过help可以看到帮助:
cluadmin> help
cluster service apropos clear help version exit quit
cluadmin> service add --加入一个cluster support的网络服务
Service name: disk --服务名称
Preferred member [None]:PE1650 --首选成员
User script (e.g., /usr/foo/script or None) [None]: --用户脚本
Status check interval [0]: --状态检测间隔
Do you want to add an IP address to the service (yes/no/?) [no]:
Do you want to add a disk device to the service (yes/no/?) [no]: yes --加disk设备
Disk Device Information
Device special file (e.g., /dev/sdb4): /dev/sdd1 --设备名称
Filesystem type (e.g., ext2, or ext3): ext2 --文件系统类型
Mount point (e.g., /usr/mnt/service1) [None]: /mnt --mount点
Mount options (e.g., rw,nosuid,sync):
Forced unmount support (yes/no/?) [yes]: --是否强制unmount
Would you like to allow NFS access to this filesystem (yes/no/?) [no]:
Would you like to share to Windows clients (yes/no/?) [no]:
Do you want to (a)dd, (m)odify, (d)elete or (s)how DEVICES, or are you (f)inishe
d adding DEVICES [f]:
Add disk service as shown? (yes/no/?) yes --是否加入服务
0) PE1750.dell.com
1) PE1650.dell.com
c) cancel
Choose member to start service on: 0 --在首选哪台主机启动
Added disk. --加入服务成功
文章来源于领测软件测试网 https://www.ltesting.net/
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备2023014753号-2
技术支持和业务联系:info@testage.com.cn 电话:010-51297073