corosync/openais + ldirectord 实现LVS中的Direcor高可用
corosync/openais+ldirectord 实现LVS中的Direcor高可用[*]一:拓扑图:
http://blog.运维网.com/attachment/201208/182102549.png
[*]二:架构过程
[*]① 安装Real server (架构LVS的DR模型网络)
[*] Real server1 和Real server2 配置如下图
http://blog.运维网.com/attachment/201208/120842598.png
[*]安装httpd软件包 启动服务 ----提供Apache服务(详解本博客中的LAMP架构中)
[*]Service httpd start
[*]本机验证httpd 服务是否正常 elinks-dump http://172.16.10.2
[*]②Direcor1和Director 2 服务配置
http://blog.运维网.com/attachment/201208/121118910.png
[*]再次安装ipvsadm,提供LVS服务
[*]Yum –y installipvsadm
[*]Ipvsadm –A –t172.16.10.1:80 –srr
[*]Ipvsadm –a –t172.16.10.1:80 –r172.16.10.2 –g
[*]Ipvsadm –a –t172.16.10.1:80 –r172.16.10.3 –g
http://blog.运维网.com/attachment/201208/121215611.png
在IE中验证RealServer1和Real Server2 的httpd服务是否正常
[*]备注:最好是将命令两条命令
[*] /sbin/ifconfig eth0:0 172.16.10.1 netmask 255.255.255.255 broadcast 172.16.10.1 up
[*]/sbin/ ifconfig eth0:0 down
[*]写入/etc/rc.d/init.d/ipvsadm的start和stop函数中
http://blog.运维网.com/attachment/201208/121330656.png
http://blog.运维网.com/attachment/201208/121402590.png
[*]注:关闭以上服务的自动启动
[*]chkconfig http off
[*]chkconfig ipvsadm off
[*]Ok,LVS及Apache服务提供完毕
[*]③Director 1 和Director 2安装下面软件提供 corosync/openais服务
[*]cluster-glue
[*]cluster-glue-libs
[*]heartbeat
[*]openaislib
[*]resource-agents
[*]corosync
[*]heartbeat-libs
[*]pacemaker
[*]corosynclib
[*]libesmtp
[*]pacemaker-libs
yum -y --nogpgcheck localinstall *.rpm
[*]④建立Diector1 和Director2的双机互信及主机名称操作,并
[*]配置corosync/openais服务提供Message layer服务,安装pacemaker提供CRM服务
http://blog.运维网.com/attachment/201208/121825586.png
http://blog.运维网.com/attachment/201208/131529384.png
http://blog.运维网.com/attachment/201208/121932963.png
[*]corosync/openais配置完成
[*]⑤安装配置 ldirectord:显示LVS的高可用及监控Real server的健康状态
[*]yum -y --nogpgcheck localinstall ldirectord-1.0.1-1.el5.i386.rpmperl-MailTools-1.77-1.el5.noarch.rpm
[*]ldirectord-1.0.1-1.el5.i386.rpm perl-MailTools-1.77-1.el5.noarch.rpm
[*]cp/usr/share/doc/ldirectord-1.0.1/ldirectord.cf/etc/ha.d
http://blog.运维网.com/attachment/201208/122139303.png
[*]⑥配置corosync 实现Director的高可用
[*]primitive vip ocf:heartbeat:IPaddr params ip=172.16.10.1
[*]primitive ldirector lsb:ldirectord
[*]primitive ipvslsb:ipvsadm
[*]colocations ipvs_with_vip inf:vip ipvs ---->(这里是简单的配置实现高可用)
[*]注:由于使用的两台Director
[*]建议关闭 stonith 和quorum
[*]crm configure property stonith-enabled=false
[*]crm configure property no-quorum-policy=ignore
[*]注:在配置的过程中这里省略了部分细节检验的步骤(比如检验corosync启动过程是否youc)
http://blog.运维网.com/attachment/201208/122238300.png
[*]⑦结果验证
http://blog.运维网.com/attachment/201208/122347160.png
页:
[1]