How to Set up LSWS as a Load Balancer

This example uses 3 servers:

back1.litespeedtech.com with IP *.*.*.151
back2.litespeedtech.com with IP *.*.*.152
load.litespeedtech.com  with IP *.*.*.153

back1 and back2 will act as 2 back-end nodes, and load will act as load balancer.

Verify the 3 Servers are Working

The 3 servers are deliberately set to display different content to distinguish them from each other.

Create a New External App

Create a new external app in the load balancer server. This is can be done either at server level or the vhost level.

Choose Type Web Server.

Set Name to back1. This name will be used in a later step. Set Address to the IP of the first backend server.

Since this example has 2 back-end nodes, repeat the previous step to create a 2nd external app with name back2 and its corresponding IP address.

Now create another external app, with Type Load Balancer, and set Workers to proxy::back1,proxy::back2 (these names were created in the previous steps).

There should be 3 external apps as follows:

Now create a new context with Type Load Balancer, and in this example, set URI to / for a full-site proxy.

Since 3 servers are using 3 different domains, now add load.litespeedtech.com domain to each of the back-end nodes' listeners.

Graceful restart all 3 LSWS instances.

Verify The Load Balancer

Access it to verify everything is working as expected.

This Server Solution vs. LiteSpeed Web ADC

Please refer to this article

 
litespeed_wiki/proxy/lsws-as-a-load-balancer.txt · Last modified: 2018/06/13 22:30 by qtwrk