RHEL5配置RHCS集群web (无共享存储)

power by yuhongxiang EMAIL:hongxiang22355@gmail.com

环境简介:如下表所示

主机名

IP地址

虚拟ip

作用

OS版本

虚拟机软件

rhcs1.hongxiang.com

192.168.26.21

192.168.26.23

web1+luci

redhat enterprise 5.9

vmware workstation 9

rhcs2.hongxiang.com

192.168.26.22

web2

redhat enterprise 5.9

各个虚拟机网卡设置(仅与主机连接)

yum库配置

创建 /etc/yum.repo.d/base.repo

内容如下

[base]

name=base

baseurl=file:///media/Server

enabled=1

gpgcheck=0

[base1]

name=base1

baseurl=file:///media/VT/

enabled=1

gpgcheck=0

[base2]

name=base2

baseurl=file:///media/Cluster/

enabled=1

gpgcheck=0

[base3]

name=base3

baseurl=file:///media/ClusterStorage/

enabled=1

gpgcheck=0

挂载ISO镜像到/media即可

hosts文件编辑

编辑/etc/hosts内容如下

127.0.0.1 localhost.localdomain localhost

::1 localhost6.localdomain6 localhost6

192.168.26.21 rhcs1.hongxiang.com rhcs1

192.168.26.22 rhcs2.hongxiang.com rhcs2

关闭/etc/init.d/luci start防火墙

service iptables stop

chkconfig iptables off

关闭selinux

setenforce 0

目测影响不适合很大

web服务器搭建

yum install httpd

在rhcs1节点上的/var/www/html目录,新建index.html,内容如下:

<html>

<body>

this is RHCS1

</body>

</html>

在rhcs2节点上的/var/www/html目录,新建index.html,内容如下:

<html>

<body>

this is RHCS2

</body>

</html>

rhcs1节点安装luci

yum –y install luci*

luci初始化以及重启

设置luci密码

luci_admin init

设置密码

所有节点集群上(rhcs1,rhcs2)安装RHCS软件

yum –y install cman

yum –y install ricci

yum –y install rgmanager

安装完所有RHCS组件后,重启所有节点,并启动ricci,luci服务,rhcs1节点需要启动luci,rhcs2不需要,服务启动完毕后,查看rhcs1节点的11111端口,8084端口有没有在监听,rhcs2

节点的11111端口有没有在监听

/etc/init.d/ricci start

/etc/init.d/luci start

web配置luci集群设置

RHEL5配置RHCS集群web (无共享存储)_blank

RHEL5 默认账户admin 密码就是刚才前面设置的.我这边设置111111

RHEL5配置RHCS集群web (无共享存储)_power_02

RHEL5配置RHCS集群web (无共享存储)_blank_03

创建cluster

RHEL5配置RHCS集群web (无共享存储)_border_04

添加资源

RHEL5配置RHCS集群web (无共享存储)_blank_05

RHEL5配置RHCS集群web (无共享存储)_target_06

添加脚本资源

RHEL5配置RHCS集群web (无共享存储)_power_07

添加服务service,添加设置的ip和脚本

RHEL5配置RHCS集群web (无共享存储)_power_08

添加fence

RHEL5配置RHCS集群web (无共享存储)_power_09

各个节点添加fench

RHEL5配置RHCS集群web (无共享存储)_power_10

RHEL5配置RHCS集群web (无共享存储)_blank_11

配置failover domain

RHEL5配置RHCS集群web (无共享存储)_target_12

测试

RHEL5配置RHCS集群web (无共享存储)_power_13

pkill -9 httpd

集群切换

RHEL5配置RHCS集群web (无共享存储)_power_14