Thursday, September 26, 2013

Web logic : Node Manager

In production Environments we always maintain several number of Clusters that are spanned over multiple physical machines. In the case of weblogic , we create managed nodes for different cluster on different machines to provide high availability and also to eliminate single point of failure.

For allowing remote web logic Nodes to be started, stopped and recycled Web logic provides a utility called “Node Manager”.

These are of two type of Node Managers available
Java Based (runs under JVM)
Script Based (not available on windows)

For Windows Machine only Java Based Node Manager is supported where as for Unix/Linux both Java Based and Script Based Node Manager are supported.

Java Based (more secure) Node Manager is secured using SSL where as security in Script Based (less secure) Node Manager is implemented more easily using ssh or rsh.

Node Manager component is optional but it is good utility if you need to manage remote webloigc nodes. Other way it to go to the remote machine and Perform operations on those Instances manually.

In this article we will see how we can configure the node Manager on the local system and use that to perform operations on the Nodes.

Node Manager is installed on physical machine and is not linked to any Domain. If there are multiple domain on one machine , all domains can use same Node Manager.

Lets Configure a machine and Node Manager and See how they work.

Configure a Machine
1. Login to the AdminServer console
  1. Navigate through Domain Structure to %DOMAIN_NAME% -> Environment -> Machines
  2. Create a new machine
    Name : localhost
    OS : Other
    In the Next Screen ,
  3. Choose Type “SSL”
  4. Listen Address : localhost
  5. Keep The Port as 5556.
  6. Save
Assign Servers to Machines

Assign a Managed Node to machines based on which machine the Managed Node is hosted.
Take Lock & Edit and navigate through
%DOMAIN_NAME% -> Environment -> Machines -> %MACHINE_NAME% -> Configuration tab -> Servers tab

Click add to add a Managed Node that exists on the Machine.
Save

Once we added the Servers to the Machines , We can go to $BEA_HOME/wlsserver_10.3/server/bin and run
startNodeManager.sh script

[root@vx111a bin]# ./startNodeManager.sh
+ CLASSPATH=/root/Oracle/Middleware/patch_wls1036/profiles/default/sys_manifest_classpath/(Removed Since too Long)
+ '[' '!' -z '' ']'
+ '[' '!' -z '' ']'
+ export CLASSPATH
+ export PATH
+ cd /root/Oracle/Middleware/wlserver_10.3/common/nodemanager
+ set -x
+ '[' '' '!=' '' ']'
+ '[' '' '!=' '' ']'
+ /soa/jdk1.7.0_25/bin/java -client -Xms32m -Xmx200m -XX:MaxPermSize=128m -Dcoherence.home=/root/Oracle/Middleware/coherence_3.7 -Dbea.home=/root/Oracle/Middleware -Xverify:none -Djava.security.policy=/root/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.policy -Dweblogic.nodemanager.javaHome=/soa/jdk1.7.0_25 weblogic.NodeManager -v
<Sep 26, 2013 7:02:46 AM> <INFO> <Loading domains file: /root/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.domains>
Sep 26, 2013 7:02:46 AM weblogic.nodemanager.server.NMServerConfig initDomainsMap
INFO: Loading domains file: /root/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.domains
<Sep 26, 2013 7:03:18 AM> <INFO> <Loading identity key store: FileName=/root/Oracle/Middleware/wlserver_10.3/server/lib/DemoIdentity.jks, Type=jks, PassPhraseUsed=true>
Sep 26, 2013 7:03:18 AM weblogic.nodemanager.server.SSLConfig loadKeyStoreConfig
INFO: Loading identity key store: FileName=/root/Oracle/Middleware/wlserver_10.3/server/lib/DemoIdentity.jks, Type=jks, PassPhraseUsed=true
<Sep 26, 2013 7:03:18 AM> <WARNING> <Node manager configuration properties file '/root/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.properties' not found. Using default settings.>
Sep 26, 2013 7:03:18 AM weblogic.nodemanager.server.NMServer <init>
WARNING: Node manager configuration properties file '/root/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.properties' not found. Using default settings.
<Sep 26, 2013 7:03:18 AM> <INFO> <Saving node manager configuration properties to '/root/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.properties'>
Sep 26, 2013 7:03:18 AM weblogic.nodemanager.server.NMServer <init>
INFO: Saving node manager configuration properties to '/root/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.properties'
Node manager v10.3

