Test the network topology of lvs and keepalived load balancing on the UbuntuOSxen Virtual Machine: Virtual Machine manager and xen Virtual Machine instance: Step 1: Install LVS and keepalived: Install the LVS and keepalived software on the ctor server, respectively, run $ sudoapt-getinstallipvsadm to install keepalived. Run the following command: $ su.
Test lvs and keepalived load balancing on the Ubuntu OS xen Virtual Machine
Network Topology:
Virtual Machine manager and xen Virtual Machine instance:
Step 1:InstallLVSAndKeepalived:InDirectorOn the server, installLVSAndKeepalivedSoftware, use the command:
$ Sudo apt-get install ipvsadm
InstallationKeepalived, Run the following command:
$ Sudo apt-get installkeepalived
Step 2: ConfigurationKeepalived: After installation/Etc/keepalivedDirectoryKeepalived. confFile, write the configuration file as follows:
# Global Configuration
Global_defs {
Lvs_id director1
}
# VRRP Configuration
Vrrp_instance LVS {
State MASTER
Interface eth0
Virtual_router_id 51
Priority150
Advert_int 1
Authentication {
Auth_type PASS
Auth_pass 123456
}
Virtual_ipaddress {
192.168.122.38
}
# Virtual ServerConfiguration-for WWW service
Virtual_server 192.168.122.3880 {
Delay_loop 1
Lb_algo rr
Lb_kind DR
Persistence_timeout 60
Protocol TCP
# Real Server 1 configuration
Real_server 192.168.122.36 80 {
Weight 3
TCP_CHECK {
Connection_timeout 10
Nb_get_retry 3
Delay_before_retry 3
}
Real_server 192.168.122.37 80 {
Weight 1
TCP_CHECK {
Connection_timeout 10
Nb_get_retry 3
Delay_before_retry 3
}
}
}