Thursday, July 11, 2013

Weblogic Clustering

If you have already installed Oracle Weblogic, please follow the below steps to make a cluster else use this link Weblogic Installation to install weblogic first on both the servers.

Environment:

We have two linux servers: host1.com & host2.com
Installation Requirement: One Admin Server on Host1.com & one Managed Server in cluster in Host1.com & Host2.com

Weblogic Software Version:

10.3.6

We need to create a domain in the first server and use the pack/unpack command to have it in the second server.


Step 1. Go to the location $MW_HOME/wlserver_10.3/common/bin (in host1.com)


Step 2. Execute config.sh file to create a domain

        ./config.sh


Step 3. You will get a window similar to below to create a domain


Select Create a new Weblogic doamin and click Next



Select Domain Source and click Next


Give a name to your weblogic Domain and specify the location for domain



Provide Administrator username & Password and click Next



Verify the Java Location & click Next



Check box Administration Server & Managed Server, Clusters and Machines and click Next




Give the name of the admin Server and Listen Port Address (In our case its AdminServer & 7001)



Provide the names of Managed Servers, since its in cluster, we need to add two Managed Servers
In our case its ManagedServer_1 & ManagedServer_2, provide the hostname in the respective Listen address space and Provide the Listen Port, we 7003 for both.



Add a cluster with unicast messaging mode




Assign both the Managed Server to the cluster, to configure it in cluster.





Choose Unix Machine and provide the Name(Machine Name), Hostname and port



Since our configuration is Admin Server & Managed Server in first Host & a Managed Server in Cluster in Second Host. Assign the same accordingly.




Verify the details & click Create.









The domain is created.


[oraem@host1 bin]$ pwd
/u01/app/oracle/product/fmw/wlserver_10.3/common/bin

Use the pack command

[oraem@host1 bin]$ ./pack.sh -managed=true -domain=/u01/app/oracle/product/fmw/user_projects/domains/base_domain -template=base_domain.jar -template_name=base_domain

Output of the above command=>
<< read domain from "/u01/app/oracle/product/fmw/user_projects/domains/base_domain"
>>  succeed: read domain from "/u01/app/oracle/product/fmw/user_projects/domains/base_domain"
<< set config option Managed to "true"
>>  succeed: set config option Managed to "true"
<< write template to "/u01/app/oracle/product/fmw/wlserver_10.3/common/bin/base_domain.jar"
....................................................................................................
>>  succeed: write template to "/u01/app/oracle/product/fmw/wlserver_10.3/common/bin/base_domain.jar"
<< close template
>>  succeed: close template


Now copy this template base_domain.jar from server host1.com to server host2.com

[oraem@host1 bin]$ scp base_domain.jar oraem@host2:/u01/app/oracle/product/fmw/wlserver_10.3/common/bin


[oraem@Host2 bin]$ pwd
/u01/app/oracle/product/fmw/wlserver_10.3/common/bin

Use the unpack command now

[oraem@Host2 bin]$ ./unpack.sh -domain=/u01/app/oracle/product/fmw/user_projects/domains/base_domain -template=base_domain.jar

Output of the above Command=>
<< read template from "/u01/app/oracle/product/fmw/wlserver_10.3/common/bin/base_domain.jar"
>>  succeed: read template from "/u01/app/oracle/product/fmw/wlserver_10.3/common/bin/base_domain.jar"
<< set config option DomainName to "base_domain"
>>  succeed: set config option DomainName to "base_domain"
<< write Domain to "/u01/app/oracle/product/fmw/user_projects/domains/base_domain"
...............................................................................................
>>  succeed: write Domain to "/u01/app/oracle/product/fmw/user_projects/domains/base_domain"
<< close template
>>  succeed: close template


Now Modify the nodemanager.properties file at location /u01/app/oracle/product/fmw/wlserver_10.3/common/nodemanager on both the servers
Change the parameter StartScriptEnabled=true

Start the Node manager on both the servers.
[oraem@Host1 ]$ cd /u01/app/oracle/product/fmw/wlserver_10.3/server/bin

[oraem@Host1 bin]$ nohup ./startNodeManager.sh >> nodemgr.log &

[oraem@Host2 ]$ cd /u01/app/oracle/product/fmw/wlserver_10.3/server/bin

[oraem@Host2 bin]$ nohup ./startNodeManager.sh >> nodemgr.log &

Start the Admin Server

[oraem@Host1 ]$ cd /u01/app/oracle/product/fmw/user_projects/domains/base_domain/bin

[oraem@Host1 bin]$ nohup ./startWebLogic.sh >> weblogic.log & 

From the console page start the Managed Server

Environment--> Server--> Control--> (Select the Managed Servers) --> Start




No comments:

Post a Comment