371 total views, 1 views today

Setting up WebLogic Load Balancer (12C)

WebLogic Load Balancer acts as a mediator between the user and cluster instances. It takes care of the incoming request from the user and outgoing response to the user. First, the load balancer receives the incoming request, identifies one server in the cluster to handle the request, and pass the request to the server. Once the server finishes the processing, it responds back to the load balancer then the load balancer sends the response back to the user.

In this section, we’ve described creating a Load balancer using WebLogic Proxy plugin. It requires the following steps, and they are detailed below 

A) Create a Proxy plugin using HttpClusterServlet

B) Create a dedicated WebLogic managed server for Load Balancer

C) Deploy the plugin to the managed server

 

Note: This is continuation of WebLogic cluster installation. They are covered in the following links

WebLogic Installation Instruction

WebLogic Cluster Installation instruction

 

Create a Proxy Plugin using HttpClusterServlet

1. Create a directory called ‘Loadbalancer’

2. Create a directory called ‘WEB-INF’ under ‘Loadbalancer’

3. Create two files ‘web.xml’ and ‘weblogic.xml’ under the ‘WEB-INF’ directory

4. Open the web.xml file in a notepad file and input the text below. Replace the init-param value of localhost:7003 and localhost:7004 with your managed server instances. Use the pipe symbol (|) to add multiple instance.

 

Additionally, you can add the following <init-parameters> in the first <servlet>tag above  if your server requires 2-way SSL. You can skip this step if it not required.

 

6. Open the weblogic.xml and edit it like below

 

6. The final file structure will be like below

092116_0414_SettingupWe1 Setting up WebLogic Load Balancer (12C)

6. Open the command prompt and go to the Loadbalancer folder and issue the following command. It will create a web archive file, which is loadbalancer.war in the same directory. Copy the war file in a location.

 

092116_0414_SettingupWe2 Setting up WebLogic Load Balancer (12C)

Note: The jar file should present under the JAVA_HOME\bin directory

Sample war file: loadbalancer.war (Unzip the file to get the war file)

Create a dedicated WebLogic managed server for Load Balancer

We need to create a dedicated WebLogic server to deploy this war file (plugin), and it should not be part of the cluster. This dedicated server will act as a load balancer and talk to the clients; that is the incoming request and outgoing response. Once it received the request, then it checks the loads on the servers in the cluster and passes the request to the least loaded server based on the default round robin algorithm. Let’s create a dedicated server

1. Login into WebLogic console

2. Click on the server’s tab > Click New

092116_0414_SettingupWe3 Setting up WebLogic Load Balancer (12C)

3. Input a server name and port > Enable the option box ‘No, This is a standalone server’ > click Next > Click Finish. This will create a standalone WebLogic server

092116_0414_SettingupWe4 Setting up WebLogic Load Balancer (12C)

4. Click on Machines > Select the Machine

092116_0414_SettingupWe5 Setting up WebLogic Load Balancer (12C)

5. Click on the Servers tab > Click the button ‘Add.’

092116_0414_SettingupWe6 Setting up WebLogic Load Balancer (12C)

5. Select the server ‘load_balancer’ > Click Finish

092116_0414_SettingupWe7 Setting up WebLogic Load Balancer (12C)

6. Click on the Servers tab > Click on the Control tab > Select the server(load_balancer) > Click ‘Start’. After some time, the server state will be ‘Running’

092116_0414_SettingupWe8 Setting up WebLogic Load Balancer (12C)

Deploy the plugin to the managed server

1. Login into WebLogic Console > Click the ‘Deployments’ > Click on the button ‘Install.’

092116_0414_SettingupWe9 Setting up WebLogic Load Balancer (12C)

2. Go to the directory where the war file was created > Select the war file > Click Next

092116_0414_SettingupWe10 Setting up WebLogic Load Balancer (12C)

3. Accept the default and click Next

092116_0414_SettingupWe11 Setting up WebLogic Load Balancer (12C)

4. Select the Load balancer server that we had created earlier and Click Next

092116_0414_SettingupWe12 Setting up WebLogic Load Balancer (12C)

5. Click ‘Finish.’

092116_0414_SettingupWe13 Setting up WebLogic Load Balancer (12C)

6. Now deploy a  web application in a cluster instances and access the application via   load balanced URL. We have deployed a sample web application in a clustered server (localhost:7003/7004) and below is the same application accessed by the load balanced URL (999) we just created

092116_0414_SettingupWe14 Setting up WebLogic Load Balancer (12C)

 

What happens if a user is talking to the deployed  application in one server in the cluster and that server shuts down, unfortunately. Does the other server in the cluster will take care of me? And Does the other server has my previous requested data or conversation? The answer is NO. We need to enable SESSION REPLICATION in the cluster to replicate the conversation among all the servers. Will cover this detail in my another post.

govindan Setting up WebLogic Load Balancer (12C)
Connect me

Govind

Thank you for visiting my personal blog. Myself Govindan, Software Developer by profession since 2006 and hence I started this blog early in 2016 and ever since I've been writing about technologies experienced and learnings of everyday life.

The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.

Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
govindan Setting up WebLogic Load Balancer (12C)
Connect me
By | 2016-10-14T01:00:43+00:00 September 21st, 2016|Categories: Installation, WebLogic|Tags: , , , |0 Comments
Like us on Facebook.
Connect!