Page authors

  • BHAVANI SHEKHAR
    May 21, 2012
  • Pavan BhavaniShekhar Devarakonda
    December 6, 2010
  • Sarangapani Matoori
    January 22, 2009

Home‎ > ‎WLSTLinks‎ > ‎

Life Cycle Commands in WLST

wls:/offline> help('lifecycle')

Manage domain or server lifecycle.
    help('migrate')             Migrate JTA, JMS or Server services.
    help('resume')              Resume a server instance.
    help('shutdown')            Gracefully shut down a server or a cluster.
    help('start')               Start a Managed Server or a cluster.
    help('startServer')         Start the Administration Server.
    help('suspend')             Suspend a running server.


wls:/offline> help('migrate')

Description:


Migrates the specified services (JTA, JMS, or Server) to a targeted server within a cluster. In the event of an error, the command returns a WLSTException.

Syntax:

migrate(sname, destinationName, [sourceDown], [destinationDown], [migrationType])
- sname = Name of the server from which the services should be migrated.
 - destinationName = Name of the machine or server to which you want to migrate  the services.
 - sourceDown = Optional. Boolean value specifying whether the source  server is down. This argument defaults to true, indicating that the
 source server is not running.
 
 When migrating JTA services, the sourceDown argument is ignored, if  specified, and defaults to true. The source server must be down in  order for the migration of JTA services to succeed.
 
- destinationDown = Optional. Boolean value specifying whether the  destination server is down. This argument defaults to false, indicating that the destination server is running.
 
 If the destination is not running, and you do not set this argument to true, WLST returns a MigrationException.
 
 When migrating a JMS service to a non-running server instance, the  server instance will activate the JMS service upon the next startup.
 When migrating the JTA Transaction Recovery Service to a non-running server instance, the target server instance will assume recovery services when it is started.
 
- migrationType = Optional. Type of service(s) that you want to migrate.
 Valid values include:
 o jta = Migrate JTA services only.
 o server = Migrate Server services only.
 o all = Migrate all JMS and JTA services.
 This argument defaults to all.

Example:

wls:/mydomain/edit !> migrate('server1','server2', 'true', 'false', 'all')

Migrating JMS and JTA services from 'server1' to destination 'server2' ...
wls:/mydomain/edit !>
wls:/mydomain/edit !> migrate('server1','machine1', 'true', 'false', 'server')
Migrating singleton server services from 'server1' to machine 'machine1' ...
wls:/mydomain/edit !>


wls:/offline>  help('resume')

Description:

Resumes a server instance that is suspended or in ADMIN state. This command moves a server to the RUNNING state. For more information
about server states, see "Understanding Server Life Cycle" in "Managing Server Startup and Shutdown" at
 
In the event of an error, the command returns a WLSTException.

Syntax:

resume([sname], [block])
- sname = Name of the server to resume. This argument defaults to  the server to which WLST is currently connected.
 
- block = Optional. Boolean value specifying whether WLST should block  user interaction until the server is resumed. This argument defaults to
 false, indicating that user interaction is not blocked. In this case,  WLST returns control to the user after issuing the command and assigns  the task MBean associated with the current task to a variable that you  can use to check its status. If you are importing WLST as a Jython  module, block is always set to true. 

Example:

wls:/mydomain/serverConfig> resume('managed1', block='true')
Server 'managed1' resumed successfully.
wls:/mydomain/serverConfig>


wls:/offline> help('shutdown')

Description:


Gracefully shuts down a running server instance or a cluster. This command waits for all the in-process work to be completed before shutting down the server or cluster.
 
You shut down a server to which WLST is connected by entering the shutdown command without any arguments.
 
When connected to a Managed Server instance, you only use the shutdown command to shut down the Managed Server instance to which WLST is
connected; you cannot shut down another server while connected to a Managed Server instance.
 
WLST uses Node Manager to shut down a Managed Server. When shutting down a Managed Server, Node Manager must be running.
 
In the event of an error, the command returns a WLSTException.

Syntax:

shutdown([name], [entityType], [ignoreSessions], [timeOut], [force], [block])
- name = Optional. Name of the server or cluster to shutdown. This argument defaults to the server to which WLST is currently connected.
 
- entityType = Optional. Type, Server or Cluster. This argument defaults  to Server. When shutting down a cluster, you must set this argument  explicitly to Cluster, or the command will fail.
 
- ignoreSessions = Optional. Boolean value specifying whether WLST  should drop all HTTP sessions immediately or wait for HTTP sessions  to complete or timeout while shutting down. This argument defaults  to false, indicating that all HTTP sessions must complete or timeout.
 
- timeOut = Optional. Time (in milliseconds) that WLST waits for  subsystems to complete in-process work and suspend themselves before  shutting down the server. This argument defaults to 0 seconds,  indicating that there is no timeout.
 
- force = Optional. Boolean value specifying whether WLST should  terminate a server instance or a cluster without waiting for the  active sessions to complete. This argument defaults to false,  indicating that all active sessions must complete before shutdown.
 
- block = Optional. Boolean value specifying whether WLST should block  user interaction until the server is shutdown. This argument defaults  to false, indicating that user interaction is not blocked. In this case,  WLST returns control to the user after issuing the command and assigns  the task MBean associated with the current task to a variable that you  can use to check its status. If you are importing WLST as a Jython  module, block is always set to true. 

Example:

wls:/mydomain/serverConfig> shutdown('myserver','Server','false',1000, block='false')

