Setup Active-Passive Cluster with Keepalived & HAProxy (Two raspberry pis)

Hussein Nasser March 20, 2020
Video Thumbnail
Hussein Nasser Logo

Hussein Nasser

@hnasr

About

Join me as we discuss various software engineering topics with examples and add fun elements to them. We always try to learn by example here in this educational Youtube channel which we believe is the right way to learn. I love Software engineering (especially the backend) and I strive to be a better software engineer every day. Join me on this journey and let us learn together. All opinions, suggestions, and tips I provide in all of this channel's content are my own. Information provided is for educational purposes only. Consider becoming a member to support the channel https://www.youtube.com/channel/UC_ML5xP23TOWKUcc-oAE_Eg/join Check out my courses https://courses.husseinnasser.com Stay awesome! Hussein Nasser, http://www.husseinnasser.com Feel free to shoot me an email [email protected] twitter: @hnasr

Video Description

UPDATE: I made a mistake on 14:24 to the config thanks for everyone for letting me know. All instances should have the same virtual_router_id. So the secondary should have 101 instead of 102. I got lucky and worked because I assigned different priorities. Sorry for the confusion. Thanks to JR E and Parth Patel for catching the mistake Red hat doc https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/load_balancer_administration/ch-initial-setup-vsa Keepalived is a routing software written in C that provides simple and robust facilities for loadbalancing and high-availability to Linux systems. In this video we will talk about this technology and implement it along side HAProxy as a high availability (failover) Chapters 0:00 Intro 2:10 What is failover? 4:30 What are we building 7:20 KeepAlived Example * What is Keepalived? * Setup Keepalived with HAProxy * VRRP/VIP * Two rapsberrypis with keepalived and haproxy sudo apt-get install keepalived sudo vim /etc/keepalived/keepalived.conf vrrp_instance pi1 { state MASTER interface eth0 virtual_router_id 101 priority 100 authentication { auth_type PASS auth_pass 1234 } virtual_ipaddress { 192.168.254.100 } } vrrp_instance pi2 { state BACKUP interface wlan0 virtual_router_id 101 priority 200 authentication { auth_type PASS auth_pass 1234 } virtual_ipaddress { 192.168.254.100 } } Red HAT Doc https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/load_balancer_administration/ch-initial-setup-vsa Stay Awesome, Hussein

Budget Gaming PC Build Essentials

AI-recommended products based on this video

Loading...
Beelink SER3 Mini Desktop PC with AMD Ryzen 3 3200U 2C/4T, 16GB DDR4 500GB PCIE3.0 X4 SSD, Dual Display Output, WiFi6/BT5.2 W-11 Pro Mini Gaming Computer

Beelink SER3 Mini Desktop PC with AMD Ryzen 3 3200U 2C/4T, 16GB DDR4 500GB PCIE3.0 X4 SSD, Dual Display Output, WiFi6/BT5.2 W-11 Pro Mini Gaming Computer

(239)
$459.00
FREE delivery Sat, Jan 3
Loading...
Beelink SER3 Mini PC, AMD Ryzen 3 3200U(14nm, 2C/4T) up to 3.5GHz, Mini Gaming Computer 16GB DDR4 RAM 500GB PCIE3.0 X4 SSD, Micro PC 4K@60Hz Dual Display, Mini Computer WiFi6/BT5.2/HTPC/W-11 Pro

Beelink SER3 Mini PC, AMD Ryzen 3 3200U(14nm, 2C/4T) up to 3.5GHz, Mini Gaming Computer 16GB DDR4 RAM 500GB PCIE3.0 X4 SSD, Micro PC 4K@60Hz Dual Display, Mini Computer WiFi6/BT5.2/HTPC/W-11 Pro

(1,251)
$329.00
FREE delivery Sat, Jan 3
Loading...
Beelink SER3 Mini PC, AMD Ryzen 3 3200U(up to 3.5GHz) 2C/4T, Mini Computer 16GB DDR4 RAM 500GB SSD, Mini Desktop Computer 4K@60Hz Dual HDMI Display WiFi6/BT5.2/WOL/HTPC/W-11 Pro

