您的位置:首页 > 其它

Heartbeat+HAproxy

2017-03-24 21:15 155 查看
一.首先:配置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








测试结果:(截图)














内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Keepalive HAproxy