设为首页 收藏本站
查看: 855|回复: 0

[经验分享] Vmware下RedHat AS 2.1集群配置StepbyStep

[复制链接]

尚未签到

发表于 2015-4-6 20:04:14 | 显示全部楼层 |阅读模式
Vmware gsx server 下RedHat Advanced Server 2.1集群配置
-----------By rdd
一. 宿主计算机硬件配置
P4 1.7G 384m内存 winxp系统
二. 虚拟硬件环境
两台vmware gsx server下安装的RedHat Advanced Server 2.1
主机1:主机名linuxone,网卡配置 ----------172.16.1.1(外部联网),1.1.1.1(心跳线)。
主机2:主机名 linuxtwo 网卡配置 ----------172.16.1.2(外部联网),1.1.1.2(心跳线)。
三. 系统安装
所需软件:vmware-gsx-server-installer-2.5.1-5336.exe
RedHat Advanced Server 2.1
安装步骤:
1. 安装vmware-gsx-server-installer-2.5.1-5336.exe后,在vmware中新建虚拟机(分配内存128M)并保存在d:\zhongguochun\linuxad1,用redhat光盘安装RedHat Advanced Server 2.1,为了加快安装,你可以在boot:后面输入text进入文本安装模式。别的地方不说了。在选择安装类型那里选择custom,然后在包列表那里要选择上kernel source.
主机名设置为linuxone,ip地址设置为172.16.1.1 255.255.0.0
2. ……….中间省略n多过程
3. 安装完成
4. 在d:\zhongguochun目录下新建目录linuxad2,并将d:\zhongguochun\linuxad1里面刚才安装好的虚拟操作系统复制一份到linuxad2
这样子,我们就得到了两个虚拟的RedHat Advanced Server 2.1了,当然,他们是一样的,我们需要进行些修改。
5. 进入d:\zhongguochun\linuxad2,用写字板打开linux.vmx,修改displayName = "Linuxad1"为displayName = "Linuxad2",这样子,在vmware控制台,你就看到两个不同的名字了。尽管如此,如果你同时启动两个虚拟机,这两个虚拟系统还是一样的,所以,我们需要修改他们的ip地址,主机名字等。
6. 将linuxad2目录中的系统启动,修改主机名字
#vi /etc/sysconfig/network
将HOSTNAME=linuxone改为HOSTNAME=linuxtwo
接下来修改ip地址:
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
将IPADDR=172.16.1.1改为IPADDR=172.16.1.2
改了名字,别忘记修改/etc/hosts哟
#vi /etc/hosts
加入
172.16.1.2 linuxtwo
7.Power off 这个虚拟机,这个样子,我们就得到了两个不同的系统拉,一个是linuxone,位于d:\zhongguochun\linuxad1,一个是linuxtwo 位于d:\zhongguochun\linuxad1
二.添加硬件
在两个系统都power off的状态下。我们需要分别给两个系统添加一块网卡,还要添加一个共享磁盘
1.用vmware 打开linuxone,注意不是power on 哦。在setting菜单下选择configuration edtior
,点击add,添加一块网卡,这个就不需要讲了吧。还需要添加一个虚拟磁盘,还是点add,硬件类型是Hard disk,然后”Creat a new virtual disk”,大小我分配了0.5G,并选择上下面的“Allocate all disk space”.下一步是给共享磁盘起名字叫”sharedisk.pln”,然后确定。这样子就添加好了。
2.用vmware 打开linuxtwo,注意不是power on 哦。同样添加一块网卡。接着添加虚拟磁盘,这次是”Use an existing virtual disk”,然后选择我们刚才在linuxone中创建的sharedisk.pln,按照提示就可以了。
3.磁盘和网卡都添加好了。这里,还需要注意,由于vmware中的系统启动后会锁定磁盘,所以当你启动linuxone后共享磁盘被锁定了,你的linuxtwo就起不来了。因此,我们需要处理一下先。首先,到d:\zhongguochun\linuxad1下,用写字板打开linux.vmx,在最后一行加入
Disk.locking = false
然后到d:\zhongguochun\linuxad2,同样修改linux.vmx, 在最后一行加入
Disk.locking = false
保存退出。
4.好了,到此为止,两个系统的硬件都配置好了呀

