Today, Chris Giddings one of our subscriber asked us by commenting if we have any automated script which can start the Admin Server as they have this type of requirement and the script should not take much load too on there system. So seeing the requirement we took out sometime and wrote a WLST script which can do that job for Chris and hope that this script would also help our other subscribers too.
The logic behind this WLST script is that first this script would start the NodeMnager, then the script would connect to NodeMnager and then it would also start the Admin Server. So in short this script would do three things in no time without much load and just by changing few things in the property file called domains.properties as per your environment which has all the details about the domains and the server which has to started.
Note:
- Make sure you associate a Machine for the Admin Server
- Make sure you keep both this files (i.e. domains.properties and Start_Admin.py) in the same folder when you are running the script or else you would have to give the path.
- Also this script would create nm_data.properties, nodemanager.log and nodemanager.properties if they are not present in the directory from where you are running the script.
- This script does not use SSL, so you would have to first start the adminserver using startWebLogic.sh first, then go to the Admin Console path
Environment –> Machines –> [YOUR_MACHINE_NAME] –> Configuration [tab] –> Node Manager [sub-tab]
Type = Plain
- Following is the nodemanager.properties which we had used you can notice that SecureListener=false as we not using SSL and StartScriptEnabled=true because we had got OutOfMemory: PermGen error so by doing this the memory parameters would be picked up by startWebLogic.sh
#Fri Apr 29 20:12:43 IST 2011 DomainsFile=/WLS/Start_Admin/nodemanager.domains LogLimit=0 PropertiesVersion=10.3 AuthenticationEnabled=true NodeManagerHome=/WLS/Start_Admin JavaHome=/Jdk/jdk1.6.0_21/jre LogLevel=INFO DomainsFileEnabled=true StartScriptName=startWebLogic.sh ListenAddress=localhost NativeVersionEnabled=true ListenPort=5556 LogToStderr=true SecureListener=false LogCount=1 StopScriptEnabled=false QuitEnabled=true LogAppend=true StateCheckInterval=500 CrashRecoveryEnabled=false StartScriptEnabled=true LogFile=/WLS/Start_Admin/nodemanager.log NodemanagerHome=/WLS103/wlserver_10.3/common/nodemanager LogFormatter=weblogic.nodemanager.server.LogFormatter ListenBacklog=50
Steps to Start AdminServer And NodeManager Using WLST
1. Below is the details which domains.properties would have
username=weblogic password=weblogic host=localhost nm.port=5556 domain.name=Domain_7001 domain.dir=/WLS103/user_projects/domains/Domain_7001 nm.type=plain server.name=AdminServer
2. And below is the WLST python script Start_Admin.py which would call the above properties.
############################################################################# # # @author Copyright (c) 2010 - 2011 by Middleware Magic, All Rights Reserved. # ############################################################################# from java.io import FileInputStream import java.lang import os import string propInputStream = FileInputStream("domain.properties") configProps = Properties() configProps.load(propInputStream) Username = configProps.get("username") Password = configProps.get("password") Host = configProps.get("host") nmPort = configProps.get("nm.port") domainName = configProps.get("domain.name") domainDir = configProps.get("domain.dir") nmType = configProps.get("nm.type") startNodeManager() print '' print '=============================================' print ' NODE MANAGER started Successfully...!!!' print '=============================================' print '' nmConnect(Username,Password,Host,nmPort,domainName,domainDir,nmType) print '' print '=============================================' print 'Connected to NODE MANAGER Successfully...!!!' print '=============================================' print '' serverName = configProps.get("server.name") print '###### serverName = ', serverName nmStart(serverName) serverName = configProps.get("server.name") print '' print '=============================================' print '===> Successfully started ', serverName, ' <===' print '=============================================' print ''
3 . Following would be the output as soon as you run the Start_Admin.py using the below command
Command:
java weblogic.WLST Start_Admin.py
Output:
D:\Oracle\Test App\Domain>java weblogic.WLST Start_Admin.py Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands Launching NodeManager ... Properties: {} Command: /Jdk/jdk1.6.0_21/jre/bin/java -d64 -classpath /Jdk/jdk1.6.0_21/jre/lib/rt.jar:/Jdk/jdk1.6.0_21/jre/lib/i18n.jar:/WLS103/patch_wls1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/WLS103/patch_cie660/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/Jdk/jdk1.6.0_21/lib/tools.jar:/WLS103/wlserver_10.3/server/lib/weblogic_sp.jar:/WLS103/wlserver_10.3/server/lib/weblogic.jar:/WLS103/modules/features/weblogic.server.modules_10.3.0.0.jar:/WLS103/wlserver_10.3/server/lib/webservices.jar:/WLS103/modules/org.apache.ant_1.6.5/lib/ant-all.jar:/WLS103/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:/WLS103/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:/WLS103/wlserver_10.3/server/lib/xqrl.jar weblogic.NodeManager -v NMProcess: <Apr 29, 2011 8:32:53 PM> <INFO> <Loading domains file: /WLS/Start_Admin/nodemanager.domains> NMProcess: <Apr 29, 2011 8:32:53 PM> <WARNING> <Domains file not found: /WLS/Start_Admin/nodemanager.domains> NMProcess: <Apr 29, 2011 8:32:53 PM> <INFO> <Loaded node manager configuration properties from '/WLS/Start_Admin/nodemanager.properties'> NMProcess: Node manager v10.3 NMProcess: NMProcess: Configuration settings: NMProcess: NMProcess: NodeManagerHome=/WLS/Start_Admin NMProcess: ListenAddress=localhost NMProcess: ListenPort=5556 NMProcess: ListenBacklog=50 NMProcess: SecureListener=false NMProcess: AuthenticationEnabled=true NMProcess: NativeVersionEnabled=true NMProcess: CrashRecoveryEnabled=false NMProcess: JavaHome=/Jdk/jdk1.6.0_21/jre NMProcess: StartScriptEnabled=true NMProcess: StopScriptEnabled=false NMProcess: StartScriptName=startWebLogic.sh NMProcess: StopScriptName= NMProcess: LogFile=/WLS/Start_Admin/nodemanager.log NMProcess: LogLevel=INFO NMProcess: LogLimit=0 NMProcess: LogCount=1 NMProcess: LogAppend=true NMProcess: LogToStderr=true NMProcess: LogFormatter=weblogic.nodemanager.server.LogFormatter NMProcess: DomainsFile=/WLS/Start_Admin/nodemanager.domains NMProcess: DomainsFileEnabled=true NMProcess: StateCheckInterval=500 NMProcess: QuitEnabled=true NMProcess: NMProcess: Domain name mappings: NMProcess: NMProcess: NMProcess: <Apr 29, 2011 8:32:54 PM> <INFO> <Plain socket listener started on port 5556, host localhost> Successfully launched the Node Manager. The Node Manager process is running independent of the WLST process. Exiting WLST will not stop the Node Manager process. Please refer to the Node Manager logs for more information. The Node Manager logs will be under /WLS/Start_Admin/. ============================================= NODE MANAGER started Successfully...!!! ============================================= Connecting to Node Manager ... NMProcess: <Apr 29, 2011 8:33:03 PM> <Info> <Domain_7001> <MS-1> <Startup configuration properties loaded from "/WLS103/user_projects/domains/Domain_7001/servers/MS-1/data/nodemanager/startup.properties"> Successfully Connected to Node Manager. ============================================= Connected to NODE MANAGER Successfully...!!! ============================================= ###### serverName = AdminServer Starting server AdminServer ... NMProcess: <Apr 29, 2011 8:33:03 PM> <Info> <Domain_7001> <AdminServer> <Rotated server output log to "/WLS103/user_projects/domains/Domain_7001/servers/AdminServer/logs/AdminServer.out00007"> NMProcess: <Apr 29, 2011 8:33:03 PM> <Info> <Domain_7001> <AdminServer> <Server error log also redirected to server log> NMProcess: <Apr 29, 2011 8:33:03 PM> <Info> <Domain_7001> <AdminServer> <Starting WebLogic server with command line: /WLS103/user_projects/domains/Domain_7001/bin/startWebLogic.sh > NMProcess: <Apr 29, 2011 8:33:03 PM> <Info> <Domain_7001> <AdminServer> <Working directory is "/WLS103/user_projects/domains/Domain_7001"> NMProcess: <Apr 29, 2011 8:33:03 PM> <Info> <Domain_7001> <AdminServer> <Server output log file is "/WLS103/user_projects/domains/Domain_7001/servers/AdminServer/logs/AdminServer.out"> Successfully started server AdminServer ... ============================================= ===> Successfully started AdminServer <=== =============================================
.
.
Regards,
Ravish Mody
April 30th, 2011 on 3:38 am
Thanks for the example! This is very similar to what we were trying as well.
Our issue is with the configuration of SSL using custom keystores and needing the passphrases for those.
Could you update this example with the information needed to account for using SSL?
TopMagicUsersMay 2nd, 2011 on 6:19 pm
Hi Ravish,
Thanks for posting this. i am trying to implement it our side . According to our environment we make changes in the domains.properties but i getting Fatal error in NODE MANAGER while running this script.
It showing the following exceptions :
java weblogic.WLST Start_Admin.py
Initializing WebLogic Scripting Tool (WLST) …
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
/weblogic/Oracle11g/Middleware/user_projects/domains/base_domain
Launching NodeManager …
Properties: {}
Command: /opt/jdk1.6.0_22/jre/bin/java -classpath /opt/jdk1.6.0_22/jre/lib/rt.jar:/opt/jdk1.6.0_22/jre/lib/i18n.jar:/opt/jdk1.6.0_22/lib:/weblogic/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/weblogic/Oracle/Middleware/user_projects/domains/base_domain/servers/AdminServer/upload:/weblogic/Oracle/Middleware/user_projects/domains/base_domain/servers/ms_7003/stage:/weblogic/Oracle/Middleware/user_projects/domains/base_domain/servers/ms_7004/stage:/weblogic/Oracle/Middleware/user_projects/domains/base_domain/servers/ms_7005/stage:/weblogic/Oracle/Middleware/modules:/weblogic/Oracle/Middleware/user_projects/domains/base_domain weblogic.NodeManager -v
NMProcess:
NMProcess: May 2, 2011 6:26:19 PM weblogic.nodemanager.server.NMServerConfig initDomainsMap
NMProcess: INFO: Loading domains file: /weblogic/Oracle11g/Middleware/nodemanager.domains
NMProcess:
NMProcess: May 2, 2011 6:26:19 PM weblogic.nodemanager.server.NMServerConfig initDomainsMap
NMProcess: WARNING: Domains file not found: /weblogic/Oracle11g/Middleware/nodemanager.domains
NMProcess:
NMProcess: weblogic.nodemanager.common.ConfigException: Native version is enabled but nodemanager native library could not be loaded
NMProcess: at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:249)
NMProcess: at weblogic.nodemanager.server.NMServerConfig.(NMServerConfig.java:190)
NMProcess: at weblogic.nodemanager.server.NMServer.init(NMServer.java:182)
NMProcess: at weblogic.nodemanager.server.NMServer.(NMServer.java:148)
NMProcess: at weblogic.nodemanager.server.NMServer.main(NMServer.java:390)
NMProcess: at weblogic.NodeManager.main(NodeManager.java:31)
NMProcess: Caused by: java.lang.UnsatisfiedLinkError: no nodemanager in java.library.path
NMProcess: at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
NMProcess: at java.lang.Runtime.loadLibrary0(Runtime.java:823)
NMProcess: at java.lang.System.loadLibrary(System.java:1028)
NMProcess: at weblogic.nodemanager.util.UnixProcessControl.(UnixProcessControl.java:24)
NMProcess: at weblogic.nodemanager.util.ProcessControlFactory.getProcessControl(ProcessControlFactory.java:22)
NMProcess: at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:247)
NMProcess: … 5 more
NMProcess:
NMProcess: May 2, 2011 6:26:19 PM weblogic.nodemanager.server.NMServer main
NMProcess: SEVERE: Fatal error in node manager server
NMProcess: weblogic.nodemanager.common.ConfigException: Native version is enabled but nodemanager native library could not be loaded
NMProcess: at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:249)
NMProcess: at weblogic.nodemanager.server.NMServerConfig.(NMServerConfig.java:190)
NMProcess: at weblogic.nodemanager.server.NMServer.init(NMServer.java:182)
NMProcess: at weblogic.nodemanager.server.NMServer.(NMServer.java:148)
NMProcess: at weblogic.nodemanager.server.NMServer.main(NMServer.java:390)
NMProcess: at weblogic.NodeManager.main(NodeManager.java:31)
NMProcess: Caused by: java.lang.UnsatisfiedLinkError: no nodemanager in java.library.path
NMProcess: at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
NMProcess: at java.lang.Runtime.loadLibrary0(Runtime.java:823)
NMProcess: at java.lang.System.loadLibrary(System.java:1028)
NMProcess: at weblogic.nodemanager.util.UnixProcessControl.(UnixProcessControl.java:24)
NMProcess: at weblogic.nodemanager.util.ProcessControlFactory.getProcessControl(ProcessControlFactory.java:22)
NMProcess: at weblogic.nodemanager.server.NMServerConfig.initProcessControl(NMServerConfig.java:247)
NMProcess: … 5 more
NMProcess: Stopped draining NMProcess
NMProcess: Stopped draining NMProcess
Successfully launched the Node Manager.
The Node Manager process is running independent of the WLST process.
Exiting WLST will not stop the Node Manager process. Please refer
to the Node Manager logs for more information.
The Node Manager logs will be under /weblogic/Oracle11g/Middleware/.
Node Manager starting in the background
=============================================
NODE MANAGER started Successfully…!!!
=============================================
Connecting to Node Manager …
This Exception occurred at Mon May 02 18:26:28 IST 2011.
weblogic.nodemanager.NMConnectException: Connection refused. Could not connect to NodeManager. Check that it is running at 172.30.0.7:5560.
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at weblogic.nodemanager.client.PlainClient.createSocket(PlainClient.java:32)
at weblogic.nodemanager.client.NMServerClient.connect(NMServerClient.java:228)
at weblogic.nodemanager.client.NMServerClient.checkConnected(NMServerClient.java:200)
at weblogic.nodemanager.client.NMServerClient.checkConnected(NMServerClient.java:206)
at weblogic.nodemanager.client.NMServerClient.getVersion(NMServerClient.java:53)
at weblogic.management.scripting.NodeManagerService.verifyConnection(NodeManagerService.java:179)
at weblogic.management.scripting.NodeManagerService.nmConnect(NodeManagerService.java:172)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
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.PyObject.invoke(Unknown Source)
at org.python.pycode._pyx2.nmConnect$3(:118)
at org.python.pycode._pyx2.call_function()
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyFunction.__call__(Unknown Source)
at org.python.core.PyObject.__call__(Unknown Source)
at org.python.pycode._pyx15.f$0(/weblogic/Oracle11g/Middleware/Start_Admin.py:33)
at org.python.pycode._pyx15.call_function(/weblogic/Oracle11g/Middleware/Start_Admin.py)
at org.python.core.PyTableCode.call(Unknown Source)
at org.python.core.PyCode.call(Unknown Source)
at org.python.core.Py.runCode(Unknown Source)
at org.python.util.PythonInterpreter.execfile(Unknown Source)
at weblogic.management.scripting.WLST.main(WLST.java:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at weblogic.WLST.main(WLST.java:29)
Problem invoking WLST – Traceback (innermost last):
File “/weblogic/Oracle11g/Middleware/Start_Admin.py”, line 33, in ?
File “”, line 123, in nmConnect
File “”, line 646, in raiseWLSTException
WLSTException: Error occured while performing nmConnect : Cannot connect to Node Manager. : Connection refused. Could not connect to NodeManager. Check that it is running at 172.30.0.7:5560.
Use dumpStack() to view the full stacktrace
Guys, plz check it .
THANKS IN ADVANCE
TopMagicUsersMay 2nd, 2011 on 6:42 pm
Hi Fabian,
Solution – 1
==========
Set “NativeVersionEnabled” property to “false” in nodemanager.properties file and then try again.
Solution – 2
==========
If still you see the same issue try look into Issue-1 in below post
Topic: Common NodeManager Issues in WebLogic
Solution – 3
==========
Try with only using just our domains.properties (i.e. changing the values as per your requirement ) and Start_Admin.py files in the same directory and then run the script. You would notice that few new files would get created in the same folder and might the script would not run.
After that just make the changes in your nodemanager.properties as per ours and then try it again. That should solve your issue.
Regards,
TopMagicUsersRavish Mody
May 3rd, 2011 on 6:09 pm
Hi Ravish,
Thanks for the solution.
Followed all the 3 solutions Provided by ya but still getting the same error
I faced another problem while following the 2nd solution which you had provided ie
(For Solaris/Linux)
LD_LIBRARY_PATH:$WL_HOME/server/lib/solaris:$WL_HOME/server/lib/solaris/ociXXX_X
I neva had ociXXX_X file inside solaris folder.
Checked my admin server.logs,to find out what library path setting has been set while starting Admin server
java.library.path=/weblogic/Oracle11g/Middleware/wlserver_10.3/server/native/solaris/sparc/oci920_8,
but when i manually searched for this particular file,then oci920_8 was not found in entire weblogic home.
So i tired setting the LD_LIBRARY_PATH in startnodemanager scripts as follows
if [ -n "$LD_LIBRARY_PATH" ]; then
LD_LIBRARY_PATH=/weblogic/Oracle11g/Middleware/wlserver_10.3/server/native/solaris
else
LD_LIBRARY_PATH=/weblogic/Oracle11g/Middleware/wlserver_10.3/server/native/solaris
fi
export LD_LIBRARY_PATH
echo “LD_LIBRARY_PATH=$LD_LIBRARY_PATH”
But still getting same problem.Even tried to Set NativeVersionEnabled” property to “false”..
Am i missing something..im using wls 10.3.4 and platform:solaris
Thanks in Advance
Regards
TopMagicUsersFabian
May 4th, 2011 on 10:44 am
Hi Ravish,
Thanks for the solution.
Followed all the 3 solutions Provided by ya but still getting the same error
I faced another problem while following the 2nd solution which you had provided ie
(For Solaris/Linux)
LD_LIBRARY_PATH:$WL_HOME/server/lib/solaris:$WL_HOME/server/lib/solaris/ociXXX_X
I neva had ociXXX_X file inside solaris folder.
Checked my admin server.logs,to find out what library path setting has been set while starting Admin server
java.library.path=/weblogic/Oracle11g/Middleware/wlserver_10.3/server/native/solaris/sparc/oci920_8,
but when i manually searched for this particular file,then oci920_8 was not found in entire weblogic home.
So i tired setting the LD_LIBRARY_PATH in startnodemanager scripts as follows
if [ -n "$LD_LIBRARY_PATH" ]; then
LD_LIBRARY_PATH=/weblogic/Oracle11g/Middleware/wlserver_10.3/server/native/solaris
else
LD_LIBRARY_PATH=/weblogic/Oracle11g/Middleware/wlserver_10.3/server/native/solaris
fi
export LD_LIBRARY_PATH
echo “LD_LIBRARY_PATH=$LD_LIBRARY_PATH”
But still getting same problem.Even tried to Set NativeVersionEnabled” property to “false”..
Am i missing something..im using wls 10.3.4 and platform:solaris
Thanks in Advance
Regards
TopMagicUsersFabian
May 4th, 2011 on 11:47 pm
Hi ravish,
i have doubt on enabling startscriptEnabled=true on nodemanager.properties.
i have given the startupscript name as the “startmanagerserver.sh” (script to start managed server). but i want to specify the script for starting Admin server also, then how to achieve it.
thanks
TopMagicUsersArun
May 4th, 2011 on 11:50 pm
Hi mailarunkumars,
TopMagicUsers“nodemanager.properties” file has an additional properties “StartScriptName” you can add this to point to whatever Script you want to….which is placed inside “$DOMAIN_HOME\bin”
Example:
StartScriptName=YourCustomStartUpScript.sh
.
.
Keep Posting
Thanks
Jay SenSharma
May 5th, 2011 on 2:40 pm
Hi Jay,
thanks for your response!
i understand that. suppose say i have Adminserver and managedserver on the same machine & both have different customstartupscript . So we have only one nodemanager.properties , in that case how do we specify the two different customstartupscript.
thanks
TopMagicUsersArun
May 5th, 2011 on 3:18 pm
Hi mailarunkumars,
A NodeManager can bootup with the help of “nodemanager.properties” file.
TopMagicUsersSo in your case you will need to start two Separate NodeManagers on Different NodeManager Ports. Now both the NodeManagers can use their own set of Properties files.
Means NodeManager-1 with runs on the same Box using nodemanager.properties file can have a it’s own StartScriptName.
Same way you will have to start another Nodemanager from a different directory to start your ManagedServers then you can change the nodemanager.properties file according to your requirement.
.
.
Keep Posting
Thanks
Jay SenSharma
May 5th, 2011 on 3:31 pm
Hi Jay,
TopMagicUsersThanks for the response.
Whether this is the usual method followed while configuring nodemanager which have admin & managedserver on the same machine ?
No other options ?
May 5th, 2011 on 3:45 pm
HI mailarunkumars,
TopMagicUsersAs your requirement is Unusual hence the Solution cannot be Usual.
The previously mentioned way/solution is the best way to achieve the same. We would request you to open a Support Ticket with Oracle WebLogic Support team to find out the Exact Usual Solution because they have recommended ways.
.
.
Keep Posting
Thanks
Jay SenSharma
May 5th, 2011 on 4:14 pm
Thanks Jay! for your prompt response. it is very helpful.
TopMagicUsersJune 19th, 2011 on 4:50 pm
Hi,
How to changes nodemanager properties using WLST? Can you please tell me how to change nodemanager listen address, port, home and logfile location. Thanks.
Rajendra
TopMagicUsersJune 19th, 2011 on 8:39 pm
Hi Rajendra,
You will find your answers by looking at the file “$WL_HOME/server/bin/startNodeManager.cmd” (for unix “startNodeManager.sh”).
This file has all the above mentioned details which you want to change.
:runNMWithListenAddressAndPort
“%JAVA_HOME%\bin\java.exe” %JAVA_VM% %MEM_ARGS% %JAVA_OPTIONS% “-Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy” “-Dweblogic.nodemanager.javaHome=%JAVA_HOME%” -DListenAddress=”%LISTEN_ADDRESS%” -DListenPort=”%LISTEN_PORT%” weblogic.NodeManager -v
.
TopMagicUsers.
Keep Posting
Thanks
Jay SenSharma
October 16th, 2011 on 6:25 pm
hello,
I would like to start domain,Managed servers all by the NodeManager.
But when I’m trying start and connect the NodeManager It doesn’t seems to work.
as you can see it seems that the startNodeManager ran succesfully, and it written that the NodeManager is running independed to the WLST,
but it seems that if I close WLST session also the nodeManager is stopped,
Also getting error when running nmConnect command.
Please advice
Thanks
Lea
bash-3.00$ java weblogic.WLST
Initializing WebLogic Scripting Tool (WLST) …
Welcome to WebLogic Server Administration Scripting Shell
Type help() for help on available commands
wls:/offline> nmhome = ‘/wli/wlserver_10.3/common/nodemanager’
wls:/offline> nmpfile = ‘/wli/wlserver_10.3/common/nodemanager/nodemanager.properties’
wls:/offline> startNodeManager(NodeManagerHome=nmhome,PropertiesFile=nmpfile)
Launching NodeManager …
Properties: {NodeManagerHome=/wli/wlserver_10.3/common/nodemanager,PropertiesFile=/wli/wlserver_10.3/common/nodemanager/nodemanager.properties,}
Command: /wli/jdk1.6.0_25/jre/bin/java -classpath /wli/jdk1.6.0_25/jre/lib/rt.jar:/wli/jdk1.6.0_25/jre/lib/i18n.jar:/wli/patch_wlw1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/wli/patch_wls1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/wli/patch_wlp1030/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/wli/patch_wli1031/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/wli/patch_cie670/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/wli/jdk1.6.0_25/lib/tools.jar:/wli/wlserver_10.3/server/lib/weblogic_sp.jar:/wli/wlserver_10.3/server/lib/weblogic.jar:/wli/modules/features/weblogic.server.modules_10.3.0.0.jar:/wli/wlserver_10.3/server/lib/webservices.jar:/wli/modules/org.apache.ant_1.6.5/lib/ant-all.jar:/wli/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar:/wli/wli_10.3/../modules/com.bea.wli.core.mflengine_1.1.0.0.jar:/wli/wlserver_10.3/common/eval/pointbase/lib/pbclient57.jar:/wli/wlserver_10.3/server/lib/xqrl.jar:/wli/wli_10.3/lib/worklist-system-required.jar:/wli/wli_10.3/L10N:/wli/wli_10.3/lib/jpd.jar:/wli/wli_10.3/lib/sftpspi_impl.jar:/wli/wli_10.3/lib/jca-binding-api.jar:/wli/wli_10.3/lib/bpm-infra.jar:/wli/wli_10.3/lib/xmlparserv2.jar:/wli/wlserver_10.3/server/lib/xqrl.jar:/wli/user_projects/domains/stress_TS1/lib/KpnUtils.jar:/wli/user_projects/domains/stress_TS1/lib/com.ibm.mq.jar:/wli/user_projects/domains/stress_TS1/lib/xmlbeans-1.0.jar weblogic.NodeManager -v
NMProcess:
NMProcess:
NMProcess: Node manager v10.3
NMProcess:
NMProcess: Configuration settings:
NMProcess:
NMProcess: NodeManagerHome=/wli/wlserver_10.3/common/nodemanager
NMProcess: ListenAddress=localhost
NMProcess: ListenPort=5556
NMProcess: ListenBacklog=50
NMProcess: SecureListener=false
NMProcess: AuthenticationEnabled=true
NMProcess: NativeVersionEnabled=false
NMProcess: CrashRecoveryEnabled=false
NMProcess: JavaHome=/wli/jdk1.6.0_25/jre
NMProcess: StartScriptEnabled=true
NMProcess: StopScriptEnabled=true
NMProcess: StartScriptName=startWebLogic.sh
NMProcess: StopScriptName=
NMProcess: LogFile=/wli/wlserver_10.3/common/nodemanager/nodemanager.log
NMProcess: LogLevel=INFO
NMProcess: LogLimit=0
NMProcess: LogCount=1
NMProcess: LogAppend=true
NMProcess: LogToStderr=true
NMProcess: LogFormatter=weblogic.nodemanager.server.LogFormatter
NMProcess: DomainsFile=/wli/wlserver_10.3/common/nodemanager/nodemanager.domains
NMProcess: DomainsFileEnabled=true
NMProcess: StateCheckInterval=500
NMProcess: QuitEnabled=true
NMProcess:
NMProcess: Domain name mappings:
NMProcess:
NMProcess: stress_TS1 -> /wli/user_projects/domains/stress_TS1
NMProcess:
NMProcess:
NMProcess:
NMProcess:
Successfully launched the Node Manager.
The Node Manager process is running independent of the WLST process.
Exiting WLST will not stop the Node Manager process. Please refer
to the Node Manager logs for more information.
The Node Manager logs will be under /wli/wlserver_10.3/common/nodemanager
wls:/offline>
wls:/offline> nmConnect(‘weblogic’, ‘weblogic’, ‘localhost’, 5556, ‘stress_TS1′, ‘/wli/user_projects/domains/stress_TS1′,’plain’)
TopMagicUsersConnecting to Node Manager …
Traceback (innermost last):
File “”, line 1, in ?
File “”, line 112, in nmConnect
WLSTException: Error occured while performing nmConnect : Cannot connect to Node Manager.Access to domain ‘stress_TS1′ for user ‘weblogic’ denied Use dumpStack() to view the full stacktrace
October 16th, 2011 on 7:52 pm
Hi Lea,
Looks like nmConnect() is failing due to credentials. Can you try deleting the “nm_password.properties” file located inside “$DOMAIN_HOME/config/nodemanager” then provide a different username & password for your nodeManager from adminConsole click on
DOMAIN_NAME—>security(tab)—>General (Tab)—->Advanced (link)—> specify new NodeManager username & password from the textbox.
and then check the file content inside the file “nm_password.properties” if it is encrypted properly?
Then Please Copy the “SerializedSystemIni.dat” file from “$DOMAIN_HOME/security” Location and Paste it inside “${WL_HOME}/common/nodemanager/security” directory. Enroll The NodeManager and restart it again.
.
TopMagicUsers.
Keep Posting
Thanks
Jay SenSharma
October 17th, 2011 on 6:49 pm
Hi Jay,
Thanks for your help, I followed your steps (except for cp SerializedSystemIni.dat to ${WL_HOME}/common/nodemanager/security” because I don’t have security folder so I didn’t create it),
and I managed to run nmConnect.
This is the script I’m using to start nodeManager,AdminServer and ManagedServers.
I have some more questions:
1. The script is also checking for the machine listen adress by
machine = server.getListenAddress()
The result of this command is nothing/null no value for machine listen adress.
In the console –> machine –> node Manager, the Listen Address is localhost, is that what it looking for?
Anyway I remarked the machine part from the script and it run, but I would like to understand which value should return by getListenAddress()
2. Is there a need to disconnect NodeManager by nmDisconnect(), according to the script after start AdminServer they run nmDisconnect,
what is that meaning and should I disconect it as well or to leave it open?
3. Until now we use to have only AdminServer and all the EAR’s used to be installed on the AdminServer, without managedServer and NodeManager.
My question is regarding the log file,It seems that all the message we used to have in the log doesn’t written anymore when using NodeManager
Massages like:
We used to have domain log file in the following path by add this line to /wli/user_projects/domains/stress_TS1/bin/startWebLogic.sh
WLS_REDIRECT_LOG=/log/domains/stress_TS1/start_weblogic.log
if [ "${WLS_REDIRECT_LOG}" = "" ] ; then
echo “Starting WLS with line:”
echo “${JAVA_HOME}/bin/java -d64 ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/w
eblogic.policy ${PROXY_SETTINGS} ${SERVER_CLASS}”
${JAVA_HOME}/bin/java -d64 ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogi
c.policy ${PROXY_SETTINGS} ${SERVER_CLASS}
else
echo “Redirecting output from WLS window to ${WLS_REDIRECT_LOG}”
${JAVA_HOME}/bin/java -d64 ${JAVA_VM} ${MEM_ARGS} ${JAVA_OPTIONS} -Dweblogic.Name=${SERVER_NAME} -Djava.security.policy=${WL_HOME}/server/lib/weblogi
c.policy -Dweblogic.Stdout=${WLS_REDIRECT_LOG} -Dweblogic.Stderr=${WLS_REDIRECT_LOG} ${PROXY_SETTINGS} ${SERVER_CLASS} > /dev/null 2>&1
fi
But when using NodeManager to start AdminServer there are no more infomration almost in the log file.
4. I need some explanation how to maintain the env using NodeManager
First I run the startNodemanager.py and the env is up (java weblogic.WLST startNodemanager.py),
Does the NodeManager will automatically start one of the servers in case they will stop?
when want to restart the servers, is it should be done by nmKill(‘AdminServer’)
what is the command to stop ManagedServer?
Sorry for so many questions,
thanks
startNodemanager.py
===================
from java.io import FileInputStream
import java.lang
import os
import string
nmhome = ‘/wli/wlserver_10.3/common/nodemanager’
nmpfile = ‘/wli/wlserver_10.3/common/nodemanager/nodemanager.properties’
# Function to get server state
def serverStatus(server):
cd(‘/ServerLifeCycleRuntimes/’ + server.getName() )
return cmo.getState()
def startAdminserver():
nmConnect(‘weblogic’, ‘weblogic’, ‘localhost’, ’5556′, ‘stress_TS1′, ‘/wli/user_projects/domains/stress_TS1′,’plain’)
nmStart(‘AdminServer_TS1′)
# nmDisconnect()
# Start the nodemanager
startNodeManager(NodeManagerHome=nmhome,PropertiesFile=nmpfile)
#Start Admin server
startAdminserver()
connect(‘weblogic’,'weblogic’,'t3://wli10stress-app:5001′)
#Start Managed server
svrs = cmo.getServers()
print svrs
domainRuntime()
for server in svrs:
# Do not start the adminserver, it’s already running
if server.getName() != ‘AdminServer_TS1′:
# Get state and machine
serverState = serverStatus(server)
#machine = server.getListenAddress()
print server.getName() + ” is ” + serverState
# startup if needed
if serverState == “SHUTDOWN” or “UNKNOWN”:
#if machine == localhost:
start(server.getName(),’Server’)
serverState = serverStatus(server)
print “Now ” + server.getName() + ” is ” + serverState
disconnect()
TopMagicUsersexit()
October 17th, 2011 on 10:49 pm
Hi Lea,
Query-1) Does the script is also checking for the machine listen adress by machine = server.getListenAddress()
We use the NodeManager for remote start & stop of managed Servers. Which is the basic need and purpose of NodeManager. So it is must that Each and every server associated with NodeManager must have a valid IP Address or the HostName which can be accessed from a remote machine. So Yes, we should always set the listen address of every server if we want to access them remotely. Do not use “localhost” or “127.0.0.1″ addresses for your servers which you want to access from remote machine/nodemanager.
Query-2). Is there a need to disconnect NodeManager by nmDisconnect(), according to the script after start AdminServer they run nmDisconnect, what is that meaning and should I disconect it as well or to leave it open?
As the nmDisconnect() is a WLST onLine as well as Offline command both. So if you have done working with the NodeManager then in that case you can disconnect from the running NodeManager using the nmDisconnect(). But if you still want to run some nodemanager related commands like (nmServerStatus(), ) which requires a connected nodemanager in that case you should not use nmDisconnect(). It is simple as until you want to read a file keep it open and once you finished reading file close it.
Query-3). Until now we use to have only AdminServer and all the EAR’s used to be installed on the AdminServer, without managedServer and NodeManager. My question is regarding the log file,It seems that all the message we used to have in the log doesn’t written anymore when using NodeManager.
As you had customized the “wli/user_projects/domains/stress_TS1/bin/startWebLogic.sh” script to run your AdminServer and log generation, so the NodeManager will not be aware of this customization. In this case if you want to tell your NodeManager to use the same script Options to run your Managed Servers as well then in that case you will need to add the following two lines inside your “$WL_HOME/common/nodemanager/nodemanager.properties” file to tell the nodemanager to use the startWebLogic.sh customization to start the managed servers as well:
StartScriptName=startWebLogic.sh
StartScriptEnabled=true
Query-4). I need some explanation how to maintain the env using NodeManager First I run the startNodemanager.py and the env is up (java weblogic.WLST startNodemanager.py), Does the NodeManager will automatically start one of the servers in case they will stop? when want to restart the servers, is it should be done by nmKill(‘AdminServer’) what is the command to stop ManagedServer?
No NodeManager will not start a server a Managed Server/AdminServer automatically. But using the NodeManager WLST command you can start a Server instance like nmStart(“managed1″) or nmStart(“AdminServer”). Yes if the NodeManager “Crash Recovery” feature is enabled then in that case it will restart a Server associated with it if the Server crashed. NodeManager will not try to start a Server which is not crashed rather manually shutdown using “kill -9″ or “Ctrl+c” More information on NodeManager crash recobery can be found in the following link: http://download.oracle.com/docs/cd/E13222_01/wls/docs92/server_start/nodemgr.html#wp1095708 (Node Manager and System Crash Recovery)
nmKill([serverName]) is the syntax oc nmKill command. This Kills the specified server instance that was started with Node Manager. If you do not specify a server name using the serverName argument, the argument defaults to myServer, which must match your server name or the command will fail. If you attempt to kill a server instance that was not started using Node Manager, the command displays an error. In the event of an error, the command returns a WLSTException. For more information on Nodemanager related WLST commands please refer to : http://download.oracle.com/docs/cd/E12840_01/wls/docs103/config_scripting/reference.html#wp1030876
.
TopMagicUsers.
Keep Posting
Thanks
Jay SenSharma
January 20th, 2012 on 2:48 pm
Another solution is to define the NodeManager as a Linux daemon to be automatically started at boot time:
http://oraclemiddleware.wordpress.com/2012/01/05/node-manager-as-linux-deamon/
Then use WLST to start the AdminServer or any other managed server via the NodeManager:
http://oraclemiddleware.wordpress.com/2012/01/15/weblogic-adminserver-startup-and-shutdown-scripts/
TopMagicUsers