Configure basic load balancing on a Citrix ADC VPX appliance
www.example.com. To ensure application availability, the site is hosted on three servers, S1, S2, and S3. A load balancing virtual server, LBVS-1, on a Citrix ADC appliance NS-1 is used to load balance these servers. SVC-1, SVC-2, and SVC-3 are services created on Citrix ADC appliance NS-1 representing S1, S2, and S3.
Before you begin
-
You have deployed a Citrix ADC VPX appliance and the appliance is UP and running in your setup. For more information, see Deploy a Citrix ADC VPX instance.
-
You have added a subnet IP (SNIP) address on the Citrix ADC appliance. A Citrix ADC uses a subnet IP (SNIP) address as a source IP address to proxy client connections to servers. For more information, see Configuring Subnet IP Addresses.
-
You have a basic understanding of the load balancing feature of a Citrix ADC appliance. For more information, see:
-
You have a basic understading of the Citrix ADC NITRO REST APIs. For more information, see Citrix ADC NITRO API reference.
Configuration steps
-
Create a load balancing virtual server
-
Create load balancing services
-
Bind the services to the load balancing server
Create a load balancing virtual server
lbvserver object.
lbvserver object and its properties, see Citrix NITRO API reference for lbvserver.
Request structure
| Request field | Value |
|---|---|
| HTTP Method | POST |
| URL | http://<Citrix-ADC-IP-address(NSIP)>/nitro/v1/config/lbvserver |
| Request Headers | Content-Type: application/json |
| Request Payload | { "lbvserver": { "name":"<value>", "servicetype":"<value>", "ipv46": "<value>", "port": "<value>", } }Example:{ "lbvserver": { "name":"LBVS-1", "servicetype":"HTTP", "ipv46": "203.0.113.10", "port": 443 } } |
Create load balancing services
service object.
service object and its properties, see Citrix NITRO API reference for service.
Request structure
| Request field | Value |
|---|---|
| HTTP Method | POST |
| URL | http://<Citrix-ADC-IP-address(NSIP)>/nitro/v1/config/service |
| Request Headers | Content-Type: application/json |
| Request Payload | {"service": { "name": "<service name>", "ip": "<IP address of the server>", "servicetype": "HTTP", "port": 443 }}Example:{"service": { "name": "SVC-1”, "ip": "192.0.2.10", "servicetype": "HTTP", "port": 443 }} |
Bind the services to the load balancing server
lbvserver_service_binding object.
lbvserver_service_binding object and its properties, see Citrix NITRO API reference for lbvserver_service_binding.
Request structure
| Request field | Value |
|---|---|
| HTTP Method | PUT |
| URL | http://<Citrix-ADC-IP-address(NSIP)>/nitro/v1/config/lbvserver_service_binding |
| Request Headers | Content-Type: application/json |
| Request Payload | {"lbvserver_service_binding": { "name": "<name of the virtual server>", "servicename": "Name of the service"}} Example:{"lbvserver_service_binding": { "name": "LBVS-1”"servicename": "SVC-1"}} |
Sample configuration
| Steps | Curl requests |
|---|---|
| Create a load balancing virtual server | curl -v -X POST -H "Content-Type: application/json" -u nsroot:examplepassword http://192.0.0.33/nitro/v1/config/lbvserver -d '{ "lbvserver": { "name":"LBVS-EN", "servicetype":"HTTP", "ipv46": "203.0.113.10", "port": 80}' |
| Create load balancing services | curl -v -X POST -H "Content-Type:application/json" -u nsroot:examplepassword http:// 192.0.0.33/nitro/v1/config/service -d '{"service": { "name": "SVC-EN-1", "ip": "192.0.2.10", "servicetype": "HTTP", "port": 80 } }' curl -v -X POST -H "Content-Type:application/json" -u nsroot:examplepassword http:// 192.0.0.33/nitro/v1/config/service -d '{"service": { "name": "SVC-EN-2", "ip": "192.0.2.30", "servicetype": "HTTP", "port": 80 } }' curl -v -X POST -H "Content-Type:application/json" -u nsroot:examplepassword http:// 192.0.0.33/nitro/v1/config/service -d '{"service": { "name": "SVC-EN-3", "ip": "192.0.2.30", "servicetype": "HTTP", "port": 80 } }' |
| Bind the services to the load balancing server | curl -v -X PUT -H "Content-Type:application/json" -u nsroot:examplepassword http://192.0.0.33/nitro/v1/config/lbvserver_service_binding -d '{"lbvserver_service_binding": { "name": "LBVS-EN", "servicename": "SVC-EN-1", "weight": "1" } }' |