Quick start configuration

This quick start example shows how to configure three locally attached workstations using CBR along with Caching Proxy to load-balance Web traffic between two Web servers. (For simplicity, this example illustrates servers on the same LAN segment, however with CBR there is no restriction for using servers on the same LAN.)

Figure 16. A simple local CBR configuration
A graphic showing a Client, Internet cloud, a Load Balancer machine, and two locally attached servers with addresses identified.

What do you need?

For the quick start example, you will need three workstations and four IP addresses. One workstation is used as the CBR machine; the other two workstations are used as Web servers. Each Web server requires one IP address. The CBR workstation requires one actual address, and one address to be load balanced.

Note:
The Content Based Routing (CBR) component is available on all supported platforms except those running a 64-bit JVM. Alternatively, you can use the cbr forwarding method of Load Balancer's Dispatcher component to provide content-based routing without the use of Caching Proxy. See Dispatcher's content-based routing (cbr forwarding method) for more information.

To use CBR, Caching Proxy must be installed on the same server. To configure Caching Proxy for CBR, see Step 1. Configure Caching Proxy to use CBR.

How do you prepare?

  1. For this example, set up your workstations on the same LAN segment. Ensure that network traffic between the three machines does not have to pass through any routers or bridges.
  2. Configure the network adapters of the three workstations. For this example, we will assume you have the following network configuration:
    Workstation Name IP Address
    1 server1.mywebsite.com 9.27.27.101
    2 server2.mywebsite.com 9.27.27.102
    3 server3.mywebsite.com 9.27.27.103
    Netmask = 255.255.255.0
    Each of the workstations contains only one standard Ethernet network interface card.
  3. Ensure that server1.mywebsite.com can ping both server2.mywebsite.com and server3.mywebsite.com.
  4. Ensure that server2.mywebsite.com and server3.mywebsite.com can ping server1.mywebsite.com.
  5. Ensure that Web servers on server2.mywebsite.com and server3.mywebsite.com are operational. Use a Web browser to request pages directly from http://server2.mywebsite.com (for example, .../member/index.html) and http://server3.mywebsite.com (for example, .../guest/index.html).
  6. Obtain another valid IP address for this LAN segment. This is the cluster address you will provide to clients who wish to access your site. For this example we will use:
    Name= www.mywebsite.com
    IP=9.27.27.104  

Configuring the CBR component

With CBR, you can create a configuration by using the command line, the configuration wizard, or the graphical user interface (GUI). For this quick start example, configuration steps are demonstrated using the command line.

Note:
The parameter values must be typed in English characters. The only exceptions are parameter values for host names and file names.

Configuring with the command line

From a command prompt, follow these steps:

  1. Start the cbrserver. Run the following command as root user or Administrator: cbrserver
    Note:
    For Windows platform: Start cbrserver (Content Based Routing) from the Services panel: Start > Settings (for Windows 2000) > Control Panel > Administrative Tools > Services.
  2. Start the executor function of CBR:

    cbrcontrol executor start

  3. Start Caching Proxy. (Caching Proxy can be started any time after you start the executor function):

    ibmproxy

    Note:
    For Windows platform: You can also start Caching Proxy from the Services panel: Start > Settings (for Windows 2000)> Control Panel > Administrative Tools > Services.
  4. Add the cluster (the host name, Web site, to which clients connect) to the CBR configuration:

    cbrcontrol cluster add www.mywebsite.com

  5. Add the cluster address (9.27.27.104) for the Web site to the network interface card on the CBR machine. SeeStep 5. Alias the network interface card (optional) for more information.
  6. Add the http protocol port to the CBR configuration:

    cbrcontrol port add www.mywebsite.com:80

  7. Add each of the Web servers to the CBR configuration:

    cbrcontrol server add www.mywebsite.com:80:server2.mywebsite.com

    cbrcontrol server add www.mywebsite.com:80:server3.mywebsite.com

  8. Add content rules to your CBR configuration. (A content rule defines how a URL request will be distinguished and sent to one of the servers or server sets):

    cbrcontrol rule add www.mywebsite.com:80:memberRule type content pattern uri=*/member/*

    cbrcontrol rule add www.mywebsite.com:80:guestRule type content pattern uri=*/guest/*

    In this example, using the content rule, client requests to Web site www.mywebsite.com are sent to a different server based on a directory in their URI request path. See Appendix B. Content rule (pattern) syntax for more information.

  9. Add servers to your rules:

    cbrcontrol rule useserver www.mywebsite:80:memberRule server2.mywebsite.com

    cbrcontrol rule useserver www.mywebsite:80:guestRule server3.mywebsite.com

    CBR will now do load balancing based on content-based rule. A client with a URL request containing /member/ will be directed to server2.mywebsite.com. A client with a URL request containing /guest/ will be directed to server3.mywebsite.com.

  10. Start the manager function of CBR:

    cbrcontrol manager start

  11. Start the advisor function of CBR:

    cbrcontrol advisor start http 80

    CBR will now make sure that client requests are not sent to a failed Web server.

Your basic configuration with locally attached servers is now complete.

Testing your configuration

Test to see if the configuration is working:

  1. From a Web browser, go to location http://www.mywebsite.com/member/index.htm. If a page is displayed, the configuration is working.
  2. Reload the page in the Web browser.
  3. Look at the results of the following command:
    cbrcontrol server report www.mywebsite.com:80:
    The total connections column of the two servers should add up to "2."

Configuring with the graphical user interface (GUI)

For information on using the CBR GUI, see GUI and see Appendix A. GUI: General instructions.

Configuring with the configuration wizard

For information on using the CBR wizard, see Configuration wizard.

Types of cluster, port, server configurations

There are many ways that you can configure CBR to support your site. If you have only one host name for your site to which all of your customers will connect, you can define a single cluster of servers. For each of these servers, you configure a port through which CBR communicates. See Figure 9.

Figure 17. Example of CBR configured with a single cluster and 2 ports
Simple configuration

In this example for the CBR component, one cluster is defined at www.productworks.com. This cluster has two ports: port 80 for HTTP and port 443 for SSL. A client making a request to http://www.productworks.com (port 80) would go to a different server than a client requesting https://www.productworks.com (port 443).

Another way of configuring CBR would be appropriate if you have a very large site with many servers dedicated to each protocol supported. In this case, you might want to define a cluster for each protocol with a single port but with many servers, as shown in Figure 10.

Figure 18. Example of CBR configured with two clusters, each with one port
Configuration with two clusters, each with single port

In this example for the CBR component, two clusters are defined: www.productworks.com for port 80 (HTTP) and www.testworks.com for port 443 (SSL).

A third way of configuring CBR would be necessary if your site does content hosting for several companies or departments, each one coming into your site with a different URL. In this case, you might want to define a cluster for each company or department and then define any ports to which you want to receive connections at that URL, as shown in Figure 11.

Figure 19. Example of CBR configured with 2 clusters, each with 2 ports
Configuration with double clusters, each with double ports

In this example for the CBR component, two clusters are defined with port 80 (HTTP) and port 443 (SSL) for each of the sites at www.productworks.com and www.testworks.com.