首页 > 其他 > 详细

Heartbeat+HAproxy

时间:2017-03-25 12:10:08      阅读:164      评论:0      收藏:0      [点我收藏+]

.首先:配置Keepalived信息

 

1.下载 安装

   heartbeat-3.0.4-2.el6.x86_64.rpm,

    heartbeat-devel-3.0.4-2.el6.x86_64.rpm,

   heartbeat-libs-3.0.4-2.el6.x86_64.rpm,

 

 

 

2.更改配置文件如下:


        (1)ha.d

keepalive 2

deadtime 30

warntime 10

initdead 60

udpport 1145

bcast   eth0

...

node    server1.example.com

node    server4.example.com

ping 172.25.254.250

...

respawn hacluster /usr/lib64/heartbeat/ipfail

apiauth ipfail gid=haclient uid=hacluster


(2)haresources

server1.example.com IPaddr::172.25.254.168/24/eth0 haproxy

 

(3)authkeys

auth 1

1 crc

技术分享

技术分享

技术分享

技术分享

技术分享

技术分享


.配置haproxy信息

 

1.下载安装haproxy

 

2.更改配置文件信息如下(haproxy.cfg)

   [标号]

     

   26log         127.0.0.1 local2

 

   28   chroot      /var/lib/haproxy

   29 pidfile     /var/run/haproxy.pid

   30 maxconn     4000

   31 user        haproxy

   32 group       haproxy

   33 daemon

...

   42defaults(默认值不用改)

 

 

(末尾自定义信息)

listen admin *:8080

        stats enable

        stats uri /status

        stats auth admin:redhat

        stats refresh 5s

 

listen hxl *:80

        balance roundrobin

        server web1 172.25.254.162:80 cookie applinst1 check inter 2000 rise 2 fall 5

        server web2 172.25.254.163:80 cookie applinst2 check inter 2000 rise 2 fall 5

技术分享

技术分享



测试结果:(截图)

技术分享

技术分享

技术分享

技术分享

技术分享


本文出自 “千年之树,修得一木” 博客,请务必保留此出处http://onehxl.blog.51cto.com/12099672/1910181

Heartbeat+HAproxy

原文:http://onehxl.blog.51cto.com/12099672/1910181

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!