heartbeat


[root@web2 ~]# rpm -qa |grep heartbeat

heartbeat-2.1.3-3.el5.centos

heartbeat-stonith-2.1.3-3.el5.centos

heartbeat-pils-2.1.3-3.el5.centos


[root@web2 ha.d]# pwd

/etc/ha.d

[root@web2 ha.d]# cat ha.cf  |grep -v "^#"

logfile /var/log/ha-log

logfacility     local0

keepalive 2

deadtime 10

warntime 5

initdead 120

udpport 694

bcast   eth0            # Linux

auto_failback on

node web1

node web2

ping 192.168.1.1

ping_group group1 192.168.1.21 192.168.1.22

respawn hacluster /usr/lib64/heartbeat/ipfail


[root@web2 ha.d]# cat authkeys  |grep -v "^#"

auth 1

1 crc


[root@web2 ha.d]# cat haresources  |grep -v "^#"

web1 IPaddr::192.168.1.200/24/eth0:0 nginx



这里奉上nginx负载的内容



       upstream lrm {

       #ip_hash;

       server 192.168.1.22:8080 weight=6;

       server 192.168.1.21:8080 weight=6;

       server 192.168.1.23:80 weight=6;

       server 192.168.1.18:80 weight=6;

       }

  server

       {

    listen       80;

    server_name www.lrm.com ;

  location / {


       proxy_pass    http://lrm ;

       proxy_set_header Host $host;

       proxy_set_header X-Real-IP $remote_addr;

       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


     }

}


你可能感兴趣的:(heartbeat)