How to Set Up Keepalived as a Load Balancer?

0
11
Asked By WanderingNomad92 On

I've managed to get Keepalived up and running with a virtual IP, but I'm having trouble with the load balancer configuration. I've gone through a bunch of online tutorials, but I'm still hitting a wall. I can see health checks coming from both nodes, so it seems like the issue might be with my Ubuntu setup. I'm wondering if it's a problem with iptables or the way loopback addresses are configured so the kernel can manage the packets correctly. Any guidance on where to start troubleshooting this?

4 Answers

Answered By CloudAdventurer On

Why not consider using HAProxy? It’s free, works smoothly with VRRP-keepalived, and is pretty easy to set up without too much hassle on the Linux side.

WanderingNomad92 -

I thought about that since I’m stuck with Keepalived. HAProxy seems great but I’m not sure how well it will be supported given my current setup. Still, if getting Keepalived to work turns into a bigger headache, I might have to reconsider.

Answered By NetworkNinja On

So you have two nodes running Keepalived to share a VIP, right? Are both servers sending traffic to your application servers?

WanderingNomad92 -

Exactly! I want the virtual server setup to send TCP checks to the app servers, and I can confirm that I see them with tcpdump. The missing piece is that when I hit the VIP, the traffic isn't routing out to the web servers as expected. I suspect it's related to the virtual server not binding to the VIP – does that make sense? I think it’s more of an OS issue than a Keepalived one.

Answered By LinuxLover1985 On

I can help out! Please post your keepalived.conf and network configurations from all interfaces, as it’s tough to diagnose without that info. Just a tip – I found that the nonlocal IP settings via sysctl might not be necessary for your case. Binding the VIP to the loopback or setting up a dummy non-arping interface could be simpler.

WanderingNomad92 -

Here's my config:
Server IP: 192.168.201.211, VIP: 192.168.201.210, Target: 192.168.201.222, Port: 9000. I feel like the issue might be on the OS side in terms of handling incoming requests on the VIP port owned by Keepalived, but I’m unsure how to debug or find related logs.

HelpMePlease99 -

That sounds like a good lead! How do I reconfigure my loopback? I tried following the site instructions but either missed something or misconfigured it. Any specific steps to take?

Answered By TechieGuru123 On

Could you share your Keepalived configuration? It’d help in understanding the setup better.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.