This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Tenant-aware Load Balancing Using the WSO2 Elastic Load Balancer
WSO2 Elastic Load Balancer is currently retired.
Tenant partitioning is required in a clustered deployment to be able to scale to large numbers of tenants. There can be multiple clusters for a single service and each cluster would have a subset of tenants as illustrated in the diagram below. In such situations, the load balancers need to be tenant aware in order to route the requests to the required tenant clusters. They also need to be service aware since it is the service clusters which are partitioned according to the clients.
The following example further illustrates how this is achieved in WSO2 Elastic Load Balancer (ELB).
A request sent to a load balancer has the following host header to identify the cluster domain:
https://appserver.cloud-test. wso2.com/carbon.as1.domain/carbon/admin/login.jsp
In this URL:
appserver.cloud-test.wso2.com
is the service domain which allows the load balancer to identify the service.carbon.as1.domain.com
is the tenant domain which allows the load balancer to identify the tenant.
Services are configured with their cluster domains and tenant ranges in the in ELB_HOME/repository/conf/
file. These cluster domains and tenant ranges are picked by the load balancer when it loads.loadbalancer.conf
The following is a sample configuration of the loadbalancer.conf file.
appserver { # multiple hosts should be separated by a comma. hosts appserver.cloud-test.wso2.com; domains { carbon.as1.domain { tenant_range 1-100; } carbon.as2.domain { tenant_range 101-200; } } }
In the above configuration, there is a host address which maps to the application server service. If required, you can enter multiple host addresses separated by commas.
There are two cluster domains defined in the configuration. The cluster domain named carbon.as1.domain
is used to load the range of tenants with IDs 1-100. The other cluster domain named carbon.as2.domain
is used to load the tenants with IDs 101-200.
If the tenant ID of abc.com
is 22, the request will be directed to the Carbon.AS1.domain
cluster.