23 July 2015

Oracle WebLogic clustering installation and Configuration on Linux (OEL64bit)

Step by Step Oracle WebLogic clustering installation and Configuration on Linux (OEL64bit)

Example Install Steps for a WCC 11g Multi Node Cluster using WLS Pack/Unpack and Web Tier (Doc ID 1359930.1)

Install WebLogic 10.3.4 or 12C

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.
[oracle@weblogic1 oracle]$ cat /etc/hosts
# that require network functionality will fail.
127.0.0.1               localhost.localdomain   localhost
192.168.88.133  weblogic1.muthu.com     weblogic1
192.168.88.134  weblogic2.muthu.com     weblogic2
[oracle@weblogic1 oracle]$
Create the directories in which the Oracle software will be installed.
[root@weblogic1 ~]# mkdir /oracle
[root@weblogic1 ~]# oracle:oinstall /oracle
[root@weblogic1 ~]# chmod -R 775 /oracle

Install the JRockit

Installation

Run the installer as the "oracle" user.

[oracle@weblogic1 oracle]$ java -d64 -jar wls1034_generic.jar

Enter the middleware home ("/oracle/Middleware") and click the "Next" button.
 
 Either enter your support details, or attempt to uncheck the security updates checkbox. The box doesn't actually uncheck, but presents you with a warning dialog. If you click the "Yes" button, indicating you don't want updates, you are returned to the same screen with the box still checked. Click the "Next" button anyway.

Accept the Custom setup by clicking the "Next" button
Uncheck the Oracle Coherence Accept the default selection by clicking the "Next" button.
Accept the default JDK selection by clicking the "Next" button.
Accept the default product installation directories by clicking the "Next" button.
If you are happy with the summary information, click the "Next" button and wait while the installation completes.
On the installation complete screen, uncheck the "Quickstart" checkbox and click the "Done" button.

 
Login to node 2 copy middleware binaries from Node 1 to Node2
[oracle@weblogic2]$ scp –pr oracle@weblogic1:/oracle/Midd* .
Once the installation is complete on both machines, come back to this article to create the clustered domain.
Creation of a clustered domain can be done from the administration console, the command line or the configuration wizard. In my opinion, using the configuration wizard is the quickest way to get the job done. Start the configuration wizard.
[oracle@weblogic1 bin]$  sh /oracle/Middleware/wlserver_10.3/common/bin/config.sh

 Accept the "Create a new WebLogic domain" option by clicking the "Next" button.
 Select the desired product support and click the "Next" button.
Enter the appropriate domain name and locations, then click the "Next" button.
Enter the administrator credentials and click the "Next" button.

Select the desired server start mode and JDK, then click the "Next" button.
Select the "Administration Server" and "Managed Servers, Clusters and Machines" options, then click the "Next" button.
Enter the fully qualified machine name, desired port and SSL configuration, then click the "Next" button.
Add the managed servers for the domain. When you are finished, click the "Next" button.

Add a cluster entry, remember to add the appropriate cluster address. This can be a comma-separated list of "IP/DNS_Name:port", a DNS name that maps to multiple IP addresses or the local machine if all servers run on one machine. Click the "Next" button.
Associate the managed servers with the cluster and click the "Next" button.

Click the "Machine" tab and add the machines used by the cluster. Click the "Next" button.
Assign the managed servers to the machines in the cluster and click the "Next" button.
Check the configuration summary, the click the "Create" button.
Wait while the domain is created, then click the "Done" button.
Start the node manager and Domain on First Node

[oracle@weblogic1 ]$ nohup $WL_HOME/server/bin/startNodeManager.sh &

Consider setting some of the node manager properties on both servers in the "$WL_HOME/common/nodemanager/nodemanager.properties" file. For example.
 [oracle@weblogic1 nodemanager]$ vi /oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.properties
StopScriptEnabled=true
CrashRecoveryEnabled=true
StartScriptEnabled=true
SecureListener=false
################### Node -2 ####################################
[oracle@weblogic2 bin]$ sh setWLSEnv.sh
 [oracle@weblogic2 nodemanager]$ vi /oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.properties
