Get the App
SLTechnology News&Howtos  ›  Database  › 

The most efficient cluster in LVS+Keepalived (actual combat)

Shulou Source: shulou.com Published: 2022-06-01 16:07:35 10月02日 Update

Restart script: [root@localhost init.d] # service web.sh stopSIOCDELRT: No such deviceRealServer Stopd [1]-complete firefox "http://127.0.0.1"[2]+ complete firefox" http://127.0.0.1"[root@localhost init.d] # service web.sh start RealServer Start OK at this time the first node server configuration is complete! Operation of node server CentOS 7-5: [root@localhost ~] # rpm-Q httpdhttpd-2.4.6-90.el7.centos.x86_64 [root@localhost ~] # systemctl start httpd [root@localhost ~] # systemctl stop firewalld.service [root@localhost ~] # setenforce 0 [root@localhost html] # cd / etc/sysconfig/network-scripts/ [root@localhost network-scripts] # lsifcfg-ens33 ifdown-ppp ifup-ib ifup-Teamifcfg-lo ifdown- Routes ifup-ippp ifup-TeamPort [root@localhost network-scripts] # cp ifcfg-lo ifcfg-lo:0 [root@localhost network-scripts] # vim ifcfg-lo:0// delete everything you don't need Then, after the DEVICE=lo:0IPADDR=192.168.100.10NETMASK=255.255.255.0ONBOOT=yes// modification is completed, enter: wq save exit [root@localhost ~] # cd / var/www/html/ [root@localhost html] # echo "this is benet web" > index.html [root@localhost network-scripts] # cd / etc/init.d/ [root@localhost init.d] # vim web.shangxinxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Sbin/ifconfig lo:0$ VIP netmask 255.255.255.255 broadcast $VIP / sbin/route add-host $VIP dev lo:0 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 Sysctl-p > / dev/null 2 > & 1 echo "RealServer Start OK" ; stop) / sbin/ifconfig lo:0 down / sbin/route del $VIP / dev/null 2 > & 1 echo "0" > / proc/sys/net/ipv4/conf/lo/arp_ignore echo "0" > / proc/sys/net/ipv4/conf/lo/arp_announce echo "0" > / proc/sys/net/ipv4/conf/all/arp_ignore echo "0" > / proc/sys/net/ipv4/conf/all/arp_announce echo "RealServer Stoped" *) echo "Usage: $0 {start | stop}" exit 1 Enter: wq save exit [root@localhost init.d] # chmod + x web.sh [root@localhost init.d] # service web.sh start RealServer Start OK [root@localhost init.d] # ifup lo:0 [root@localhost html] # firefox "http://127.0.0.1" & [1] 8767 / / the Firefox browser automatically executes in the background when the process is 8767. If the process is 8767, the browser will pop up automatically. It will display the content of the web page we wrote before.

!

Restart script: [root@localhost init.d] # service web.sh stopSIOCDELRT: No such deviceRealServer Stopd [1] + complete firefox "http://127.0.0.1"[root@localhost init.d] # service web.sh start RealServer Start OK use win7-1 client to verify LVS: set the Nic to host only, and bind the gateway ipv4 to a static address:

C:\ Users\ zhou > ping 192.168.100.10 Ping 192.168.100.10 has 32 bytes of data: reply from 192.168.100.10: byte = 32 time

Tags: Input content service server network card address multiline scheduling byte time browser browse configuration success function node process authentication host customer Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Microsoft Shulou Technology Shulou Tech Info Shulou Information