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

[经验分享] LVS的配置详解配置

[复制链接]
发表于 2019-1-5 12:07:30 | 显示全部楼层 |阅读模式
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>  -------------- ---------- ---------- ------------
  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
  ============


运维网声明 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-659643-1-1.html 上篇帖子: LVS-NAT和LVS-DR模式的实现详解 下篇帖子: LVS+piranha(多实例配置) 转载
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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

扫描微信二维码查看详情

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


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


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


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



合作伙伴: 青云cloud

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