StopScriptEnabled=true
CrashRecoveryEnabled=true
StartScriptEnabled=true
SecureListener=false
################# Node -1 ##########################
Start the new domain on the first machine.

[oracle@weblogic1 ]$ nohup /oracle/Middleware/user_projects/domains/muthu_domain/startWebLogic.sh &

Create a Boot Identity File

[oracle@weblogic1 AdminServer]$ mkdir -p /oracle/Middleware/user_projects/domains/muthu_domain/servers/AdminServer/security
 [oracle@weblogic1 ]$ vi /oracle/Middleware/user_projects/domains/muthu_domain/servers/AdminServer/security /boot.properties
username=weblogic
password=password
[oracle@weblogic1 muthu_domain]$ nohup /oracle/Middleware/user_projects/domains/muthu_domain/startWebLogic.sh &
Stop Adminserver and Node manager
Transfer Domain to Second Machine
[oracle@weblogic1 oracle]$ export DOMAIN_HOME=/oracle/Middleware/user_projects/domains/muthu_domain
[oracle@weblogic1 oracle]$ cd $WL_HOME/common/bin/
[oracle@weblogic1 bin]$ sh pack.sh -managed=true -domain=$DOMAIN_HOME -template=/oracle/weblogic1.jar -template_name=muthu_domain
<< read domain from "/oracle/Middleware/user_projects/domains/muthu_domain"
>>  succeed: read domain from "/oracle/Middleware/user_projects/domains/muthu_domain"
<< set config option Managed to "true"
>>  succeed: set config option Managed to "true"
<< write template to "/oracle/weblogic1.jar"
....................................................................................................
>>  succeed: write template to "/oracle/weblogic1.jar"
<< close template
>>  succeed: close template
[oracle@weblogic1 bin]$
Copy the resulting jar file to the second machine.
[oracle@weblogic2 oracle]$ scp -pr oracle@weblogic1:/oracle/weblo* .
oracle@weblogic1's password:
weblogic1.jar                                 100%   43KB  43.0KB/s   00:00
[oracle@weblogic2 oracle]$
Unpack the configuration on the second machine. Remember to amend the DOMAIN_HOME environment variable to match your domain
[oracle@weblogic2 oracle]$ mkdir -p /oracle/Middleware/user_projects/domains/muthu_domain
[oracle@weblogic2 ~]$ export DOMAIN_HOME=/oracle/Middleware/user_projects/domains/muthu_domain
[oracle@weblogic2 ~]$ cd /oracle/Middleware/wlserver_10.3/common/bin/
 [oracle@weblogic2 bin]$ sh unpack.sh -domain=$DOMAIN_HOME -template=/oracle/weblogic1.jar
