Load balancing

To configure load balancing, you must first create services. Then, you create virtual servers and bind the services to the virtual servers. By default, the NetScaler appliance binds a monitor to each service. After binding the services, verify your configuration by making sure that all of the settings are correct.

Note: After you deploy the configuration, you can display statistics that show how the entities in the configuration are performing. Use the statistical utility or the stat lb vserver <vserverName> command.

Optionally, you can assign weights to a service. The load balancing method then uses the assigned weight to select a service. For getting started, however, you can limit optional tasks to configuring some basic persistence settings, for sessions that must maintain a connection to a particular server, and some basic configuration-protection settings.

The following flow chart illustrates the sequence of the configuration tasks.

Figure 1. Sequence of Tasks to Configure Load Balancing

image

Enable load balancing

Before configuring load balancing, make sure that the load balancing feature is enabled.

To enable load balancing by using the CLI

At the command prompt, type the following commands to enable load balancing and verify that it is enabled:

  • enable feature lb
  • show feature

    Example

    ``` pre codeblock

    enable feature lb Done show feature

      Feature                  Acronym          Status
      -------                  -------          ------   1)  Web Logging              WL               OFF   2)  Surge Protection         SP               OFF   3)  Load Balancing           LB               ON   .   .   .   9)  SSL Offloading           SSL              ON   .   .   .  Done  ```
    

To enable load balancing by using the GUI

  1. In the navigation pane, expand System, and then click Settings.
  2. In the details pane, under Modes and Features, click Change basic features.
  3. In the Configure Basic Features dialog box, select the Load Balancing check box, and then click OK.
  4. In the Enable/Disable Feature(s)? message, click Yes.

Configure services and a virtual server

When you have identified the services you want to load balance, you can implement your initial load balancing configuration by creating the service objects, creating a load balancing virtual server, and binding the service objects to the virtual server.

To implement the initial load balancing configuration by using the CLI

At the command prompt, type the following commands to implement and verify the initial configuration:

  • <add service <name> <IPaddress> <serviceType> <port>

  • <add lb vserver <vServerName> <serviceType> [<IPaddress> <port>]

  • <bind lb vserver <name> <serviceName>

  • <show service bindings <serviceName>

    Example

     > add service service-HTTP-1 10.102.29.5 HTTP 80
      Done
     > add lb vserver vserver-LB-1 HTTP 10.102.29.60 80
      Done
     > bind lb vserver vserver-LB-1 service-HTTP-1
      Done
     > show service bindings service-HTTP-1
        service-HTTP-1 (10.102.29.5:80) - State : DOWN
    
          1)      vserver-LB-1 (10.102.29.60:80) - State : DOWN
      Done
    

To implement the initial load balancing configuration by using the GUI

  1. Navigate to Traffic Management > Load Balancing.
  2. In the details pane, under Getting Started, click Load Balancing wizard, and follow the instructions to create a basic load balancing setup.
  3. Return to the navigation pane, expand Load Balancing, and then click Virtual Servers.
  4. Select the virtual server that you configured and verify that the parameters displayed at the bottom of the page are correctly configured.
  5. Click Open.
  6. Verify that each service is bound to the virtual server by confirming that the Active check box is selected for each service on the Services tab.

Load balancing