Configure Content Based Routing in production environments
and realistic test environments.
Before you begin
Before setting up the Dispatcher machine, you must be the
root user (for AIX, HP-UX, Linux, or Solaris systems) or the Administrator
on Windows systems.
For the Dispatcher machine you will need
at least two valid IP addresses.
The figure below 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.)
About this task
Use this configuration method for a quick way to establish
a connection between servers and the CBR machine.
Review the new features section for what's been
added and improved in this release.
Procedure
Prepare the servers
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.
Configure the network adapters of the three workstations.
This example assumes 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.
Ensure that server1.mywebsite.com can ping both server2.mywebsite.com
and server3.mywebsite.com.
Ensure that server2.mywebsite.com and server3.mywebsite.com
can ping server1.mywebsite.com.
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).
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 example: Name= www.mywebsite.com IP=9.27.27.104
Configure CBR with the command line
Start the cbrserver from the <install_root>/cbr/servers/bin directory.
Run the following command as root user or Administrator: cbrserver
Attention: Start cbrserver (Content
Based Routing) from the Services panel as follows: Start
> Control Panel > Administrative Tools > Services.
Start the executor function of CBR: cbrcontrol
executor start
Start Caching Proxy. (You can start Caching Proxy any
time after you start the executor function): ibmproxy
Note: You can also start Caching Proxy from
the Services panel as follows: Start > Control Panel >
Administrative Tools > Services
Add the cluster (the host name and Web site to which
clients connect) to the CBR configuration: cbrcontrol cluster
add www.mywebsite.com
Add the cluster address (9.27.27.104) for the Web site
to the network interface card on the CBR machine.
Add the http protocol port to the CBR configuration: cbrcontrol
port add www.mywebsite.com@80
Add each of the Web servers to the CBR configuration: cbrcontrol
server add www.mywebsite.com@80@server2.mywebsite.com and cbrcontrol
server add www.mywebsite.com@80@server3.mywebsite.com
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/* andcbrcontrol
rule add www.mywebsite.com@80@guestRule type content pattern uri=*/guest/* In the 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.
Add servers to your rule: cbrcontrol rule useserver
www.mywebsite:80:memberRule server2.mywebsite.com and 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/ is directed to server2.mywebsite.com.
A client with a URL request containing /guest/ is directed to server3.mywebsite.com.
Start the manager function of CBR: cbrcontrol
manager start
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.
Results
Your basic configuration with locally attached servers is
now complete.
Example
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.
Example of CBR configured with a single
cluster and 2 ports
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.
Example of CBR configured with two clusters,
each with one port
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.
Example of CBR configured with 2 clusters,
each with 2 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.