Thursday, 7 October 2021

WLS - Creating Horizontal clustering of Managed Servers

 

Weblogic Server 12.2.1.4

Creating Horizontal WLS cluster for Load Balancing






STEP 1: WLSNODE1

1.1   Install JDK. I have installed JDK8-U191




1.2   Install Weblogic 12.2.1.4













1.3   Configure Domain, continue from the last screenshot. It will launch config wizard automatically















STEP 2: WLSNODE1 – Create a PACK of WLS domain

2.1 – Start Services

·         Admin Server

·         Node Manager

2.2 – Create a PACK

cd C:\Oracle\Middleware\Oracle_Home\wlserver\common\bin

pack.cmd -domain=c:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain 
-template=c:\WEBLOGIC\base_domain.jar -template_name=base_domain.jar


It created a JAR file under C:\WEBLOGIC. But it gave a warning

WARNING: This is a deprecated script. Please invoke the pack.cmd script under oracle_common/common/bin.

 Better to use the latest utility to avoid errors ahead

cd C:\Oracle\Middleware\Oracle_Home\oracle_common\common\bin

pack.cmd -domain=c:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain 
-template=c:\WEBLOGIC\base_domain.jar -template_name=base_domain.jar 


2.3 Copy the JAR on wlsnode2 to location c:\WEBLOGIC\base_domain.jar

 STEP 3 – CONFIGURE WLSNODE2

                3.1 Install JDK – same location as that of wlsnode1

                3.2 Install Weblogic – same location as that of wlsnode1

                3.3 Please make sure you don’t configure any domain on wlsnode2



STEP 4 – WLSNODE2 UNPACK the domain JAR


cd C:\Oracle\Middleware\Oracle_Home\oracle_common\common\

unpack.cmd -template=C:\WEBLOGIC\base_domain.jar 
-domain=c:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain



<< read template from "C:/WEBLOGIC/base_domain.jar">>  succeed: read template from "C:/WEBLOGIC/base_domain.jar"

>>  validateConfig "KeyStorePasswords"

>>  succeed: validateConfig "KeyStorePasswords"

<< write Domain to "C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain"

>>  fail: write Domain to "C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain"

com.oracle.cie.domain.script.ScriptException: Attribute "Password" is not set for user "weblogic"

        at com.oracle.cie.domain.script.ScriptExecutor.checkSecurityInfo(ScriptExecutor.java:6760)

        at com.oracle.cie.domain.script.ScriptExecutor.writeDomain(ScriptExecutor.java:2016)

        at com.oracle.cie.domain.script.jython.WLScriptContext.writeDomain(WLScriptContext.java:1870)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:498)

        at com.oracle.cie.domain.script.jython.WLSTState.processCommand(WLSTState.java:226)

        at com.oracle.cie.domain.script.jython.WLScriptContext.runCmd(WLScriptContext.java:732)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:498)

        at org.python.core.PyReflectedFunction.__call__(Unknown Source)

        at org.python.core.PyMethod.__call__(Unknown Source)

        at org.python.core.PyObject.__call__(Unknown Source)

        at org.python.core.PyInstance.invoke(Unknown Source)

        at org.python.pycode._pyx0.command$1(<iostream>:19)

        at org.python.pycode._pyx0.call_function(<iostream>)

        at org.python.core.PyTableCode.call(Unknown Source)

        at org.python.core.PyTableCode.call(Unknown Source)

        at org.python.core.PyTableCode.call(Unknown Source)

        at org.python.core.PyFunction.__call__(PyFunction.java:184)

        at org.python.pycode._pyx0.writeDomain$28(<iostream>:111)

        at org.python.pycode._pyx0.call_function(<iostream>)

        at org.python.core.PyTableCode.call(Unknown Source)

        at org.python.core.PyTableCode.call(Unknown Source)

        at org.python.core.PyFunction.__call__(PyFunction.java:181)

        at org.python.pycode._pyx2.f$0(<iostream>:2)

        at org.python.pycode._pyx2.call_function(<iostream>)

        at org.python.core.PyTableCode.call(Unknown Source)

        at org.python.core.PyCode.call(Unknown Source)

        at org.python.core.Py.runCode(Py.java:1226)

        at org.python.util.PythonInterpreter.execfile(Unknown Source)

        at org.python.util.PythonInterpreter.execfile(Unknown Source)

        at com.oracle.cie.domain.script.jython.WLSTOfflineInterpreterHelper.executeScript(WLSTOfflineInterpreterHelper.java:165)

        at com.oracle.cie.wizard.domain.helpers.Executor.runWLSTScript(Executor.java:57)

        at com.oracle.cie.domain.script.Unpacker.main(Unpacker.java:474)

 

