This content has been marked as final. Show 10 replies
If you are trying to stop managed sever try from console. Since managed server is configured to nodemanger.
yes, that works as I've already mentioned in my initial post. However, that's not my problem. I want to get the nmKill command working (e.g. to use it in custom scripts).
If you want to make a script to start/stop managed server, you can try this, I've used this many time for many bank in Vietnam.
To start managed server
To stop managed server
Using these command we don't need Node Manager.
The problem I have with the start/stopManagedWebLogic scripts is that they require an AdminServer to be up and running (well, at least stopManagedWebLogic does). Another thing is that they result in an open command prompt window (at least in windows environments), that mustn't be closed as it contains the java-process..
I want to be as independant as possible from the AdminServer cause it may be shut down, which unfotunately istn't possible with these scripts.
NodeManager offers solutions for my requirements so I consider it obvious to use ist. It just isn't working. Maybe it's just a configuration problem, but I don't know how to figure that out.
To come back to my initial question: Why is the nmKill command not working for my managed server?
can you try :
No, that doesn't work either, the argument "serverType" is not supported. nmKill has just one argument, serverName.
The command I use is nmKill('WLS_FORMS1') or nmKill(serverName='WLS_FORMS1')
Killing server WLS_FORMS1 ...
From that point on nothing happens any further.
Problems with nmKill can arise when there are not enough file descriptor resources available.1 person found this helpful
You can check your environment, by using for example netstat -anp|grep PID_FORMS to see if there any in a WAIT state (or netstat –a | grep TIME_WAIT | wc –l).
You could try increasing the max file descriptors, an example is discussed here: http://middlewaremagic.com/weblogic/?p=7083 (look in the 'system' section).
An alternative could be to use: shutdown('Server1','Server','true',1000,'true'); - But for this your admin server must be running.
Examples that use the shutdown option can be found here: http://middlewaremagic.com/weblogic/?p=7265 (look in the 'start and stop script' section)
Thanks for the suggestions, WLS runs on a windows system, so I can't apply them without changes. I used netstat -a | findstr WAIT but don't know what to do with the output information. There isn't any change before or after invoking nmKill, anyway.
I found out that the alternative with the shutdown command is working even without admin server if I connect directly to the managed server:
As far as I know no nodemanager is involved here. What I don't like about this solution is that the password has to be hard coded in the script. Is there a way to avoid that drawback?
I have seen the IBM AIX Unix OS 'kill -9" command fail to kill a managed server process. It tends to happen when an application running on the managed server is connecting to another object outside of WebLogic. It looks like the outside process doesn't handle the kill well and a child process is spawned. Maybe the samething is happening with the nmKill() command?
Also, you can try encrypting your user name and password. You would still need to hard code the values but it won't be clear text.
Here is one of our connect string examples:
To encrypt I used the storeUserConfig() bean in WLST.
We used another option in WLST to connect to the admin server. We created a new method in the 'WL_HOME/common/wlst/sample.py' script. The steps are defined as follows:
This sample script demonstrates how to define a new WLST command.
print 'Sample wlst home command'
Within this script, the wlstHomeSample() command is defined, which prints a String, as follows:
Sample wlst home command
We made a method called
Now in our scripts we need only call 'ConnectToAdmin()'.
Edited by: cwells3rd on Jan 6, 2012 3:05 PM
I found answer on Oracle Support :
nmKill(<managed server>) is not working fine.
It passes process id as null to the Nodemanager as shown below:
<Nodemanager> <waiting to process to die :null>
Set the property "NativeVersionEnabled=true" in the nodemanager.properties file and restart the Nodemanager.