How to create a cluster in weblogic server

In this, I will explain you that how we can configure our weblogic server to work on the cluster. As you all know why we need cluster, Yes you are right we do this only for high availability and scalability.

 Installation of weblogic with the cluster in Multi-node architecture

Note:- we have to have two machines . And please follow the following steps.


Simple steps that we needed :--
 1. Install WebLogic on both physical machines
 2. Create the WebLogic Domain on one physical machine
 3. Configure the domain by adding Managed Servers and Machines on one physical machine
 4. Copy the domain file structure to the other physical machine and enroll it to the WebLogic Domain
 5. Ensure that both WebLogic Machines are operational
 6. Create and configure the Cluster
 7. Ensure that the Cluster is operational


Install WebLogic on both physical machines :--

We have to install weblogic on both machine with same middleware home . So that we can copy our domain easily. Here we are doing our installation on linux machine .We must have some changes to directories but if you want to go with default then its not a problem.
First ever step to cahnge your “hosts” file.

The following actions should be performed by the "root" user.
Make sure the "/etc/hosts" file contains correct entries for both the "localhost" and real host names.
127.0.0.1      localhost localhost.localdomain localhost4 localhost4.localdomain4
192.xxx.xx.xxx  machine_name.com  machine_name
After that Create a new group and user on OS level .
groupadd -g 1000 oinstall
useradd -u 1100 -g oinstall oracle
passwd oracle


Create the directories in which the Oracle software will be installed.If you don't want too create the  directories than it's ok. BEA will take care of this and automatically create the directories in your home directory i.e. /home/username
But oracle recommend to create directories rather then your home directory. So create directories as below:--
mkdir -p /u1/app/oracle/product/fmw11g
mkdir -p /u1/app/oracle/config/domains
mkdir -p /u1/app/oracle/config/applications
chown -R oracle:oinstall /u1
chmod -R 775 /u1/


Now after creating the directories make a entries  into the "/home/username/.bash_profile" file.So, we dont need to set our path again and again.
export MW_HOME=/u1/app/oracle/product/fmw11g
export WLS_HOME=$MW_HOME/wlserver_10.3
export WL_HOME=$WLS_HOME
# Set to the appropriate JAVA_HOME.
#export JAVA_HOME=/usr/java/jdk1.6.0_33
export JAVA_HOME=/u1/app/oracle/jrockit-jdk1.6.0_45-R28.2.7-4.1.0
#export JAVA_HOME=/u1/app/oracle/jdk1.7.0_17
export PATH=$JAVA_HOME/bin:$PATH


Install the JDK. Instructions for installing JRockit can be found here. This article will assume JRockit is being used.
If you are confuse with Jrockit and JDK then let me explain this for you. In simple words both works in same way. But both using different mechanism to do the same thing. If you want more detail on this please go here .


If you want to use HotSpot for JDK6 or JDK7 you might install them like this.
# # Java 6 as root
# rpm -Uvh jdk-6u33-linux-amd64.rpm
Or
$ # Java 7 as Oracle
$ cd /u1/app/oracle/
$ tar -xvzf /tmp/jdk-7u17-linux-x64.tar.gz


You can download the software from oracle and to start Installation of weblogic please run this command where your setup of weblogic is located.

$JAVA_HOME/bin/java -Xmx1024m -jar wls1036_generic.jar


After that provide the desired inputs to the system. I am not displaying everything.
Please visit oracle-base for see the one by one step of installation.
Note** we have done this on single machine. Please follow the same steps to install on another machine.

 2. Create the WebLogic Domain on one physical machine

We have installed weblogic server  on both machine with the same Middleware home. Now we have to create the domain on single machine.
For this we have to run the config.sh from loaction $ORACLE_HOME/wlserver_10.3/common.
Then go with defaults and provide the username and password for weblogic server.we will configure by admin console.


We have to make some change before starting the weblogic server .
You can change these parameters insetDomain.sh


This is optional You can change the memory size by changing the parameters Xmx
the most important parameters are :
-Xms4096m -Xmx4096m -XX:MaxPermSize=1028m
Xmx - is the max size of the heap.
Xms - is the initial size of the heap.( give it the same as Xmx )
XX:MaxPermSize - is is used to hold reflective of the VM itself such as class objects and method objects ( it's independent from the heap size,, give it the 1/3 to 1/4 of the Xms size depend in your classes size)


NOTE** For one domain having admin server and two managed server we have to use given formula :--
3GB for OS and other + 3GB for Admin Server + 6Gb for two managed servers

Now after configuration we have to start our weblogic server from the location   :--
                                 user_projects/domains/domain_name/bin by running startWeblogic.sh
After providing the username and password wait and see the logs that everything is going smooth.
We can configure our weblogic to start without asking username and password.
 I will explain that in next post i.e about nodemanger.

2.Configure the domain by adding Managed Servers and Machines in one physical machine

Note** we are doing this on one machine
Now its time to configuration the machine and manage servers for final step .
Access you weblogic from  http://localhost:7001/console and ready for the main task. Login with your weblogic username and password .
I am not putting every screen shot here because I know you all aware of the things.
Now we have to create manged server in our domain.


Follow the following steps  :--


 1) Expand your Environment then go to the server link after clicking on this you will find the summary of servers and you will find the configuration table there. There click on the ”new“ button to create managed server.

 2) Now this will ask you to put the name of the managed server and and listing address. As you know weblogic by default work on the 7001 port and if you want to change this port you can easily change this port from the admin console. After providing the input click to create manage server.
Now for e.g. we have our manage server with name of “test1” and port is 7010.

 3) Now after creating successfully you have this test1 server in your summary table where you will find its status shutdown


 4) Now you have to follow the same steps to create the same managed server on the other machine with same port.

 5) Now we have to create the machine to assign to the servers .you will find this in Environment . After clicking new it will ask you for the name of the machine  and machine OS , if you re using Linux then you can go for unix or other wise you can go with default and Now after saving this you can click on newly created machine and check the configuration it will run on default port 5556 if you want to change this port , you can change it.


 6) We have to set this machine to our manage server, for this go to the Environment and server then click on the managed server. You have to put your environment on the “lock and edit” . Now you can see in configuration tab that in machine you have options like “none” and one is machine name. Select the name of your machine and then save & active the changes. You will find this in servers summary table.


 7) Now we have to follow the same step for our second machine that is “test2”


 8)  Now with the WebLogic Machines created and configured we can start the node manager on the machine. Remember that we are still working on the same machine where we run the Configuration Wizard in the first place. It can be started by running the startNodeManager.sh script in the wlserver_10.3/server/bin directory under the Middleware Home. Before starting it, go over the start-up parameters specified in the nodemanager.properties configuration file in the wlserver_10.3/common/nodemanager directory and verify that it is not configured for SSL by ensuring that the SecureListener parameter is set to false. Once started the terminal window should indicate that the node manager is  running and listening to the port configured.

No comments:

Post a Comment

Really Thanks