Beelink SER3 Mini PC, AMD Ryzen 3 3200U(up to 3.5GHz) 2C/4T, Mini Computer 16GB DDR4 RAM 500GB SSD, Mini Desktop Computer 4K@60Hz Dual HDMI Display WiFi6/BT5.2/WOL/HTPC/W-11 Pro

(815)
$329.00
FREE delivery Sat, Jan 3
50+ bought in past month
Loading...
MSI PRO MP251W E2 24.5-inch IPS 1920 x 1080 (FHD) Gaming Office Monitor, 120Hz, Adaptive-Synch, HDR Ready, HDMI, VGA Port, Display Port,VESA Mountable, Tilt, Speaker, 4-Side Slim Bezel,1ms, White

MSI PRO MP251W E2 24.5-inch IPS 1920 x 1080 (FHD) Gaming Office Monitor, 120Hz, Adaptive-Synch, HDR Ready, HDMI, VGA Port, Display Port,VESA Mountable, Tilt, Speaker, 4-Side Slim Bezel,1ms, White

(447)
$145.99$109.99
$42.66 delivery Jan 12 - 16
100+ bought in past month
Loading...
MSI PRO MP271A E2 27-inch IPS 1920 x 1080 (FHD) Gaming Office Monitor, 120Hz, Free-Sync, HDMI, DisplayPort, VGA Port, VESA Mountable, Tilt, Speaker, 4-Side Slim Bezel 1ms, Black

MSI PRO MP271A E2 27-inch IPS 1920 x 1080 (FHD) Gaming Office Monitor, 120Hz, Free-Sync, HDMI, DisplayPort, VGA Port, VESA Mountable, Tilt, Speaker, 4-Side Slim Bezel 1ms, Black

(360)
$199.99$114.99
$30.75 delivery Jan 7 - 8
200+ bought in past month
Loading...
MSI PRO B650-S WiFi ProSeries Motherboard (Supports AMD Ryzen 7000 Series Processors, AM5, DDR5, PCIe 4.0, M.2 Slots, SATA 6Gb/s, USB 3.2 Gen 2, HDMI/DP, Wi-Fi 6E, 2.5Gbps LAN, ATX)

MSI PRO B650-S WiFi ProSeries Motherboard (Supports AMD Ryzen 7000 Series Processors, AM5, DDR5, PCIe 4.0, M.2 Slots, SATA 6Gb/s, USB 3.2 Gen 2, HDMI/DP, Wi-Fi 6E, 2.5Gbps LAN, ATX)

(372)
$174.99$157.49
FREE delivery Sat, Jan 3
100+ bought in past month
Loading...
MSI Pro MP341CQ, 34" Monitor, 3440 x 1440(UWQHD) VA, 100Hz, TUV Certified Eyesight Protection, 4ms, Displayport, HDMI, Tilt

MSI Pro MP341CQ, 34" Monitor, 3440 x 1440(UWQHD) VA, 100Hz, TUV Certified Eyesight Protection, 4ms, Displayport, HDMI, Tilt

(78)
$279.99$265.99
FREE delivery Sat, Jan 3Only 7 left in stock.
Loading...
Corsair Vengeance LPX 32GB (2 X 16GB) DDR4 3200 (PC4-25600) C16 1.35V Desktop Memory - Black
Best Seller

Corsair Vengeance LPX 32GB (2 X 16GB) DDR4 3200 (PC4-25600) C16 1.35V Desktop Memory - Black

(16,675)
$112.99$101.69
FREE delivery Sun, Aug 10
500+ bought in past month
Loading...
Skytech Archangel Gaming PC Desktop – AMD Ryzen 5 3600 3.6 GHz, NVIDIA RTX 3060, 1TB NVME SSD, 16GB DDR4 RAM 3200, 600W Gold PSU, 11AC Wi-Fi, Windows 11 Home 64-bit

