Search This Blog

Wednesday 20 January 2021

Weblogic 14c Horizontal Cluster Setup on Linux


Weblogic Domain Structure that we are going to setup as part of this Lab as shown below:



Step 1) Install weblogic & Configure the domain on machine1

Installation guide: http://middlewareadmin-pavan.blogspot.com/2021/01/weblogic-14c-installation-lab.html

Step 2) Create a domain with 2 managed servers on machine1: 

http://middlewareadmin-pavan.blogspot.com/2021/01/weblogic-14c-domain-creation-gui-mode.html

Step 3) Install weblogic on machine2 and do not create domain.

Step 4) Shutdown ManagedServer_1, ManagedServer_2 & NodeManager on machine1

cd /home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/bin

[osboxes@machine1 bin]$ ./stopManagedWebLogic.sh ManagedServer_1

[osboxes@machine1 bin]$ ./stopManagedWebLogic.sh ManagedServer_2

[osboxes@machine1 bin]$ ./stopWebLogic.sh

[osboxes@machine1 bin]$ ./stopNodeManager.sh

Step 5) Create template using existing domain on machine1

cd /home/osboxes/Oracle/Middleware/Oracle_Home/oracle_common/common/bin

[osboxes@machine1 bin]$ ./pack.sh -domain=/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain -template=/home/osboxes/mydomain.jar -template_name="My WebLogic Domain" -template_author="pavan" -managed=true

<< read domain from "/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain"

>>  succeed: read domain from "/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain"

<< set config option Managed to "true"

>>  succeed: set config option Managed to "true"

<< write template to "/home/osboxes/mydomain.jar"

..............................

>>  succeed: write template to "/home/osboxes/mydomain.jar"

<< close template

>>  succeed: close template

[osboxes@machine1 bin]$

Step 6) Copy the template to machine2

[osboxes@machine1 bin]$ scp -r "/home/osboxes/mydomain.jar" machine2:/home/osboxes/
osboxes@machine2's password:
mydomain.jar                                                                                                                                                                                               100%   76KB   1.7MB/s   00:00
[osboxes@machine1 bin]$

Step 7) On machine 2 : Unpack the domain using the template mydomain.jar

cd /home/osboxes/Oracle/Middleware/Oracle_Home/oracle_common/common/bin

[osboxes@machine2 bin]$ pwd
/home/osboxes/Oracle/Middleware/Oracle_Home/oracle_common/common/bin

[osboxes@machine2 bin]$ ./unpack.sh -template=/home/osboxes/mydomain.jar -domain=/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain

<< read template from "/home/osboxes/mydomain.jar"
>>  succeed: read template from "/home/osboxes/mydomain.jar"
<< set config option DomainName to "base_domain"
>>  succeed: set config option DomainName to "base_domain"
>>  validateConfig "KeyStorePasswords"
>>  succeed: validateConfig "KeyStorePasswords"
<< write Domain to "/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain"
..................................................
>>  succeed: write Domain to "/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain"
<< close template
>>  succeed: close template
[osboxes@machine2 bin]$

Step 8) On machine2: Verify if the domain is created 

/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain

[osboxes@machine2 base_domain]$ ls -rlt
total 20
-rw-r-----. 1 osboxes osboxes  327 Jan 20 13:14 fileRealm.properties
drwxr-x---. 2 osboxes osboxes   24 Jan 20 18:03 lib
drwxr-x---. 6 osboxes osboxes 4096 Jan 20 18:03 bin
-rw-r-----. 1 osboxes osboxes  763 Jan 20 18:04 startManagedWebLogic_readme.txt
-rwxr-x---. 1 osboxes osboxes  293 Jan 20 18:04 startWebLogic.sh
drwxr-x---. 2 osboxes osboxes   63 Jan 20 18:04 nodemanager
drwxr-x---. 2 osboxes osboxes 4096 Jan 20 18:04 init-info
drwxr-x---. 2 osboxes osboxes  167 Jan 20 18:04 security
drwxr-x---. 9 osboxes osboxes  213 Jan 20 18:04 config

Step 9) On machine1: start the NodeManager and AdminServer

[osboxes@machine1 bin]$ nohup ./startWebLogic.sh &
[1] 117208
[osboxes@machine1 bin]$ nohup: ignoring input and appending output to 'nohup.out'