<< read template from "/oracle/weblogic1.jar"
>>  succeed: read template from "/oracle/weblogic1.jar"
<< set config option DomainName to "muthu_domain"
>>  succeed: set config option DomainName to "muthu_domain"
<< write Domain to "/oracle/Middleware/user_projects/domains/muthu_domain"
...............................................................................................
>>  succeed: write Domain to "/oracle/Middleware/user_projects/domains/muthu_domain"
<< close template
>>  succeed: close template
[oracle@weblogic2 bin]$
Restart the domain on the first machine. Wait until it is fully started before continuing.
[oracle@weblogic1 logs]$ nohup /oracle/Middleware/user_projects/domains/muthu_domain/startWebLogic.sh &
Enroll Second Machine
On the second machine, start WLST.
[oracle@weblogic2 bin]$ . $WL_HOME/common/bin/commEnv.sh
[oracle@weblogic2 bin]$ sh $WL_HOME/common/bin/wlst.sh
CLASSPATH=/oracle/Middleware/patch_wls1034/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/oracle/java/lib/tools.jar:/oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/oracle/Middleware/modules/features/weblogic.server.modules_10.3.4.0.jar:/oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar:
PATH=/oracle/Middleware/wlserver_10.3/server/bin:/oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/oracle/java/jre/bin:/oracle/java/bin:/oracle/Middleware/wlserver_10.3/server/bin:/oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/oracle/java/jre/bin:/oracle/java/bin:/usr/lib64/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/oracle/bin
Your environment has been set.
CLASSPATH=/oracle/Middleware/patch_wls1034/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/oracle/java/lib/tools.jar:/oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/oracle/Middleware/modules/features/weblogic.server.modules_10.3.4.0.jar:/oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/oracle/Middleware/utils/config/10.3/config-launch.jar::/oracle/Middleware/wlserver_10.3/common/derby/lib/derbynet.jar:/oracle/Middleware/wlserver_10.3/common/derby/lib/derbyclient.jar:/oracle/Middleware/wlserver_10.3/common/derby/lib/derbytools.jar::
Initializing WebLogic Scripting Tool (WLST) ...
Jython scans all the jar files it can find at first startup. Depending on the system, this process may take a few minutes to complete, and WLST may not return a prompt right away.
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> connect ('weblogic','welcome123','t3://weblogic1.muthu.com:7001')
Connecting to t3://weblogic1.muthu.com:7001 with userid weblogic ...
Successfully connected to Admin Server 'AdminServer' that belongs to domain 'muthu_domain'.
Warning: An insecure protocol was used to connect to the
server. To ensure on-the-wire security, the SSL port or
Admin port should be used instead.
wls:/muthu_domain/serverConfig> nmEnroll('/oracle/Middleware/user_projects/domains/muthu_domain','/oracle/Middleware/wlserver_10.3/common/nodemanager')
Enrolling this machine with the domain directory at /oracle/Middleware/user_projects/domains/muthu_domain ...
Successfully enrolled this machine with the domain directory at /oracle/Middleware/user_projects/domains/muthu_domain.
wls:/muthu_domain/serverConfig> disconnect()
Disconnected from weblogic server: AdminServer
wls:/offline> exit()
Exiting WebLogic Scripting Tool.
[oracle@weblogic2 bin]$
Check the "$MW_HOME/domain-registry.xml" file contains an entry like the following. If it doesn't, add it manually.

[oracle@weblogic2 Middleware]$ vi /oracle/Middleware/domain-registry.xml
  <domain location="/oracle/Middleware/user_projects/domains/muthu_domain"/>
 Check the "$WL_HOME/common/nodemanager/nodemanager.domains" file contains an entry like the following. If it doesn't, add it manually.
[oracle@weblogic2 nodemanager]$ vi $WL_HOME/common/nodemanager/nodemanager.domains
muthu_domain=/oracle/Middleware/user_projects/domains/muthu_domain
[oracle@weblogic1 nodemanager]$ vi /oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.properties
StopScriptEnabled=true
CrashRecoveryEnabled=true
StartScriptEnabled=true
SecureListener=false
If the node manager is not already started on this server, start it now.
[oracle@weblogic2 bin]$ nohup $WL_HOME/server/bin/startNodeManager.sh &
Check Node Manager on Each Machine
Check the node manager is reachable on each machine.
    Log in to the administration server (http://weblogic1.muthu.com:7001/console).
    In the "Domain Structure" tree, expand the "Environment" node and click on the "Machines" node.
    In the right-hand pane, click on the first machine (weblogic1).
    Click on the "Monitoring" tab. Be patient. This may take a little time the first time you do it.
    If the status is "Reachable", everything is fine.
    Repeat for the second machines (weblogic2).
Start Up
Provided the node manager is up on all servers, you can now start/stop the managed servers on both machines from the command line. The following example shows how you might do this.
$ # Start the services on each server.
[oracle@weblogic1 bin]$  nohup $WL_HOME/server/bin/startNodeManager.sh > /dev/null 2>&1 &
# Start the managed servers from any server.
 [oracle@weblogic1 bin]$ nohup /oracle/Middleware/user_projects/domains/muthu_domain/startWebLogic.sh > /dev/null 2>&1 &
[oracle@weblogic1 bin]$ nohup /oracle/Middleware/user_projects/domains/muthu_domain/bin/startManagedWebLogic.sh ms1_cluster > /dev/null 2>&1 &
[oracle@weblogic1 bin]$ nohup /oracle/Middleware/user_projects/domains/muthu_domain/bin/startManagedWebLogic.sh ms2_cluster > /dev/null 2>&1  &

No comments: