Go to main content

Configuring an Oracle® Solaris 11.4 System as a Router or a Load Balancer

Exit Print View

Updated: November 2020
 
 

Use Case: Configuring an Integrated Load Balancer

This sample case describes how to set up ILB to use a half-NAT topology to load balance traffic among two servers. It assumes the following:

  • Two servers have the IP addresses 192.0.2.50 and 192.0.2.60, respectively.

  • The name of the server group is srvgrp1.

  • The back-end servers are set up to use ILB as the default router in this scenario.

In the example, after the applications are started on the two servers, a simple TCP level health check hc-srvgrp1 is created that probes for the availability of the server application. If the server is not reachable after 3 tries, the server is marked as dead.

$ ilbadm create-sg -s servers=192.0.2.50,192.0.2.60 srvgrp1

FirstServer$ route add -p default 192.0.2.33
SecondServer$ route add -p default 192.0.2.33

At this stage, you would start the applications on both servers.

The next two commands create the health check and the load balancing rule.

$ ilbadm create-hc -h hc-test=tcp,hc-timeout=3, \
   hc-count=3,hc-interval=60 hc-srvgrp1 

$ ilbadm create-rule -e -p -i vip=203.0.113.20,port=5000 -m \
   lbalg=rr,type=half-nat,pmask=27 \
   -h hc-name=hc-srvgrp1 -o servergroup=srvgrp1 rule1_rr

For additional examples of how to configure and deploy ILB, refer also to the following sources: