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 :
- calling an external script that executes command line CLI shutdown command (ie "jboss-cli.sh --connect --controller=localhost:adminCliPort --command=:shutdown")
- issuing a CLI command via API, similarly to how the operations server is started and how port changes are made
- 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 Wolf-Dieter!!! ... that pointed me in the right direction for sure!!
I tried the following series of steps and it worked for me:
- server A , starts server B by executing : "./standalone.sh -Djboss.node.name=serverB"
- a socket-binding port is changed on Server A via CLI and we are told it requires a reload.
- undeploy the *.war from server A by executing the CLI command for "undeploy serverA.war"
- 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).
- 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.