The lvs Linux load balancing NAT mode []

###### 'mode the NAT' ######

## Configuration ldirectord
'lvs current configuration, no health checks for the back end, a rs httpd stopped, there will be connection refused, how to solve? -> ldirectord '

# Tunnel to clear the previously configured rules in the scheduler and RS, remove ipip module to reconfigure the DR mode

1. First availability yum source added to the scheduler (server1)
[HighAvailability]
name = HighAvailability
BaseURL = HTTP: //172.25.0.250/rhel6.5/x86_64/dvd/HighAvailability
gpgcheck = 0

#rpm -qpl ldirectord-3.9.5-3.1.x86_64.rpm View profile path

2. Copy the configuration file and configure
cp /usr/share/doc/ldirectord-3.9.5/ldirectord.cf /etc/ha.d

vim /etc/ha.d/ldirectord.cf

= 172.25.0.100 Virtual: 80
Real = 172.25.0.2: 80 Gate ## two rear rs
Real = 172.25.0.3: 80 Gate
fallback = 127.0.0.1: 80 Gate ## rs two are linked, on the access schedule is own 80-port
Service = HTTP
Scheduler = rr ## polling algorithm
# persistent = 600
# Netmask = 255.255.255.255
Protocol = tcp
the CheckType = negotiate the
checkport = 80
Request = "index.html"
# = receive "the Test Page"
# virtualhost = www.xyz

/etc/init.d/ldirectord start ## start

3. Test
access on a physical machine curl 172.25.0.100, see polling, a service shut http rs of
access does not complain, just visit a rs, and will be removed from the down fall of rs ipvsadm strategy in the
open again http, ipvsadm will be added to the policy, the visit turned into a polling

Guess you like

Origin blog.csdn.net/qq_36016375/article/details/94915680