Configuration settings:

NodeManagerHome=/root/Oracle/Middleware/wlserver_10.3/common/nodemanager
ListenAddress=
ListenPort=5556
ListenBacklog=50
SecureListener=true
AuthenticationEnabled=true
NativeVersionEnabled=true
CrashRecoveryEnabled=false
JavaHome=/soa/jdk1.7.0_25/jre
StartScriptEnabled=false
StopScriptEnabled=false
StartScriptName=startWebLogic.sh
StopScriptName=
LogFile=/root/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.log
LogLevel=INFO
LogLimit=0
LogCount=1
LogAppend=true
LogToStderr=true
LogFormatter=weblogic.nodemanager.server.LogFormatter
DomainsFile=/root/Oracle/Middleware/wlserver_10.3/common/nodemanager/nodemanager.domains
DomainsFileEnabled=true
StateCheckInterval=500
UseMACBroadcast=false
DomainRegistrationEnabled=false
DomainsDirRemoteSharingEnabled=false

Domain name mappings:
base_domain -> /root/Oracle/Middleware/user_projects/domains/managed_domain
admin_domain -> /root/Oracle/Middleware/user_projects/domains/admin_domain

<Sep 26, 2013 7:03:18 AM EDT> <Info> <Security> <BEA-090905> <Disabling CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true>
<Sep 26, 2013 7:03:19 AM EDT> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG to FIPS186PRNG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true>
<Sep 26, 2013 7:03:19 AM EDT> <Info> <Security> <BEA-090908> <Using default WebLogic SSL Hostname Verifier implementation.>
<Sep 26, 2013 7:03:19 AM> <INFO> <Secure socket listener started on port 5556>
Sep 26, 2013 7:03:19 AM weblogic.nodemanager.server.SSLListener run
INFO: Secure socket listener started on port 5556
The Node Manager is Successfully Started.

Test
To test whether node manager is working fine or not we can go the Machine tab → Servers and try to recycle a Managed Node

We can see that recycle of the Server will be started.

Node Manager Domains
Once the node manager is started successfully , the domains that needs to be managed are loaded from the nodemanager.domain file which exits in $BEA_HOME/wlsserver_10.3/common/nodemanager/

[root@vx111a nodemanager]# cat nodemanager.domains
#Domains and directories created by Configuration Wizard
#Thu Sep 19 08:12:45 EDT 2013
base_domain=/root/Oracle/Middleware/user_projects/domains/managed_domain
admin_domain=/root/Oracle/Middleware/user_projects/domains/admin_domain

There is a way to make a new domain encroll for the node manager by using the WLST

Setup NodeManager to restore servers to their last known state after a reboot
Open nodemanager.properties $BEA_HOME/wlsserver_10.3/common/nodemanager/
1.Set CrashRecoveryEnabled property value to true
CrashRecoveryEnabled=true
2.Set StartScriptEnabled property value to true to invoke the startWeblogic script
StartScriptEnabled=true
3.Set StopScriptEnabled property value to true to invoke the stopWeblogic script and get the managed servers to shutdown cleanly
StopScriptEnabled=false
4.Restart of NodeManager service for each change to this nodemanager.properties file

NodeManager Domain Username and password
1. Login to the AdminServer console
  1. Click on Domain name in the Domain Structure and navigate through %DOMAIN_NAME% -> Security tab -> General tab -> Advanced link
  2. Take Lock & Edit and input the NodeManager username/password/confirm passwords fields and these could be unique from your weblogic console password.

More To Come

Happy learning :-)