Sure. Below is a lab manual in tabular form organized according to your requirements:
Host Name | NIC Information | Installation of applications | systems |
---|---|---|---|
Client | 192.168.2.101 | not have | RHEL8/CentOS8 |
Lvs server (DR) | DIP:192.168.2.110 VIP:192.168.40.111 |
ipvsadm | RHEL8/CentOS8 |
RS1 | RIP:192.168.2.111 | httpd | RHEL8/CentOS8 |
RS2 | RIP:192.168.2.112 | httpd | RHEL8/CentOS8 |
Each host here has its own specific features and configurations:
- Client: Used to initiate a request.
- Lvs server (DR): Acts as a load balancer, responsible for receiving and distributing traffic.
- RS1 cap (a poem)RS2: Acts as a real server and handles requests from the load balancer.
Load Balancer (LB)
-
To save the IPVS configuration.
ipvsadm --save > /etc/sysconfig/ipvsadm
-
Enable IP Forwarding.
echo "net.ipv4.ip_forward = 1" >> /etc/ sysctl -p
-
Configure the TUN interface.
ifconfig tunl0 192.168.2.200 broadcast 192.168.2.200 netmask 255.255.255.255 up
-
Create a virtual server and set up polling scheduling.
ipvsadm -A -t 192.168.2.200:80 -s rr
-
Add real servers.
ipvsadm -a -t 192.168.2.200:80 -r 192.168.2.111:80 -i ipvsadm -a -t 192.168.2.200:80 -r 192.168.2.112:80 -i
-
Disabling the firewall with SELinux.
systemctl stop setenforce 0
-
Verify the IPVS configuration.
ipvsadm -ln
Real Server 1 (RS1)
-
Start the HTTP service.
systemctl start httpd
-
Disable SELinux and firewalls.
setenforce 0 systemctl stop
-
Configure site content.
echo "this is web1" >> /var/www/html/
-
Test site.
curl 127.0.0.1
-
Configure the TUN interface.
ifconfig tunl0 192.168.2.200 broadcast 192.168.2.200 netmask 255.255.255.255 up
-
Adjust sysctl settings.
echo "net..tunl0.arp_ignore = 1" >> /etc/ echo "net..tunl0.arp_announce = 2" >> /etc/ echo "net..arp_ignore = 1" >> /etc/ echo "net..arp_announce = 2" >> /etc/ echo "net..tunl0.rp_filter = 0" >> /etc/ echo "net..rp_filter = 0" >> /etc/ sysctl -p
Real Server 2 (RS2)
-
Start the HTTP service.
systemctl start httpd
-
Disable SELinux and firewalls.
setenforce 0 systemctl stop
-
Configure site content.
echo "this is web2" >> /var/www/html/
-
Test site.
curl 127.0.0.1
-
Configure the TUN interface.
ifconfig tunl0 192.168.2.200 broadcast 192.168.2.200 netmask 255.255.255.255 up
-
Adjust sysctl settings.
echo "net..tunl0.arp_ignore = 1" >> /etc/ echo "net..tunl0.arp_announce = 2" >> /etc/ echo "net..arp_ignore = 1" >> /etc/ echo "net..arp_announce = 2" >> /etc/ echo "net..tunl0.rp_filter = 0" >> /etc/ echo "net..rp_filter = 0" >> /etc/ sysctl -p
test (machinery etc)
-
Test Load Balancer.
curl 192.168.2.200
[root@localhost ~]# curl 192.168.2.200 this is web2 [root@localhost ~]# curl 192.168.2.200 this is web1 [root@localhost ~]# curl 192.168.2.200 this is web2 [root@localhost ~]# curl 192.168.2.200 this is web1 [root@localhost ~]# curl 192.168.2.200 this is web2 [root@localhost ~]# curl 192.168.2.200 this is web1 [root@localhost ~]# curl 192.168.2.200 this is web2 [root@localhost ~]# curl 192.168.2.200 this is web1