LVS-dr build configuration (direct routing mode)

     In the DR cluster mode, LVS load balancer as access entry of the cluster, but is not used as a gateway; all server nodes in the pool are each access the Internet , send to the client Web response packet that does not require LVS load schedule device .

 

 

The first step: Turn off the firewall and selinux

 

 

systemctl stop firewalld

 

 iptables -F

 

setenforce 0

The second step, a scheduler configuration

yum -y install ipvsadm 

 yum -y install ipvsadm

 ifconfig ens32:0 192.168.200.254 netmask 255.255.255.0

 ifconfig ens32:0

The third step, the distribution

ipvsadm -A -t 192.168.200.254:80 -s rr

ipvsadm -a -t 192.168.200.254:80 -r 192.168.200.113:80 -g -w 1

A fourth step of modifying the machine node

Configuring a virtual interface

 ifconfig lo:0 192.168.200.254 netmask 255.255.255.255

 ifconfig lo:0

A fifth step, the node installation

yum -y install httpd

Test page echo "...."> /var/www/html/index.html

systemctl start httpd

The sixth step, the debugger adjust machine parameters

 vim write down /etc/sysctl.conf

---------------------------------------------------------

net.ipv4.conf.all.arp_ignore = 1

net.ipv4.conf.all.arp_announce = 2

net.ipv4.conf.default.arp_ignore = 1

net.ipv4.conf.default.arp_announce = 2

net.ipv4.conf.lo.arp_ignore = 1

net.ipv4.conf.lo.arp_announce = 2

--------------------------------------------------------------

Open: sysctl -p 

You can test the browser, with net input test methods

Seven-step
query load state case

ipvsadm -Lnc

 

Guess you like

Origin www.cnblogs.com/123456likun/p/11606873.html