Whether you’re new to load-balancing or an experienced veteran, Citrix NetScaler 9 makes it simple. With its new feature, AppExpert, you can create templates for your custom web applications. You can also download templates for common apps, such as for Microsoft SharePoint and Outlook Web Access, from the Citrix Community website.
Load-balancing — the act of distributing load, or work, across two or more servers — improves application delivery and (because your servers function independently) allows you to take a server down for maintenance without disrupting service. (To learn more about load-balancing and read a review of NetScaler 9, go here.) Below we will examine how AppExpert works, using the most basic example of load-balancing: two web servers displaying the same, static content.
The environment in this example consists of two web servers, a client and a Citrix NetScaler. You also need a virtual IP address (VIP) for the website you’re going to load-balance. The VIP is the address your clients will use to connect to the website. You can always assign a host record in a Domain Name System (DNS) server that translates your friendly name into that VIP.
Each web server has the exact same site installed on port 8080. If the client navigates to either 192.168.96.2:8080 or 192.168.96.3:8080, the server will deliver your website’s content. NetScaler 9 will be configured to work on 192.168.96.120, and then contact either of the two web servers to retrieve content for the user. NetScaler’s management interface is available through 192.168.96.100.
Setting up a load-balanced application using AppExpert can be accomplished in five steps. With practice, you can complete the job in three minutes.
Step One: Download a template or create your own.
I recommend downloading a template for your first try from the Citrix Community website. In this example, there are two simple websites, so I downloaded the generic website template: GenericTemplateNS9.0b65GA.gz. Once you’re more familiar with the tool, you can try other templates or customize the generic template for your own purposes.
Step Two: Log on to NetScaler’s web interface and import the template.
Logging into NetScaler is simple: Just open a browser and point it to the management interface, which has been configured here as 192.168.96.100:
Navigation is pretty easy: Each of the folders on the left can be expanded by clicking on them, and they automatically collapse when you click on another. We are interested in AppExpert, so click on that and then on Applications:
Currently, there are no applications. Let’s import the file that was downloaded from the Citrix Community site:
GenericTemplateNS9.0b65GA.gz. To do that, simply click on Import at the bottom of the frame, and follow the prompts to select the file. You will be prompted to begin the configuration of the application. You could do the complete configuration from this dialogue, but it is more instructive to do it in pieces in the steps that follow instead of using the wizard. That way, you will see what you’re doing and will better understand how to change things later. For now, just type a descriptive name and click OK:
The application has now been uploaded, and NetScaler prompts you to refresh the web browser’s frame; now you can see your application and its configuration:
The pane on the left lists each type of file or object associated with your website. You can configure each by clicking on it: For example, if you click on Images, you will see a set of rules that look complex at first but are easily configurable:
The six columns following the first (Compression, Caching, etc.) are all NetScaler features. The green plus sign means the configuration is not defined. For example, images are not compressed but are cached, which makes sense because most image formats are already compressed.
The orange down arrows indicate that service is down. This is because you haven’t configured any servers yet for your application, so NetScaler reminds you that this application is not yet available.
Step Three: Configure a public endpoint.
A public endpoint is another name for the Virtual IP Address (VIP) to which clients will connect in order to access the application. Refer back to the second image above. This should be the page that displays 192.168.96.100. To configure, click on the application (WebServerExample) as shown above, then click Configure Public Endpoints This shows the collection of public endpoints; at this point, there are none, so click Add.
You can now create a public endpoint by giving it a descriptive name, the IP Address desired, protocol (HTTP) and port (80). You can also specify persistence and other options. To keep things simple, make the endpoint cacheable and leave the rest as defaults. Click OK:
Step Four: Configure back-end services.
A back-end service is a service or server that actually provides content. In this example, the two web servers (at 192.168.96.2 and 192.168.96.3, both on port 8080) should deliver content. Click Configure Backend Services, which shows there are none, so next click Add:
Type a descriptive name for your service, specify the server’s IP address, port and protocol. You also will want NetScaler to know whether or not the server is up, so ask it to monitor the server via ping. Repeat this process for the second web server, using 192.168.96.3 for its address. You now have two back-end services representing your two identical websites, shown below. Notice that both services are listed as UP, because the ping test was successful:
Step Five: Confirmation your configuration.
Now that you have a public endpoint and two back-end services, you should be good to go. (Refresh the Application page to make sure that all the arrows are green and up.) Let’s check it out:
I’ve added a bit of code on the page for this example so you can see which server is actually serving up the content. If I refresh the page... notice that this time the second web server was responsible for serving up the page.
The application template that was used included document and image caching. How can you ensure that NetScaler is doing that? Click on Integrated Caching in the navigation pane, then click on Cache Objects:
Two objects have been cached: the image of the four people on the front page and the document itself. This means NetScaler is delivering this content on behalf of our web servers, easing their load.
The ultimate test of any load-balancer: What happens if we take one of the servers down? To test this, I went into the Internet Information Services (IIS) manager on the first server and stopped the test website:
You would expect the second server to serve up content. However, the web page now hangs in the browser, and NetScaler still thinks first server is up — what gives?
Remember, you set NetScaler to monitor each back-end service through ping, so although you took down the website, the server still responds to ping and therefore NetScaler thinks it is still available. What you really want NetScaler to do is watch and see if the website itself is still up. To do this, click on Load Balancing and then Services in the main navigation area to see your two services. Double-click on one of the two services and add the ìhttpî monitor to it, as shown below:
Do the same for the other service. Notice that NetScaler now detects that one the websites is not available:
Now, when you refresh your web browser, you are consistently directed to the second server. Using this technique, you can now perform service on the first server and your users will continue to have access to the web application through the second server. When the website is back up, NetScaler notices almost immediately and begins using it once again to serve up web pages.
Dr. Jeffrey Sheen is the lead enterprise analyst for Grange Mutual Insurance of Columbus, Ohio.