注:最好在Configuration editor 里面修改共享磁盘的”Vitual disk node”为scsi 1:0
三.为我们新添加的网卡配置ip地址先
1.Power On linuxone,启动过程中kudzu就会检测到新网卡,但是尽管你选择配置新网卡,启动完成后,
#ifconfig
还是只显示一块网卡的。所以,我们需要执行下面的命令拉
#cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
#vi /etc/sysconfig/network-scripts/ifcfg-eth1
将里面的ip地址和mask改为:1.1.1.1 255.0.0.0
#service network restart
#ifconfig
显示两块网卡的正确配置拉。
2.同时Power On linuxtwo
#cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1
#vi /etc/sysconfig/network-scripts/ifcfg-eth1
将里面的ip地址和mask改为:1.1.1.2 255.0.0.0
#service network restart
#ifconfig
显示两块网卡的正确配置拉。
三.修改两主机/etc/hosts
#vi /etc/hosts
172.16.1.1 linuxone
172.16.1.2 linuxtwo
1.1.1.1 linuxone
1.1.1.2 linuxtwo
172.16.1.3 redhatcluster
注意,最后一个ip是集群管理用

三。集群配置
(一)配置我们的共享磁盘
1. 切换到linuxone
#fdisk /dev/sdb
创建250m /dev/sdb1
250m /dev/sdb2

在两台服务器上分别编辑/etc/sysconfig/rawdevices文件,以便将分区绑定到裸设备。
#vi /etc/sysconfig/rawdevices
加入
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdb2
重启服务
#service rawdevices restart
看了些文档说要
#cludiskutil –p验证Quoram分区
我这里显示没有/etc/cluster.conf
不过,不管它。
2.切换到linuxtwo做同样的操作

(二)配置集群
切换到linuxone
#/sbin/cluconfig
你将看到以下输出:

Enter cluster name [Cluster]:redhatcluster
Enter IP address for cluster alias [x.x.x.x]: 172.16.1.1
--------------------------------
Information for Cluster Member 0
--------------------------------
Enter name of cluster member [linuxone]: linuxone
Looking for host one (may take a few seconds)...
Enter number of heartbeat channels (minimum = 1) [1]: 1
Information about Channel 0
Channel type: net or serial [net]:
Enter hostname of the cluster member on heartbeat channel 0 \
[linnuxone]: linnuxone
Looking for host linnuxone (may take a few seconds)...
Information about Quorum Partitions
Enter Primary Quorum Partition [/dev/raw/raw1]: /dev/raw/raw1
Enter Shadow Quorum Partition [/dev/raw/raw2]: /dev/raw/raw2
Information About the Power Switch That Power Cycles Member ’ linnuxone’
Choose one of the following power switches:
o NONE
o RPS10
o BAYTECH
o APCSERIAL
o APCMASTER
o WTI_NPS
Power switch [NONE]: NONE

Information for Cluster Member 1
--------------------------------
Enter name of cluster member [linuxtwo]: linuxtwo
Looking for host linuxtwo (may take a few seconds)...
Information about Channel 0
Enter hostname of the cluster member on heartbeat channel 0 \
[linuxtwo]: linuxtwo
Looking for host linuxtwo (may take a few seconds)...
Information about Quorum Partitions
Enter Primary Quorum Partition [/dev/raw/raw1]: /dev/raw/raw1
Enter Shadow Quorum Partition [/dev/raw/raw2]: /dev/raw/raw2
Information About the Power Switch That Power Cycles Member ’ linuxtwo’
Choose one of the following power switches:
o NONE
o RPS10
o BAYTECH
o APCSERIAL
o APCMASTER
o WTI_NPS
Power switch [NONE]: NONE

.
.
.
省略部分输出--------------------
Member 0 Information
--------------------
Name: linuxone
Primary quorum partition: /dev/raw/raw1
Shadow quorum partition: /dev/raw/raw2
Heartbeat channels: 1
Channel type: net, Name: linuxone
Power switch IP address or hostname:linuxone
--------------------
Member 1 Information
--------------------
Name: linuxtwo
Primary quorum partition: /dev/raw/raw1
Shadow quorum partition: /dev/raw/raw2
Heartbeat channels: 1
Channel type: net, Name: linuxtwo
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]: yes
----------------------------------------------------------------
Configuration on this member is complete.
To configure the next member, invoke the following command on that system:
# /sbin/cluconfig --init=/dev/raw/raw1
See the manual to complete the cluster installation

3.切换到linuxtwo
#cluconfig --init=/dev/raw/raw1
………显示好多东西。。。直到出现
Press to continue. --按回车继续
………又是好多东西,直到出现
Save the cluster member information? yes/no [yes]: --回车继续
………最后的总结信息
Configuration on this member is complete.
Execute "/sbin/service cluster start" to start the cluster software.

4.启动Cluster服务
在linuxone上,linuxtwo上依次
#service cluster start
回到linuxone
#cluadmin

cluadmin>cluster status
显示集群的两个节点
Linuxone,linuxtwo的状态都是up,good
好了,完成。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-54423-1-1.html 上篇帖子: 批处理开启、关闭vmware的服务 下篇帖子: VMware workstation 磁盘扩容
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表