2 Replies Latest reply on Aug 21, 2012 2:30 PM by valentino cruz

    how to shutdown 1 of 2 standalone JB7 instances ?aa

    valentino cruz Newbie

      I have 2 standalone instances one is the admin-server deployed with a *.war, the other is the operations-server deployed with a *.ear.   The admin-server webapp provides a page for shutting down and starting the operations-server.   I'm also allowing the user to reset which port the admin-server runs on and I do this through the CLI API to change the port and then issue a re-start to the admin-server.    My current problem is that when the admin-server shutsdown, it takes down with it the currently running operations-server.


      I have tried various ways of shutting down the admin-server :

      1. calling an external script that executes command line CLI shutdown command (ie "jboss-cli.sh --connect --controller=localhost:adminCliPort --command=:shutdown")
      2. issuing a CLI command via API, similarly to how the operations server is started and how port changes are made
      3. stopping the servicer that automatically restarts the admin-server (I use /Library/LaunchDaemons/ file to create a service and on shutdown i issue a stop option for this service).


      NOTE: The shutdown of the admin-server is not a problem, I can get it to shutdown immediately and restarts fine.   Also the operations-server shutsdown fairly well on its own (ie. when the "shutdown" button on the webapp is pressed).  So just to clarify, the problem is that I can't shutdown only the admin-server , it always brings down both servers eventhough i'm using a CLI command pointing to the admin-server.


      The 2 servers are running next to each other, meaning I made a copy of the jboss7/ distribution and named it admin-server/ therefore each server has its own bin/ and standalone/.  

      Is this a known issue where the server that starts the 2nd server will always take down the 2nd server ?
      Any help will be very much appreciated, I've been trying to get these 2 playing nice for a few days now.


      Thank you


        • 1. Re: how to shutdown 1 of 2 standalone JB7 instances ?aa
          Wolf-Dieter Fink Master

          As there is no dependency between the servers (if you use standalone mode) I suppose that your web application will force the shutdown if you stop the admin server.

          What if you undeploy the *war?

          Are you able to log and see the shutdown request in your app?

          • 2. Re: how to shutdown 1 of 2 standalone JB7 instances ?aa
            valentino cruz Newbie

            Thank you Wolf-Dieter!!!  ... that pointed me in the right direction for sure!!

            I tried the following series of steps and it worked for me:

            1. server A , starts server B by executing : "./standalone.sh -Djboss.node.name=serverB"
            2. a socket-binding port is changed on Server A via CLI and we are told it requires a reload.
            3. undeploy the *.war from server A by executing the CLI command for "undeploy serverA.war"
            4. execute a ":reload" command (this tends to take a little longer than a shutdown and restart in my environment, but its not that much of a concern).
            5. go back to serverB and it remains running with the same process ID, so no interruptions!  (perfect!)


            Thanks again Wolf!!  I was thinking there was no way of doing this, but CLI in JBoss AS7 is very powerful indeed.

            I hope this helps others as well.