Skytech Archangel Gaming PC Desktop – AMD Ryzen 5 3600 3.6 GHz, NVIDIA RTX 3060, 1TB NVME SSD, 16GB DDR4 RAM 3200, 600W Gold PSU, 11AC Wi-Fi, Windows 11 Home 64-bit

(31)
$2,657.01$2,656.90
FREE delivery Feb 24 - Mar 3
Loading...
MSI Thin 15 15.6" 144Hz Gaming Laptop, Intel® Core™ 5-210H, RTX 4050, 16GB DDR5, 1TB NVMe SSD, Windows 11 Home

MSI Thin 15 15.6" 144Hz Gaming Laptop, Intel® Core™ 5-210H, RTX 4050, 16GB DDR5, 1TB NVMe SSD, Windows 11 Home

(6)
$1,099.00
FREE delivery Mon, Feb 16
Loading...
Fanless Mini PC 13th Gen Core i7 1355U(10C/12T), Win11 Pro Mini Desktop PC Dual 2.5G LAN Mini PC Fanless, Iris Xe Graphics, Dual HD+ DP Triple Display, USB-C, WiFi6, BT5.2, 64GB RAM 1TB NVME SSD

Fanless Mini PC 13th Gen Core i7 1355U(10C/12T), Win11 Pro Mini Desktop PC Dual 2.5G LAN Mini PC Fanless, Iris Xe Graphics, Dual HD+ DP Triple Display, USB-C, WiFi6, BT5.2, 64GB RAM 1TB NVME SSD

(12)
$1,212.00
FREE delivery Aug 21 - Sep 4
Loading...
Beelink SER5 MAX Mini PC, AMD Ryzen 7 6800U(8C/16T, Up to 4.7GHz), Mini Computer 32G LPDDR5 RAM 1TB NVMe PCIE4.0 SSD, Mini Desktop Computer 4K@144Hz Triple Display HDMI2.1/DP/WiFi6/BT5.2/W-11 Pro

Beelink SER5 MAX Mini PC, AMD Ryzen 7 6800U(8C/16T, Up to 4.7GHz), Mini Computer 32G LPDDR5 RAM 1TB NVMe PCIE4.0 SSD, Mini Desktop Computer 4K@144Hz Triple Display HDMI2.1/DP/WiFi6/BT5.2/W-11 Pro

(656)
$569.00
FREE delivery Sun, Aug 10
Loading...
Western Digital 2TB WD Blue SA510 SATA Internal Solid State Drive SSD - SATA III 6 Gb/s, 2.5"/7mm, Up to 560 MB/s - WDS200T3B0A

Western Digital 2TB WD Blue SA510 SATA Internal Solid State Drive SSD - SATA III 6 Gb/s, 2.5"/7mm, Up to 560 MB/s - WDS200T3B0A

(74,910)
$169.97
FREE delivery Tue, Jun 17
50+ bought in past month
Loading...
Logitech G203 Wired Gaming Mouse, 8,000 DPI, Rainbow Optical Effect LIGHTSYNC RGB, 6 Programmable Buttons, On-Board Memory, Screen Mapping, PC/Mac Computer and Laptop Compatible - Black
Best Seller

Logitech G203 Wired Gaming Mouse, 8,000 DPI, Rainbow Optical Effect LIGHTSYNC RGB, 6 Programmable Buttons, On-Board Memory, Screen Mapping, PC/Mac Computer and Laptop Compatible - Black

(17,871)
$27.98$22.38
FREE delivery Tue, Oct 14 on your first order
500+ bought in past month
Loading...
CORSAIR Hydro X Series iCUE Link XH405i Custom Cooling Kit – Hardline Water Cooling Loop – XC7 Elite CPU Water Block – XD5 Elite D5 Pump Res – XR5 360mm Radiator – 3X QX120 RGB Fans

CORSAIR Hydro X Series iCUE Link XH405i Custom Cooling Kit – Hardline Water Cooling Loop – XC7 Elite CPU Water Block – XD5 Elite D5 Pump Res – XR5 360mm Radiator – 3X QX120 RGB Fans

(235)
$879.99
FREE delivery Sun, Aug 24