2 Replies Latest reply: Dec 10, 2013 5:38 PM by 1057869 RSS

    How to start managed servers in parallel?

    1057869

      Hello everyone,

       

      I am developing a wlst script that would start all managed servers on a particular machine (machine_name should be provided) from the admin server side. The script works fine. However, since there were some domains that have 25+ managed servers for a single machine, it takes some time to start all of them in sequence. Is there a way to trigger a start command for each of the managed servers that I need to start just like what the node manager does when i start them through admin console? Something like triggering parallel processes running on background. Here is my code snippet:

       

                      #It focuses only on all managed servers defined within the listen address provided

                      if (server_listenaddress == managed_server) and (server_name != admin_name):

                              if (execute_command == "start"):

                                      print 'About to start',server_name,'on',server_listenaddress,'...'

                                      print

                                      try:

                                              start(server_name)

                                              print

                                              state(server_name,'Server')

                                              print

                                              nmDisconnect()

                                      except WLSTException:

                                              print 'Server instance',server_name,'could not be started. Skipping this server..'

                                              print

                                              state(server_name,'Server')

                              else:

                                      print 'About to stop',server_name,'on',server_listenaddress,'...'

                                      print

                                      try:

                                              shutdown(server_name,force='true')

                                              print

                                              state(server_name,'Server')

                                              print

                                      except WLSTException:

                                              print 'Server instance',server_name,'could not be stopped. Skipping this server..'

                                              print

                                              state(server_name,'Server')

                      elif (server_name == admin_name):

                              #It skips to restart the admin server since this script it only to restart managed servers.

                              print 'Server',server_name,'is the admin server. Skipping...'

                              print

                      else:

                              print 'Managed server',server_name,'is not configured with',managed_server,'listen address. Skipping this server..'

       

      Thanks in advance for all your help!!

       

      regards,

       

      Rustan