Skip to content

Laurent-Bardi/ULB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ultra Load Balancer : Ever wanted to have an always responding DNS or LDAP server : ULB is for you!

Prereq

  • Not working with network-manager
  • Only tested on Debian 12 Bookworm.
  • Only in IPv4
You need 2 machines (physical, vm or container) with at least 2 network interfaces. The first interface is the management of the machine, the second will be the load-balanced redirector.

shema3

In my example, I will use 2 machines with each two interfaces. So on each machine you will have :

  • ens19 the interface in data LAN that speaks to servers and clients
  • ens18 the interface in management LAN for managing ULB.

So, let's start the installation :

On each machine do git clone https://github.com/Laurent-Bardi/ULB.git cd ULB

Here the installation script is install_ulb.pl v1.00 usage : install_ulb.pl -h => help install_ulb.pl -p path -i interface_name -a real_ip_for_carp -b virtual_ip_for_carp -n vhid [-m] => install ULB => -p path : where to install => -i interface_name name of the interface that will received carp process => -a real ip => -b virtual ip => -m if present will be the ucarp master => -n vhid identifier [1..255] => master example install_ulb.pl -p /usr/local/ULB -i ens19 -a 10.56.64.18 -b 10.56.65.8 -n 8-m => slave example install_ulb.pl -p /usr/local/ULB -i ens19 -a 10.56.64.19 -b 10.56.65.8 -n 8 some explanations : regarding the schema

  • -p the path where all the ULB files (scripts, data, config) should stay (generally /opt/ULB or /usr/local/ULB)
  • -a parameter stands for IPrb1 for the first machine and IPrb2 for the second. It will be the real load-balancer IP on the data subnet
  • -b parameter stands for IPrb1-rb2 it is the virtual IP that will float between the interface on the machines (on ens19 in my case)
  • -n is the vhid parameter, between 1 and 255 it must be UNIQUE on the network (otherwise ucarp would mix theirs configurations)
  • -m is master (the one who will own, at first, the virtual IPrb1-rb2). MUST BE ON ONLY ON ONE OF THE TWO MACHINES

first machine

perl install_ulb.pl -p /usr/local/ULB -i ens19 -a 10.56.64.18 -b 10.56.65.8 -n 8 -m

second machine

perl install_ulb.pl -p /usr/local/ULB -i ens19 -a 10.56.64.19 -b 10.56.65.8 -n 8

Here you see that the first machine will became the master. You are welcome to test by rebooting /making shutdown-restart of the machine that virtual IPrb1-rb2 move from one machine to the other.

Security : on the 2 machines, edit the file /etc/network/interfaces.d/ucarp_$interface (the one you use with -i parameter when doing install) and change "ucarp-password totolitoto" with a password of max 20 characters.

Redirectors

Now we are going to define what redirectors we want. Each must be run on the two machines (otherwise they will not make the same redirections).

Example 1 DNS

Suppose we have three DNS servers (can be the number you want)
  • 10.64.200.61
  • 10.64.200.71
  • 10.64.200.81
The virtual IP (IPrb1-rb2) is 10.56.65.8.
Then the code will be # get in the ULB path cd /usr/local/ULB # get in the prog cd sbin # create a TCP farm perl create_farm.pl -n dns_udp -d 10.56.65.8:53 -p U -c 10.64.200.61:53,10.64.200.71:53,10.64.200.81:53 #then an UDP farm perl create_farm.pl -n dns_udp -d 10.56.65.8:53 -p T -c 10.64.200.61:53,10.64.200.71:53,10.64.200.81:53 do the same on the second machine (same command lines)

And then launch on the master perl launch_all_farm.pl

Example 2 Global Catalog MS Active Directory

Suppose we have three AD servers (can be the number you want)
  • 10.64.200.61
  • 10.64.200.71
  • 10.64.200.81
The virtual IP (IPrb1-rb2) is 10.56.65.8.
Then the code will be # get in the ULB path cd /usr/local/ULB # get in the prog cd sbin # create a TCP farm perl create_farm.pl -n dns_udp -d 10.56.65.8:3268 -p U -c 10.64.200.61:3268,10.64.200.71:3268,10.64.200.81:3268 do the same on the second machine (same command lines)

And then launch on the master perl launch_all_farm.pl

Example 3 LDAP

Suppose we have three LDAP servers (can be the number you want)
  • 10.64.200.61
  • 10.64.200.71
  • 10.64.200.81
The virtual IP (IPrb1-rb2) is 10.56.65.8.
Then the code will be # get in the ULB path cd /usr/local/ULB # get in the prog cd sbin # create a TCP farm perl create_farm.pl -n dns_udp -d 10.56.65.8:389 -p U -c 10.64.200.61:389,10.64.200.71:389,10.64.200.81:389 do the same on the second machine (same command lines)

And then launch on the master perl launch_all_farm.pl

Some explanations

  • in $ULB_installed_PATH/sbin you have the scripts/programs
  • in $ULB_installed_PATH/bin you have the wrappers that bind/unbind farms on the virtual IP
  • in $ULB_installed_PATH/etc you have the first free control port for redirectors
  • in $ULB_installed_PATH/var you have a file for each farm you've defined

About

Ultra Load Balancer

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages