0% found this document useful (0 votes)
38 views3 pages

Keepalived Configuration for LVS Setup

This document outlines the configuration of LVS load balancing on a master and backup server using Keepalived. It describes: 1) Installing and configuring Keepalived on both servers to manage virtual IPs and monitor server status. 2) Configuring two virtual IPs - one external at 172.168.0.100 and one internal at 172.168.1.100 to balance traffic between two Apache web servers at 172.168.1.201 and 172.168.1.202. 3) The Keepalived configuration file assigns the master high priority to manage the virtual IPs and load balance the web traffic.

Uploaded by

EisenPicon
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views3 pages

Keepalived Configuration for LVS Setup

This document outlines the configuration of LVS load balancing on a master and backup server using Keepalived. It describes: 1) Installing and configuring Keepalived on both servers to manage virtual IPs and monitor server status. 2) Configuring two virtual IPs - one external at 172.168.0.100 and one internal at 172.168.1.100 to balance traffic between two Apache web servers at 172.168.1.201 and 172.168.1.202. 3) The Keepalived configuration file assigns the master high priority to manage the virtual IPs and load balance the web traffic.

Uploaded by

EisenPicon
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

--configuracion LVS

Paso 1: apt-get update


Paso 2: apt-get upgrade
Paso 3: apt-get install keepalived
Paso 4: vi /etc/keepalived/[Link]
Paso 5: echo 1 /proc/sys/net/ipv4/ip_forward
Paso 6: systemctl restart [Link]
Paso 7: ip addr list
Paso 8: ipvsadm -L -n

clone machines virtuals

eisen@master:~$ hostnamectl set-hostname backup

---grafic interface
sudo apt-get install ubuntu-desktop

Master:
ipvirtual fuera: [Link]
ipRealdefuera: [Link] ens34
ipRealdedentro: [Link] ens39

Backup:
ipvirtual fuera: [Link] ens34
ipRealdedentro: [Link] ens39

ipvirtualdedentro
[Link]

----------------------------------------------

sudo apt-get install apache2

apache1
ip:[Link] ens34
Gw:[Link]

cat /var/www/html/[Link]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<p>Servidor Apache apache1 con ip [Link]</p>
</body>
</html>
apache2
ip:[Link] ens39
Gw:[Link]

cat /var/www/html/[Link]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
</head>
<body>
<p>Servidor Apache apache2 con ip [Link]</p>
</body>
</html>

sudo vi /etc/keepalived/[Link]

global_defs {
! notification_email {
! root@[Link]
! }
! notification_email_from root@[Link]
! smtp_server [Link]
! smtp_connect_timeout 30
! router_id LVS_Server
}
vrrp_sync_group interfacesRouter1 {
group {
ipvirtualDeDentro
ipvirtualDeFuera
}
}
vrrp_instance ipvirtualDeDentro {
state master
# monitored interface
interface ens39
lvs_sync_daemon_interface ens39
# virtual router's ID
virtual_router_id 51
# set priority (change this value on each server)
# (large number means priority is high)
priority 150
# VRRP sending interval
advert_int 1
# authentication info between Keepalived servers
authentication {
auth_type PASS
auth_pass 1234
}
virtual_ipaddress {
# virtual IP address
[Link]
}
}
vrrp_instance ipvirtualDeFuera {
state master
# monitored interface
interface ens34
lvs_sync_daemon_interface ens34
# virtual router's ID
virtual_router_id 52
# set priority (change this value on each server)
# (large number means priority is high)
priority 150
# VRRP sending interval
advert_int 1
# authentication info between Keepalived servers
authentication {
auth_type PASS
auth_pass 1234
}
virtual_ipaddress {
# virtual IP address
[Link]
}
}
virtual_server [Link] 80 {
# monitored interval
delay_loop 30
lb_algo rr
lb_kind NAT
net_mask [Link]
protocol TCP
real_server [Link] 80 {
weight 1
TCP_CHECK {
connect_port 80
connect_timeout 3
}
}
real_server [Link] 80 {
weight 1
TCP_CHECK {
connect_port 80
connect_timeout 3
}
}
}

You might also like