Basic NetScaler Loadbalancing Configuration

With Cisco discontinuing all support on the ACE in the next few months, many companies will need to replace their load-balancing platform.  This post will look at how to configure a Citrix NetScaler for basic load balancing between three web servers.

Our topology

We need to configure the following:

  • Create a VIP using address 192.168.99.45 listening on port 80
  • The services behind that VIP should be 192.168.99.140, 192.168.99.141, and 192.168.99.142, all listening on port 500
  • The monitor should be an HTTP GET to /probe.html on port 500
  • You should be redirected to https://www.google.com when all servers are down
  • No session persistence should be configured.

Now, there are two ways we can tackle this, either from the CLI or from the GUI. This will be configured from the CLI. We are going to tackle this in the following manner,

  • Configure the monitor
  • Set up the servers, then the services, and bind the monitor to the service.
  • Create the VIP and bind the services to the VIP

Configuration:

Virtual_NS> add lb monitor HTTP-GET HTTP-ECV -send "GET /probe.html" -recv "OK" -destPort 500
Virtual_NS> add server RED-SERVER 192.168.99.140
Virtual_NS> add server BLUE-SERVER 192.168.99.141
Virtual_NS> add server PURPLE-SERVER 192.168.99.142
Virtual_NS> add service RED-SERVICE RED-SERVER HTTP 500
Virtual_NS> add service BLUE-SERVICE BLUE-SERVER HTTP 500
Virtual_NS> add service PURPLE-SERVICE PURPLE-SERVER HTTP 500
Virtual_NS> bind lb monitor HTTP-GET RED-SERVICE
Warning: Argument deprecated [serviceName]
Virtual_NS> bind lb monitor HTTP-GET BLUE-SERVICE
Warning: Argument deprecated [serviceName]
Virtual_NS> bind lb monitor HTTP-GET PURPLE-SERVICE
Warning: Argument deprecated [serviceName]
Virtual_NS> add lb vserver VIP-1 HTTP 192.168.99.45 80 -redirectURL "https://www.google.com"
Virtual_NS> bind lb vserver VIP-1 RED-SERVICE
Virtual_NS> bind lb vserver VIP-1 BLUE-SERVICE
Virtual_NS> bind lb vserver VIP-1 PURPLE-SERVICE
Virtual_NS>

We can use a few show commands to show that our configuration works as expected.

  • Show service (name) – shows information on how a service is configured, as well as what monitors are configured for the service
  • Show lb vserver (name) – outputs information about the vserver as well as what services are configured for it with monitor information for each service
  • Stat lb vserver (name) – This will give you connection information for the vserver you are looking up

The next post is going to look at a little more advanced NetScaler configuration; we are going to look at how to configure and verify SSL termination on the NetScaler