Before configuring Load Balancing, we will need to setup WebLogic cluster. Sample Oracle ADF application will be deployed on WebLogic cluster, Load Balancing domain will distribute user requests between cluster members (WebLogic domains).
1. WebLogic Cluster Setup
You can setup WebLogic cluster on your machine very easily, just use standard installation wizard and choose customized installation be selecting 'Yes' and pressing Next button:
Change port number for Administration Server from default to unique in your environment, I will change it to 7002:
Add three (3) Managed Servers, each with unique port number. Defined servers will implement cluster environment:
Configure cluster by accepting defaults, we will change later Multicast to Unicast:
Simply assign all three defined Managed Servers to configured Cluster:
Configure Machine - I will use one physical machine:
Assign all servers to defined machine:
And finally, provide name for cluster domain and specify domain location:
At this point, WebLogic Cluster is installed and ready to be used. Ensure that Admin Server is running, Open Web Console for Admin Server and change Multicast messaging type to Unicast:
You can start each of three Managed Servers in defined Cluster using startManagedWebLogic managedServerName command from console. In Admin Server Web Console you can access Cluster information tab, all three Managed Servers should be running:
Finally, define JDBC Data Source and deploy it on Cluster:
2. Load Balancing Domain Setup
I will describe how to setup Load Balancing with Proxy Plug-in. As proxy, I will use separate WebLogic domain. This domain can be installed as standard domain, without any customizations:
Specify domain name and location:
I have installed Proxy domain for Load Balancing on default, 7001 port - later I will access Oracle ADF application deployed on Cluster environment through 7001 port:
Before you will start to use WebLogic domain as Proxy Plug-in for Load Balancing, you will need to set up HttpClusterServlet. Consult documentation for additional information - Configuring Proxy Plug-Ins. I have used sample web.xml available in documentation, just changed WebLogicCluster parameter value to:
localhost:7003|localhost:7004|localhost:7005As you can see, I have specified addresses of three Managed Servers from my Cluster. I have packed web.xml along with weblogic.xml into load-balancer.war and have deployed this war file on WebLogic Load Balancing domain:
Load Balancing setup is done.
3. Load Balancing Test
In this section I will describe how to test defined Load Balancing domain and will show how user requests will be distributed across cluster.
First, in cluster environment, from Admin server I will deploy Oracle ADF application. Application will be deployed on cluster:
When application will be deployed and user will access it using (note: I'm using Load Balancing domain port number):
http://localhost:7001/cluster_test/faces/main
One of Managed Servers from Cluster environment will response, in my case it was second server:
Oracle ADF application is opened:
I have opened second session, by pointing to the same 7001 port and it was handled by third Managed Server:
Third session on 7001 Load Balancing port, was handled by first Managed Server:
When I have opened fourth session, it was handled by second Managed Server - second circle have started, its because Cluster is configured with round-robin algorithm. Second Managed Server have responded to fourth session request:
Spanish Summary:
En este artículo, Andrejus nos muestra como realizar la configuración de balanceo de carga en los servidores BEA WebLogic. De esta manera, las peticiones realizadas por los usuarios de las aplicaciones seran procesadas de manera distribuida por los servidores configurados para soportar el balanceo.