UNPACK COMMAND FAILED WITH ERROR: Attribute "Password" is not set for user "weblogic"

Solution < DOCI ID: 2373954.1 >

SOLUTION

unpack.cmd -template=C:\WEBLOGIC\base_domain.jar 
-domain=c:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain 
-user_name=weblogic -password=weblogic123





After UNPACK Completes you can see, BASE_DOMAIN Created under Oracle_home.



STEP 4 – WLSNODE2 Change Node Manager Configuration

4.1 Update nodemanager Listening Address

Navigate to Location user_projects/domains/base_domain/nodemanager


Update nodemanager.properties

Change the nodemanager Listen Address to IP address of WLSNODE2

You can change the PORT of node manager too, if you want.



4.2 Start Node Manager




    

STEP 5 – WLSNODE2 Enroll Node Manager with Admin server of wlsnode1


cd C:\Oracle\Middleware\Oracle_Home\oracle_common\common\bin

setWLSTEnv.cmd

wlst.cmd


wls:/offline> connect('weblogic','weblogic123','t3://wlsnode1:7001')



wls:/base_domain/serverConfig/>


nmEnroll('C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain',
'C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\nodemanager')

Enrolling this machine with the domain directory at C:\Oracle\Middleware\Oracle_Home\user_projects\domainase_domain...

Trace back (innermost last):

  File "<console>", line 1, in?

  File "<iostream>", line 1710, in NM Enroll

  File "<iostream>", line 553, in raiseWLSTException

WLSTException: Error occurred while performing NM Enroll: Problem enrolling the machine. : C:\Oracle

\Middleware\Oracle_Home\user_projects\domainase_domain\security\SerializedSystemIni.dat (The filename, directory name, or volume label syntax is incorrect)

Use dumps tack () to view the full stack trace:




SOLUTION           : ON WINDOWS use \\ instead of \

nmEnroll('C:\\Oracle\\Middleware\\Oracle_Home\\user_projects\\domains\\base_domain',
'C:\\Oracle\Middleware\\Oracle_Home\\user_projects\\domains\\base_domain\\nodemanager')



STEP 6: Create Machine / Managed Server on WLSNODE2

è Login to Admin Console http://wlsnode1:7001/console

6.1   Create a Machine

o   Click on Machines

o   NEW


o   Create Machine with details of WLSNODE2 nodemanager listen address



6.1   Create a Managed Server MS2

·         Click on Servers

·         NEW



6.1   Assign MS2 to machine mac2

o   Login to Admin console of wlsnode1

o   Machines

o   Select MAC2

o   Servers

o   ADD

o   Select MS2 managed server

o   Finish



STEP 7: Start Managed Server MS2 from Admin console

Let’s start MS1 & MS2


STEP 8: CREATE CLUSTER

·         Login to Admin console

·         Stop Both Managed Servers

·         Lock & Edit

·         Clusters

Cluster is created


8.2   Add members to cluster

·         Click on Cluster-0 from previous screen

·         Servers


Add


Add both Managed Servers

FINISH


Let’s Start Managed Servers


STEP 8: DEPLOYMENTS ON CLUSTER

·         Login to Admin console

·         Deployments

·         Select the Deployment file






Deployment is ready to serve request




STEP 9: Let’s Configure OHS



 


Ms1 à WLSNODE1: 192.168.10.10: Port 7003

Ms2 à WLSNODE2:192.168.10.20: Port 7003

End users should get only 1 URL and not multiple as standard practice.

Solution 1 – Make use of virtual IP

Solution 2 – OHS

 

·         Install and configure OHS

·         http://wlsnode1:7777/ 

·         Update the file mod_wl_ohs  and add following entry


·         Restart OHS


·         Access the application page



·         Stop one of the Managed servers and try to access




Thank you !















No comments:

Post a Comment