This discussion is archived
10 Replies Latest reply: Mar 5, 2013 2:38 AM by ThomasLassauniere RSS

Unable to stop ManagedServer WLS_FORMS1 with nmKill Command

846644 Newbie
Currently Being Moderated
Hello,

I'm a WebLogic Newbie and have the following problem with stopping a Managed server with NodeManager.

When I try to stop the managed server WLS_FORMS1 (or WLS_REPORTS1) with NodeManager using the command nmKill() I don't get any response apart from the message "Killing server WLS_FORMS1 ...". From that point on nothing happens any further. The command execution seems to be stuck.

The only message displayed in the log file WLS_FORMS1.out following the nmKill command is
<FINEST> <NodeManager> <Waiting for the process to die: null>

The Server WLS_FORMS1 is part of the cluster CLUSTER_FORMS but resides on another machine than the AdminServer. Using nmStart works fine for this managed server. Only nmKill doesn't seem to work. If I use nmKill to stop managed servers that reside on the same machine as the AdminServer like WLS_FORMS this works fine too. Also starting and stopping the server WLS_FORMS1 through the WebLogic Console works without any problems, so the NodeManager is apparently working.

I'm using WebLogicServer 10.3.5 with Oracle Froms and Reports 11g Release 2 on Windows Server 2008 R2 64bit.

Any help would be much appreciated.
  • 1. Re: Unable to stop ManagedServer WLS_FORMS1 with nmKill Command
    890402 Newbie
    Currently Being Moderated
    Hi,

    If you are trying to stop managed sever try from console. Since managed server is configured to nodemanger.


    Thanks
    Akash
  • 2. Re: Unable to stop ManagedServer WLS_FORMS1 with nmKill Command
    846644 Newbie
    Currently Being Moderated
    Hi Akash,

    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).

    Regards,
    Charlie
  • 3. Re: Unable to stop ManagedServer WLS_FORMS1 with nmKill Command
    903804 Newbie
    Currently Being Moderated
    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
    $DOMAIN_HOME/bin/startManagedWebLogic.sh WLS_REPORTS1
    $DOMAIN_HOME/bin/startManagedWebLogic.sh WLS_FORM1

    To stop managed server
    $DOMAIN_HOME/bin/stopManagedWebLogic.sh WLS_REPORTS1
    $DOMAIN_HOME/bin/stopManagedWebLogic.sh WLS_FORM1

    Using these command we don't need Node Manager.
  • 4. Re: Unable to stop ManagedServer WLS_FORMS1 with nmKill Command
    846644 Newbie
    Currently Being Moderated
    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?

    Regards,
    Charlie
  • 5. Re: Unable to stop ManagedServer WLS_FORMS1 with nmKill Command
    sandeep Newbie
    Currently Being Moderated
    can you try :
    nmKill(serverName=Managed_server1, serverType='Weblogic')

    thanks,
    sandeep
  • 6. Re: Unable to stop ManagedServer WLS_FORMS1 with nmKill Command
    846644 Newbie
    Currently Being Moderated
    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')

    For example:
    wls:/nm/ClassicDomain> nmKill(serverName='WLS_FORMS1')
    Killing server WLS_FORMS1 ...

    From that point on nothing happens any further.
  • 7. Re: Unable to stop ManagedServer WLS_FORMS1 with nmKill Command
    RenévanWijk Oracle ACE
    Currently Being Moderated
    Problems with nmKill can arise when there are not enough file descriptor resources available.

    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)
  • 8. Re: Unable to stop ManagedServer WLS_FORMS1 with nmKill Command
    846644 Newbie
    Currently Being Moderated
    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:

    connect('weblogic','weblogic_password','t3://managed-server-host:managed-server-port')
    ...
    shutdown()

    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?
  • 9. Re: Unable to stop ManagedServer WLS_FORMS1 with nmKill Command
    cwells3rd Newbie
    Currently Being Moderated
    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:
    connect(userConfigFile='/home/beaadmin/security/qa920Config',userKeyFile='/home/beaadmin/security/qa920Key', url='t3://165.79.164.14:20401')

    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.

    def wlstHomeSample():
    print 'Sample wlst home command'

    Within this script, the wlstHomeSample() command is defined, which prints a String, as follows:

    wls:/(offline)> wlstHomeSample()
    Sample wlst home command

    Reference: http://docs.oracle.com/cd/E15523_01/web.1111/e13715/using_wlst.htm#BHAEGBCI

    We made a method called

    def ConnectToAdmin():
    connect(userConfigFile='/home/beaadmin/security/qa920Config',userKeyFile='/home/beaadmin/security/qa920Key', url='t3://165.79.164.14:20401')

    Now in our scripts we need only call 'ConnectToAdmin()'.

    Edited by: cwells3rd on Jan 6, 2012 3:05 PM
  • 10. Re: Unable to stop ManagedServer WLS_FORMS1 with nmKill Command
    ThomasLassauniere Newbie
    Currently Being Moderated
    I found answer on Oracle Support :

    Symptoms :
    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>

    Solution :

    Set the property "NativeVersionEnabled=true" in the nodemanager.properties file and restart the Nodemanager.

    Best regards,

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points