[osboxes@machine1 bin]$ nohup ./startNodeManager.sh &
[3] 116976
[osboxes@machine1 bin]$ nohup: ignoring input and appending output to 'nohup.out'

[osboxes@machine1 bin]$ tail -f nohup.out
coherence.startup.JavaHome=/home/osboxes/jdk-11.0.9
coherence.startup.MW_Home=

Domain name mappings:

base_domain -> /home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain

<Jan 20, 2021 2:38:28 PM Eastern Standard Time> <INFO> <14.1.1.0.0>
<Jan 20, 2021 2:38:28 PM Eastern Standard Time> <INFO> <Server Implementation Class: weblogic.nodemanager.server.NMServer$ClassicServer.>
<Jan 20, 2021 2:38:30 PM Eastern Standard Time> <INFO> <Secure socket listener started on port 5556, host /192.168.1.196>

Step 10) On machine2: update the nodemanager.properties 
PropertiesVersion=14.1.1.0.0
ListenAddress=192.168.1.197

Step 11) Enroll NodeManager on machine2

cd /home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/bin

[osboxes@machine2 bin]$ . ./setDomainEnv.sh
[osboxes@machine2 base_domain]$ java weblogic.WLST

Initializing WebLogic Scripting Tool (WLST) ...

Welcome to WebLogic Server Administration Scripting Shell

Type help() for help on available commands

wls:/offline> connect('weblogic', 'weblogic1', 't3://machine1:9001')
Connecting to t3://machine1:9001 with userid weblogic ...
Successfully connected to Admin Server "AdminServer" that belongs to domain "base_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:/base_domain/serverConfig/> nmEnroll('/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain','/home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/nodemanager')
Enrolling this machine with the domain directory at /home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain ...
Successfully enrolled this machine with the domain directory at /home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain.
wls:/base_domain/serverConfig/> exit()


Exiting WebLogic Scripting Tool.


Step 12) On machine2 Start the NodeManager 

[osboxes@machine2 bin]$ nohup ./startNodeManager.sh &
[1] 8314
[osboxes@machine2 bin]$ nohup: ignoring input and appending output to 'nohup.out'

[osboxes@machine2 bin]$ tail -f nohup.out
coherence.startup.JavaHome=/home/osboxes/jdk-11.0.9
coherence.startup.MW_Home=

Domain name mappings:

base_domain -> /home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain

<Jan 20, 2021 6:47:39 PM Eastern Standard Time> <INFO> <14.1.1.0.0>
<Jan 20, 2021 6:47:39 PM Eastern Standard Time> <INFO> <Server Implementation Class: weblogic.nodemanager.server.NMServer$ClassicServer.>
<Jan 20, 2021 6:47:40 PM Eastern Standard Time> <INFO> <Secure socket listener started on port 5556, host /192.168.1.197>


Step 13) Create a machine - Machine_2 . Create ManagedServer_3 and ManagedServer_4 from the console . Add ManagedServer_3 , ManagedServer_4 to the Machine_2 and Cluster_1



































Step 14) Restart AdminServer which is running on machine1

Step 15) Start all the managed Servers configured on machine1 & machine2

Machine 1:

cd /home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/bin

[osboxes@machine1 bin]$ nohup ./startManagedWebLogic.sh ManagedServer_1 t3://machine1:9001 &
[2] 118685
[osboxes@machine1 bin]$ nohup: ignoring input and appending output to 'nohup.out'

[osboxes@machine1 bin]$ nohup ./startManagedWebLogic.sh ManagedServer_2 t3://machine1:9001 &
[3] 118770
[osboxes@machine1 bin]$ nohup: ignoring input and appending output to 'nohup.out'

Machine 2:

Note :Refer the below link to setup boot.properties file if you don't want to enter user name and password on the terminal and you can run the script on the back ground after boot identity has been set.

cd /home/osboxes/Oracle/Middleware/Oracle_Home/user_projects/domains/base_domain/bin

[osboxes@machine2 bin]$ ./startManagedWebLogic.sh ManagedServer_3 t3://machine1:9001

[osboxes@machine2 bin]$ ./startManagedWebLogic.sh ManagedServer_4 t3://machine1:9001









2 comments:

Harsh Vardhan said...

You have written an excellent blog.keep sharing your knowledge.
Linux Training in Chennai
Linux Online Courses
Linux Course in Chennai

Unknown said...

Thanks Man. It was very helpful.