1) Environment Preparation
one lvs server, two or more servers to implement the e-commerce platform as realserver (before the blog has a build process)
2) Remove the NIC from the Realserver server's host mode
3) Configuring the host mode NIC alias on the LVS server
650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/13/95830f1c42361901e0c8d2e9e1a5d50b.png "title=" Picture 1.png "alt=" 95830f1c42361901e0c8d2e9e1a5d50b.png "/>4) add route record
650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/13/46236d8d6cb79cebf88e7bef18651973.png "title=" Picture 2.png "alt=" 46236d8d6cb79cebf88e7bef18651973.png "/>
5 ) Open a 80-port-based virtual service
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/13/200072b10e61902455df59ab20302db3.png "title=" Picture 3.png "alt=" 200072b10e61902455df59ab20302db3.png "/>
6) Configure Realserver
650) this.width=650; "src=" Https://s1.51cto.com/oss/201711/13/30a514d503ba0de6c6fa741103e6a8ef.png "title=" Picture 4.png "alt=" 30a514d503ba0de6c6fa741103e6a8ef.png "/>
650) this.width=650; "src=" Https://s2.51cto.com/oss/201711/13/7c1cc17b509630868be5ef501ffce230.png "title=" Picture 5.png "alt=" 7c1cc17b509630868be5ef501ffce230.png "/>7) Modify the kernel configuration to turn on routing forwarding
vim/etc/sysctl.conf modifying net.ipv4.ip_forward=1
Sysctl-p make it effective
8) Configure VIP to local loopback nic lo on both Realserver , and only broadcast yourself, and add loopback NIC routing
650) this.width=650; "src=" Https://s3.51cto.com/oss/201711/13/9dca7978e0fe45e30454d1e1dd635535.png "title=" Picture 6.png "alt=" 9dca7978e0fe45e30454d1e1dd635535.png "/>650) this.width=650; src=" https://s5.51cto.com/oss/ 201711/13/3b66468004ad4073d2f1e3fee751d3b0.png "title=" image 7.png "alt=" 3b66468004ad4073d2f1e3fee751d3b0.png "/>
9 ) perform the following on both Realserver so that it answers only the target IP address is the ARP query request that accesses the local address of the network interface, using the most appropriate local address for the query target . In this mode, the source address of the IP packet is ignored and an attempt is to select a local address that can communicate with that address .
echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/lo/arp_announce
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce
Turn off selinux, firewall, start testing
This article is from the "11083860" blog, please be sure to keep this source http://11093860.blog.51cto.com/11083860/1981385
Construction of e-commerce platform based on LVS-DR model under Linux