Deploying WebLogic Platform Applications
Using Load Balancers and Web Proxy Servers
In a production environment, a load balancer or Web proxy server, as illustrated in the WebLogic Platform Domain Examples, is used to distribute client connection requests, provide load balancing and failover across the cluster, and provide security by concealing the local area network addresses from external users. A load balancer or Web proxy server allows all applications in the domain to be represented as a single address to external clients, and is required when using in-memory replication for client session information.
This section describes how to configure a hardware load balancer or Web proxy server.
Topics include:
Load Balancing with an External Hardware Load Balancer
If you are using load balancing hardware, instead of a proxy, it must support a compatible passive or active cookie persistence mechanism, and SSL persistence, as described below:
- Passive cookie persistence enables WebLogic Server to write a cookie containing session parameter information through the load balancer to the client. When using some hardware load balancers, you must configure the passive cookie persistence mechanism to avoid overwriting the WebLogic Server cookie that tracks primary and secondary servers used for in-memory replication. Specifically, you must set the following values:
- String offset value to the Session ID value plus 1 byte for the delimiter character
- String length to 10 bytes
- Active cookie persistence is supported as long as the mechanism does not overwrite or modify the WebLogic HTTP session cookie. In this case, no additional configuration is required.
- SSL persistence performs all encryption and decryption of data between clients and the cluster, and uses a plain text cookie on the client to maintain an association between the client and a server in the cluster.
For more information about active and passive cookie persistence and SSL persistence, see:
- "Load Balancing HTTP Sessions with an External Load Balancer" in "Load Balancing for Servlets and JSPs" in Load Balancing in a Cluster in Using WebLogic Server Clusters.
- "Configuring Load Balancers that Support Passive Cookie Persistence" in "Cluster Implementation Procedures" in Setting Up WebLogic Clusters in Using WebLogic Server Clusters.
For a description of connection and failover for HTTP session in a cluster with load balancing hardware, see "Accessing Clustered Servlets and JSPs with Load Balancing Hardware" in "Replication and Failover for Servlets and JSPs" in Failover and Replication in a Cluster in Using WebLogic Server Clusters.
If you are using an F5 BIG-IP hardware load balancer, see also Configuring BIG-IP Hardware with Clusters in Using WebLogic Server Clusters.
Load Balancing with a Web Proxy Server
A Web proxy server maintains a list of WebLogic Server instances that host a clustered servlet or JSP, and forwards HTTP requests to those instances. Requests are forwarded on a round-robin basis, by default, as described in "Round Robin Load Balancing" in "Load Balancing for EJBs and RMI Objects" in Load Balancing a Cluster in Using WebLogic Server Clusters.
You can implement a Web proxy server using WebLogic Server with the HttpClusterServlet
or by using one of the following Web servers and associated proxy plug-ins:
- Netscape Enterprise Server with the Netscape (proxy) plug-in
- Apache with the Apache Server (proxy) plug-in
- Microsoft Internet Information Server with the Microsoft IIS (proxy) plug-in
Refer to the following table for information about configuring a Web proxy server to load balance servlets and JSPs.
Table 6-1 Configuring a Web Proxy Server
If your Web server is...
|
Then set up...
|
WebLogic Server
|
The HttpClusterServlet as a Web proxy server, as described in:
|
A third-party Web server
|
The corresponding plug-in, as described in Using WebLogic Server Plug-ins with WebLogic Server.
|
Considerations When Configuring Load Balancers and Web Proxy Servers
The following lists considerations for configuring load balancers and Web proxy servers.
- There may be circumstances in which you have to configure the WebLogic Workshop runtime to work with a Web server proxy. For more information, see "Proxy Server Setup" in Clustering Workshop Applications in the WebLogic Workshop Online Help.
- To support automatic failover, WebLogic Server replicates the HTTP session state of clients that access clustered servlets and JSPs, and maintains them in memory, a file system, or a database. To utilize in-memory replication for HTTP session states, you must access the WebLogic Server cluster using either a collection of Web servers with identically configured WebLogic proxy servers or load balancing hardware.
The primary session state is stored on the server to which the client first connects. By default, WebLogic Server attempts to create session state replicas on a different machine than the one that hosts the primary session state. You can control where secondary states are placed using replication groups. A replication group is a preferred list of clustered servers to be used for storing session state replicas. For more information, see:
- When using T3 tunneling with a load balancer, you should set the load balancing algorithm to one of the server affinity algorithms to ensure that clients connect only through the tunneled connection. For more information, see "Round-Robin Affinity, Weight-Based Affinity, and Random Affinity" in "Load Balancing for Servlets and JSPs" in Load Balancing in a Cluster in Using WebLogic Server Clusters.
- In addition to distributing HTTP traffic, external load balancers can distribute initial context requests that come from Java clients over T3 and the default channel. For a discussion of object-level load balancing, see "Load Balancing for EJBs and RMI Objects" in Load Balancing in a Cluster in Using WebLogic Server Clusters.