-1

I am looking for a shellscript to stop and start all nodes in the WebSphere cluster.

We have a deploy script for deploying on WAS servers , now we want to edit this script to stop the WAS servers before the deployment and starts after the deployment . we dont have scope to edit the existing script (which is only readable to me) , they asked to create start/stop scripts separate so that they can invoke this before and after deployment.

Will the below commands suffice to incorporate with the main deploy script.

start: $WAS_HOME/bin/startServer stop: $WAS_HOME/bin/stopServer

Any help would be appreciated.

P.S - Let me know if you need the original deploy script

Thanks

Madhu
  • 61
  • 2
  • 10
  • StackOverflow is about helping people fix their existing programming code. Edit your Q to show your best attempt at coding a solution to your problem. Sorry, but requests for tutorials, research, tools, recommendations, libraries, and code are off-topic. ***Please*** read https://stackoverflow.com/help/on-topic , https://stackoverflow.com/help/how-to-ask , https://stackoverflow.com/help/dont-ask , https://stackoverflow.com/help/mcve and take the [tour](https://stackoverflow.com/tour) before posting more Qs here. Good luck – shellter Jan 19 '18 at 20:28

2 Answers2

0

The best option would be to use wsadmin command line interface. Which can be invoked using a shell.

M I P
  • 867
  • 10
  • 25
0

If you need to use a shell script to do this, typically you would invoke the WebSphere wsadmin command from the shell and use the -f option to specify a Jython or Jacl script that performs the desired actions. In that script you'll use the AdminControl object to stop and start clusters. See this IBM KnowledgeCenter topic for details. More general information about controlling clusters, nodes, servers with scripting can be found in this KC topic .

F Rowe
  • 2,042
  • 1
  • 11
  • 12
  • We hv a deploy script for deploying on WAS servers , now we want to edit this script to stop the WAS servers before the deployment and starts after . we dnt have scope to edit the existing script (which is readable) , they askd to create start/stop scripts separate to call this before and after deploy. Will the below commands suffice to incorporate with the main deploy script. start: $WAS_HOME/bin/startServer stop: $WAS_HOME/bin/stopServer – Madhu Jan 22 '18 at 18:52
  • Hmm, your comment seems to be mixing xml of some sort and shell command examples. Although you could ssh into each server machine and issue the stop and start commands, that will only work if you have only a single server defined on each HOSTNAME and each server is named and none of the servers have admin security enabled and none of the servers fail to stop for some reason.. If your deploy script runs on the Deployment Manager, it is much simpler to use the AdminClusterManagement.stopAllClusters()/startAllClusters() commands. – F Rowe Jan 23 '18 at 13:28