分享
 
 
 

LVS的配置详解配置

王朝other·作者佚名  2008-05-19
窄屏简体版  字體: |||超大  

Red Hat Cluster Manager

安装操作系统,选择组件advance server,安装LVS部分。

两台主机,主机名为haha和hehe

主机haha的本地ip地址为net0:192.168.2.11,net1:192.168.2.14

主机hehe的本地ip地址为net0:192.168.2.12,net1:192.168.2.16

(主机网络连线只能用直连线进行连接,不能用交叉线连接,否则双机不能进行监控)

修改/etc/hosts文件,封掉localhost行的内容,写入本地主机、对方主机和虚拟主机相应的ip地址和主机名:(两台主机配置相同)

192.168.2.11 haha

192.168.2.12 hehe

192.168.2.13 xixi

进入/etc/sysconfig/rawdevices文件,增加两行内容:(两台主机设置相同)

/dev/raw/raw1 /dev/sdb1

/dev/raw/raw2 /dev/sdb2

以上两行是LVS需要的两个裸设备作为系统监控使用,每个裸设备的空间不能小于10M。当然需要fdisk建立两个两个相应的设备。

然后从起主机,进入/sbin下,./cluconfig进行cluster的配置:

Red Hat Cluster Manager Configuration Utility (running on haha) --haha为本地主机名

Enter cluster name [Red Hat Cluster Manager]:xixi --xixi为虚拟主机名

Enter IP address for cluster alias [NONE]:192.168.2.13 --地址为虚拟地址

--------------------------------

Information for Cluster Member 0

--------------------------------

Enter name of cluster member [haha]: --本地成员,回车即可

Enter number of heartbeat channels (minimum = 1) [1]: 2 --两块网卡心跳线(也可串口心跳)

Channel type: net or serial [net]: --第一块网卡做心跳

Enter hostname of the cluster member on heartbeat channel 0 [haha]: --心跳线成员名称

Channel type: net or serial [net]: --第二块网卡做心跳线

Enter hostname of the cluster member on heartbeat channel 1:hehe --另外一个成员名称

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 'haha'

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:hehe --对方成员名

Enter hostname of the cluster member on heartbeat channel 0: hehe

Enter hostname of the cluster member on heartbeat channel 1: haha

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 'hehe'

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.

本地主机配置完成

进入对方主机的/sbin目录,执行cluconfig ?init=/dev/raw/raw1显示信息如下:

Information about Channel 0

/sbin/cluconfig: [: haha: unary operator expected

Looking for host haha (may take a few seconds)...

Information about Channel 1

/sbin/cluconfig: [: hehe: unary operator expected

Looking for host hehe (may take a few seconds)...

Information about Quorum Partitions

Information About the Power Switch That Power Cycles Member 'haha'

Note: Operating a cluster without a remote power switch does not pr

maximum data integrity guarantees.

--------------------------------

Information for Cluster Member 1

--------------------------------

/sbin/cluconfig: [: hehe: unary operator expected

Looking for host hehe (may take a few seconds)...

Information about Channel 0

/sbin/cluconfig: [: hehe: unary operator expected

Looking for host hehe (may take a few seconds)...

Information about Channel 1

/sbin/cluconfig: [: haha: unary operator expected

Looking for host haha (may take a few seconds)...

Hostname does not map to any interface. Keep your selection? [yes]:

Information about Quorum Partitions

Information About the Power Switch That Power Cycles Member 'hehe'

Note: Operating a cluster without a remote power switch does not provide

maximum data integrity guarantees.

Press to continue. --按回车继续

Cluster name: xixi

Cluster alias IP address: 192.168.2.13

--------------------

Member 0 Information

--------------------

Name: haha

Primary quorum partition: /dev/raw/raw1

Shadow quorum partition: /dev/raw/raw2

Heartbeat channels: 2

Channel type: net, Name: haha

Channel type: net, Name: hehe

Power switch IP address or hostname: haha

Identifier on power controller for member haha: un

--------------------

Member 1 Information

--------------------

Name: hehe

Primary quorum partition: /dev/raw/raw1

Shadow quorum partition: /dev/raw/raw2

Heartbeat channels: 2

Channel type: net, Name: hehe

Channel type: net, Name: haha

Power switch IP address or hostname: hehe

Identifier on power controller for member hehe: un

--------------------------

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 (xixi) 11:16:11

Cluster alias: xixi

========================= M e m b e r S t a t u s ==========================

Member Status Node Id Power Switch

-------------- ---------- ---------- ------------

haha Up 0 Good

hehe Up 1 Good

========================= H e a r t b e a t S t a t u s ====================

Name Type Status

------------------------------ ---------- ------------

haha hehe network ONLINE

============

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有