• RSS订阅
  • 交换链接
  • 首页

Jeffrey’s Blog

Web&P2P系统架构及优化


LVS的配置详解配置

March 31st, 2006

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 <Return> 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
========================= 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 –加入一个服务
Service name: disk –服务名称
Preferred member [None]:haha –首选成员
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/sdb3 –设备名称
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) haha
1) hehe
c) cancel
Choose member to start service on: 0 –在首选哪台主机启动
Added disk. –加入服务成功

Last modified at: Thursday, October 12th, 2006 04:18:22 pm
Trackback URL: http://blog.zhangjianfeng.com/article/212/trackback

给本文打分: 1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
Tags: lvs, 配置
2006/03/31 | 阅读全文 | 应用服务 | Email This Post | Print This Post | 1,284 views |
收藏到网摘: Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网

Related Post

  • Friday, June 6th, 2008 -- xen安装及配置笔记
  • Wednesday, December 26th, 2007 -- mysql主从服务器的配置笔记
  • Thursday, September 20th, 2007 -- 使用heartbeat做双机热备笔记
  • Monday, September 3rd, 2007 -- squid代理网关笔记
  • Tuesday, August 21st, 2007 -- raid5盘阵,做lvm笔记
  • Thursday, June 28th, 2007 -- freebsd 6.2 安装配置笔记
  • Monday, June 25th, 2007 -- 简要安装FreeBSD 6.2及配置桌面环境[zz]
  • Sunday, April 15th, 2007 -- linux日志服务器配置笔记
  • Friday, March 30th, 2007 -- linux下ntpd安装配置笔记
  • Sunday, March 11th, 2007 -- Cygwin安装配置笔记

6 Responses to “LVS的配置详解配置”


  1. 1Anonymous

    :em14: :em12: :em11: :em10: :em13: :em08: :em18: :em17: :em16: :em15: :em07: :em09: :em01: :em03: :em04: :em05: :em06: :em02:

    Comment on Jan 30th, 2007 at 11:16 am  

Leave a Reply

  • :em04:
  • :em18:
  • :em17:
  • :em10:
  • :em01:
  • :em05:
  • :em15:
  • :em07:
  • :em03:
  • :em13:
  • :em09:
  • :em12:
  • :em11:
  • :em06:
  • :em16:
  • :em14:
  • :em02:
  • :em08:

« VLAN配置笔记
端口扫描程序nmap使用手册 »

    最新文章

    • Subversion的用户自助修改口令实现(linux测试通过)
    • SLES10-SP1+Apache-2.0.63+SVN-1.4.6安装配置笔记
    • [音乐欣赏]A place nearby
    • 不错的firefox插件---鼠标手势mouse gestures
    • 一些相克食品
    • oracle一次数据迁移笔记
    • 不错的vi-vim键盘图(中英文双版)
    • xen安装及配置笔记
    • Multiple network cards and bridges in Xen[zz]
    • 从LiveJournal后台发展看大规模网站性能优化方法[zz]

    评分最高文章

      • 今天下载的一个CHM文件,打开时右边的内容看不到,提示“该页无法显示”。
      • linux日志服务器配置笔记
      • Legato networker学习笔记(杂)
      • linux tips 技巧笔记
      • [BT下载]2006韩剧-葡萄园的那小伙儿
      • 我家的金吉拉
      • 卡巴斯基病毒库离线更新方法
      • 忽悠姐妹花主题曲下载
      • 轻轻松松把 Apache 配置安全
      • 北京IDC机房介绍

    随机文章:

    • rrdtool1.2.11安装笔记
    • 如何新增一块硬盘
    • 多服务器的日志合并统计---cronolog+awstats
    • vsftpd配置文件
    • EMC-AX100i在2003系统下出现的(重启后)共享文件夹丢失问题及解决办法
    • ipmonitor无法访问被监控服务器的服务解决办法
    • 域控报 (事件 ID:12 来源:W32Time) 错误,解决办法
    • 磁盘阵列搬回家 — Linux软RAID实战指南
    • mysql主从服务器的配置笔记
    • 用Samba实现文件服务器功能[转自网络,并整理]

    最新评论

    • very good :em02: ,I like very much !!...
    • :em03: :em13: :em15: :em07...
    • 北京电信通有四个机房1惠普机房 2中...
    • :em04: :em18: :em17...
    • 结婚的好日子啊8月10...
    • c2950-1-1(config)# snmp-server trap-source FastEt...
    • :em16: :em16: :em16: :em16: :em16: :em16: :...
    • :em01: :em07: :em04: :em17: :em10: :em18: :...
    • 我是天称座 :em14: :em15: :em03: :em02: :...
    • [...] 前面一段:1.3.6.1.4.1. 可以查看这...


    邮件订阅  
  • Categories

    • 个人日志 (15)
    • 休闲娱乐 (79)
    • 应用服务 (86)
    • 影音娱乐 (10)
    • 电脑网络 (78)
    • 站点日志 (19)
    • 系统管理 (242)
    • 英语学习 (15)
    • 衣食住行 (41)
    • 资料共享 (28)
  • 工具网址

    • 天气预报
    • 常用电话
    • 疾病查询
    • 在线翻译
    • Alexa排名查询
    • IP信息查询
    • 邮箱图标生成
    • 我的Firefox插件
  • 友情链接

    • linuxの飘扬
    • winter的平凡生活
    • 伤感星星的天空
    • 回忆未来[张宴]
    • 存储部落
    • 扶凯Blog
    • 沐宇春风
    • 爱MySQL中文网
    • 狗.车.志
    • 非礼勿视
  • Tags

    • 下载 优化 使用 免费 北京 升级 学习 学习笔记 安装 工具 技巧 日志 最新 服务器 笔记 英语学习 菜谱 视频 解决 调优 软件 运程 配置 配置文件 食物 2007 apache blog dreamhost freebsd Legato linux mysql networker oracle php RAID5 RedHat sendmail shell squid suse Ubuntu windows wordpress

Jeffrey's Blog is powered by WordPress 2.3.1 and Unnamed 1.22
Entries (RSS) and Comments (RSS) Admin 京ICP备06038449号

Podcast Powered by podPress (v8.8)