(1) configure basic environment
//Install virtual tools #cd /media/VMware\ Tools/ #cp VMwareTools-10.0.6-3595377.tar.gz/tmp/ #cd /tmp/ #tar-xvzf VMwareTools-10.0.6-3595377.tar.gz #cd vmware-tools-distrib/ #./vmware-install.pl
Stop and shut down the NetworkManager service: service NetworkManager status
#service NetworkManager stop #chkconfig--level 2345 NetworkManager off //Temporarily shut down SELinux: "setenforcer" 0 //Permanently shut down SELinux: /etc/selinux/config //7 SELINUX=disabled
#iptables -F //Clear firewall rules #service iptables save
Modify host name
#vi /etc/hosts 1 127.0.0.1 localhost node1 node1.edu.cn 2 ::1 localhost node1 node1.edu.cn #vi /etc/sysconfig/network 2 HOSTNAME=node1.edu.cn
Configure local YUM source
#cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.ba #vi /etc/yum.repos.d/CentOS-Base.repo 1 [dvd] 2 name=install dvd 3 baseurl=file:///media/Centos_6.5_Final 4 enable=1 5 gpgcheck=1 6 pgpkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
#yum clean all
#yum makecache
(2) configure the network of each server (Real1 and Real2 are the same)
[root@real1 desktop]#setup [root@real1 desktop]#vi /etc/sysconfig/network-scripts/ifcfg-eth0 //ONBOOT=yes[root@real1 desktop]#service network restart
(3) LVS configures IP address and adds VIP:
ifconfig eth0:0 192.168.0.100 broadcast 192.168.0.255 netmask 255.255.255.0 up
(4) LVS sets load balance entry:
#yum install ipvsadm -y #internet protocol virtual server admin Internet protocol virtual server manager #ipvsadm -A -t 192.168.1.100:80 -s rr (-A Add to virtual server) #ipvsadm -a -t 192.168.1.100:80 -r 192.168.1.12:80 -g #ipvsadm -a -t 192.168.1.100:80 -r 192.168.1.13:80 -g
(5) LVS makes the configuration permanent
#ipvsadm -save>/etc/sysconfig/ipvsadm
#systemctl enable ipvsadm
(6) set up web server
Configure web services on two web servers:
#echo "this is real 2222"> /var/www/html/index.html #server httpd For two. web Server lo The network card is configured with 32-bit subnet mask. VIP:
rs1:#ifconfig lo:0 192.168.0.123/32rs2:#ifconfig lo:0 192.168.0.123/32
Set kernel parameters for two web servers (rs1\rs2)
#Echo 1 > / proc / sysconfig / network / IPv4 / config / all / arp_igonre / / ignore ARP response, do not allow to receive #Echo 2 > / proc / sysconfig / network / IPv4 / config / all / arp_announcement / / let the ARP be sent out. Sending is not allowed.
(7) client test (ctrl+F5)
#curl http://192.168.0.100