Quick start configuration for Content Based Routing

This quick start example shows how to configure three locally attached workstations using Content Based Routing (CBR) along with Caching Proxy, to load-balance web traffic between two web servers.

Before you begin

Attention: 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.
You need three workstations and four IP addresses for this quickstart example. One workstation is the CBR machine; the other two workstations are the web servers. Each web server requires one IP address. The CBR workstation requires one actual addresses and one address to be load balanced.
Simple local CBR configurationSimple local CBR configuration

For more information on the different ways Load Balancer can be setup, read the Types of cluster, port, and server configurations for Content Based Routing topic to help you design your topology.

Caching Proxy should be installed on the same server to use CBR. To configure Caching Proxy for CBR, read step one of the Setting up the Content Based Routing component topic.

About this task

Use this configuration method for a quick way to establish a connection between servers and the CBR machine. This method does not include configuring advisors or tuning performance. For a full configuration, read Configuring the Load Balancer machine and Configuring the server machines topics.

Procedure

  1. Prepare your servers.
    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:
      Table 1. Sample 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.47.47.103
      Netmask = 255.255.255.0
      Each of the workstations contains only one standard Ethernet network interface card.
    3. Ensure that all the servers can communicate with each other.
      1. Ensure that server1.mywebsite.com can ping both server2.mywebsite.com and server3.mywebsite.com.
      2. Ensure that server2.mywebsite.com and server3.mywebsite.com can ping server1.mywebsite.com.
    4. 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).
    5. 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
  2. Configure CBR using the command line, the GUI, or the configuration wizard.

    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.

    Important: You must enter the parameter values in English characters. The only exceptions are parameter values for host names and file names.
    • Configuring with the command line:
      1. Start cbserver:
        • [AIX][HP-UX][Linux][Solaris] Go to the <install_root>/cbr/servers/bin directory and run the following command as root user:
          cbserver
        • [Windows] 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. Enter the command
        cbrcontrol executor start
      3. Start Caching Proxy. You can start caching proxy any time after you start the executor function.
        • [AIX][HP-UX][Linux][Solaris] Run the following command:
          ibmproxy
        • [Windows] from the Services panel: Start > Settings (for Windows 2000)> Control Panel > Administrative Tools > Services.
      4. Add the cluster (the host name and 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.
      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 cbrcontrolserver add www.mywebsite.com@80@server3.mywebsite.com
      8. Add content rules to your CBR configuration. A content rule defines how a URL request is 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 www.mywebsite.com are sent to a different server, based on a directory in their URI request path.

      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 load balance based on content-based rule. A client with a URL request containing /member/ is directed to server2.mywebsite.com. A client with a URL request containing /guest/ is 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.

  3. Test your configuration.
    1. From a web browser, enter http://www.mywebsite.com/member/ index.htm. If a page displays, 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.

What to do next

You can also configure CBR with the graphical user interface (GUI) and the configuration wizard. Read the Methods of configuration for Content Based Routing topic for more information.
Task topic    

Terms and conditions for information centers | Feedback

Last updated: April 16, 2014 11:59 AM EDT
File name: tcfg_quickstrt_cbr.html