wls:/mydomain/serverConfig> shutdown('m1','Server','true',1200)
Shutting down a managed server that you are connected to ...
Disconnected from weblogic server: m1
wls:/(Not Connected)>
The scripting shell lost connection to the server that you were connected to, this may be because the server was shutdown or partitioned. You will have to re-connect to the server once the
server is available. 

wls:/offline> help('start')

Description:

Starts a Managed Server instance or a cluster using Node Manager. WLST must be connected to the Administration Server and Node Manager. For more information about WLST commands used to connect to and use Node Manager, see help('nodemanager').
 
In the event of an error, the command returns a WLSTException.

Syntax:

start(name, [type], [url], [block])
- name = Name of the Managed Server or cluster to start.
 
- type = Optional. Type, Server or Cluster. This argument defaults  to Server. When starting a cluster, you must set this argument  explicitly to Cluster, or the command will fail.
 
- url = Optional. Listen address and listen port of the server  instance, specified using the following format:  [protocol://]listen-address:listen-port. If not specified, this
 argument defaults to t3://localhost:7001.
 
- block = Optional. Boolean value specifying whether WLST should  block user interaction until the server or cluster is started.  This argument defaults to false, indicating that user interaction
 is not blocked. In this case, WLST returns control to the user after  issuing the command and assigns the task MBean associated with the  current task to a variable that you can use to check its status.
 If you are importing WLST as a Jython module, block is always set  to true.

Example:

wls:/mydomain/serverConfig> start('myserver', 'Server', block='false')
Starting server 'myserver' ...
The server 'myserver' started successfully.
wls:/mydomain/serverConfig>

wls:/mydomain/serverConfig> start('mycluster', 'Cluster')
Starting the following servers in Cluster, mycluster: MS1, MS2, MS3...
......................................................................
All servers in the cluster mycluster are started successfully.
wls:/mydomain/serverConfig>


wls:/offline> help('startServer')

Description:


Starts the Administration Server. In the event of an error, the command returns a WLSTException.

Syntax:

startServer([adminServerName], [domainName], [url], [username], [password], [domainDir], [block], [timeout], [serverLog], [systemProperties],

[jvmArgs])
- adminServerName = Optional. Name of the Administration Server to  start. This argument defaults to myserver.
- domainName = Optional. Name of the domain to which the Administration  Server belongs. This argument defaults to mydomain.
- url = Optional. URL of the Administration Server. This argument  defaults to t3://localhost:7001.
- username = Optional. Username use to connect WLST to the server.  This argument defaults to weblogic.
- password = Optional. Password used to connect WLST to the server.  This argument defaults to weblogic.
- domainDir = Optional. Domain directory in which the Administration  Server is being started. This argument defaults to the current  directory in which WLST is running.
 
- block = Optional. Boolean value specifying whether WLST blocks user  interaction until the server is started. This argument defaults to  true, indicating that user interaction is blocked. In the block="false" case,  WLST returns control to the user after issuing the command and assigns  the task MBean associated with the current task to a variable that you  can use to check its status. If you are importing WLST as a Jython  module, block is always set to true. For more in
 
- timeout = Optional. Time (in milliseconds) that WLST waits for the  server to start before canceling the operation. The default value is  60000 milliseconds. This argument is only applicable when block is set  to true.
 
- serverLog = Optional. Location of the server log file. This argument  defaults to stdout.
 
- systemProperties = Optional. System properties to pass to the server  process. System properties should be specified as comma-seperated
 name-value pairs, and the name-value pairs should be separated by  equals sign (=).
 
- jvmArgs = Optional. JVM arguments to pass to the server process.  Multiple arguments can be specified, separated by commas.

Example:

wls:/offline> startServer('demoServer','demoDomain',
        't3://localhost:8001','myweblogic','wlstdomain','c://mydomains/wlst',
        'false', 60000,jvmArgs='-XX:MaxPermSize=75m, -Xmx512m, -XX:+UseParallelGC')

wls:/offline> help('suspend')

Description:

Suspends a running server. This command moves a server from the RUNNING state to the ADMIN state. For more information about server
states, see "Understanding Server Life Cycle" in "Managing Server Startup and Shutdown" at
http://e-docs.bea.com/wls/docs92/server_start/server_life.html.
In the event of an error, the command returns a WLSTException.

Syntax:

suspend([sname], [ignoreSessions], [timeOut], [force], [block])
- sname = Optional. Name of the server to suspend. The argument defaults to the server to which WLST is currently connected.
 
- ignoreSessions = Optional. Boolean value specifying whether WLST should drop all HTTP sessions immediately or wait for HTTP sessions
 to complete or time out while suspending. This argument defaults to  false, indicating that HTTP sessions must complete or time out.
 
- timeOut = Optional. Time (in seconds) the WLST waits for the server  to complete in-process work before suspending the server. This argument  defaults to 0 seconds, indicating that there is no timeout.
 
- force = Optional. Boolean value specifying whether WLST should suspend the server without waiting for active sessions to complete.
 This argument defaults to false, indicating that all active sessions must complete before suspending the server.
 
- block = Optional. Boolean value specifying whether WLST blocks user interaction until the server is started. This argument defaults to
 false, indicating that user interaction is not blocked. In this case, WLST returns control to the user after issuing the command and assigns
 the task MBean associated with the current task to a variable that you can use to check its status. If you are importing WLST as a Jython module, block is always set to true. 

Example:

wls:/mydomain/serverConfig> suspend('managed1')
Server 'managed1' suspended successfully.
wls:/mydomain/serverConfig>

Comments