bea.com | products | dev2dev | support | askBEA |
|
e-docs > WebLogic Server > Configuring and Managing WebLogic Server > Server Lifecycle |
Configuring and Managing WebLogic Server |
At any time, a WebLogic Server instance is in a particular operating state. Commands—such as start, stop, and suspend—cause specific changes to the state of a server instance. The following sections describe WebLogic Server states, the state transitions that can occur, and the relationship between commands that you issue and server state transitions.
The series of states through which a WebLogic Server instance can transition is called the server lifecycle. Figure 6-1 illustrates the server lifecycle and the relationships between WebLogic Server operating states.
Figure 6-1 The Server Lifecycle
To understand the each state, and the relationships among states, see WebLogic Server States.
WebLogic Server displays and stores information about the current state of a server instance, and state transitions that have occurred since the server instance started up. This information is useful to administrators who:
There are multiple methods of accessing the state of a server instance:
The following sections describe the key states that a server instance can have, the processing associated with the state, and how the state fits into a sequence of state transitions.
In the SHUTDOWN state, a server instance is configured but inactive. A server instance reaches the SHUTDOWN state as a result of a graceful shutdown or forced shutdown.
A graceful shutdown can be initiated when the server instance is in the RUNNING or the STANDBY state. The graceful shutdown process consists of the following state transitions:
RUNNING
For more information about the graceful shutdown process, see Graceful Shutdown.
A forced shutdown can be initiated from any server state. The forced shutdown process consists of the following state transitions:
any state
For more information about the forced shutdown process, see Forced Shutdown.
For information about issuing stop commands, see "Starting and Stopping Servers" in Administration Console Online Help.
In the STARTING state, a server instance prepares itself to accept requests and perform application processing. A server instance cannot accept requests while in the STARTING state.
When a server instance starts itself, it retrieves its configuration data, starts its kernel-level services, initializes subsystem-level services, deploys applications, and loads and runs startup classes. For more information about the startup process, see Start.
A server instance can enter the STARTING state only from the SHUTDOWN state, as a result of either a Start command or a Start in Standby command.
For information about issuing start commands, see "Starting and Stopping Servers" in Administration Console Online Help.
In the STANDBY state, a server has initialized all of its services and applications, can accept administration commands, and can participate in cluster communication. However, it does not accept requests from external clients.
The server instance can enter the STANDBY if:
You can start a server instance in standby mode using the Start this server in standby mode command on the Server
SHUTDOWN
A server instance transitions through the STANDBY state during any shutdown process
During the graceful shutdown process, a server instance goes through the following state transitions:
RUNNING
During the forceful shutdown process, a server instance goes through the following state transitions:
any state
A server instance enters the RESUMING state as a result of the Resume this server... command. A server instance that is resumed from the STANDBY goes through the following state transitions:
When a server instance is in the RUNNING state, it offers its services to clients and can operate as a full member of a cluster. A server instance can enter the STANDBY if:
SHUTDOWN
STANDBY
A server instance enters this state during the graceful shutdown process. While in the SUSPENDING state, the server handles in-flight work. The processing a server instance perform for in-flight work while in the SUSPENDING state is described in In-Flight Work Processing. Upon completion of in-flight work, the server progresses from the SUSPENDING state to the SHUTTING_DOWN state.
During the graceful shutdown process, a server instance goes through the following state transitions:
RUNNING
A server instance enters the shutdown state as a result of a graceful shutdown or forced shutdown process.
During the graceful shutdown process, a server instance goes through the following state transitions:
RUNNING
For more information about the graceful shutdown process, see Graceful Shutdown.
During the forced shutdown process, a server instance goes through the following state transitions:
For more information about the forced shutdown process, see Forced Shutdown.
A server instance enters the FAILED state when one or more critical services become dysfunctional. When a server instance finds one or more critical subsystems have failed, the server instance sets its state to FAILED to indicate that the it cannot reliably host an application.
To recover from the FAILED state, a server instance must be shutdown and restarted, either manually, or automatically with Node Manager, if it is configured on the host machine. For information about automatic restarts, see Shutdown Failed Managed Servers.
A server instance can only enter the FAILED state from the RUNNING state:
If a server instance cannot be contacted, it is considered to be in the UNKNOWN state.
States Defined by Node Manager
When Node Manager restarts a failed or killed Managed Server, it defines additional server states, which are described in Node Manager and Managed Server States. These states are displayed in the Administration Console, and provide visibility into the status of the restart process.
For information about Node Manager, see Overview of Node Manager.
This section describes key commands that affect the state of a server instance, and the processing a server instance performs as a result of the command. For information about issuing lifecycle commands, see "Starting and Stopping Servers" in Administration Console Online Help.
When a server instance starts, it:
An Administration Server retrieves domain configuration data, including security configuration data, from the config.xml for the domain.
A Managed Server contacts the Administration Server for its configuration and security data. If you set up SSL, a Managed Server uses its own set of certificate files, key files, and other SSL-related files and contacts the Administration Server for the remaining configuration and security data.
A graceful shutdown gives WebLogic Server subsystems time to complete certain application processing currently in progress. The work completed is referred to as in-flight work. During a graceful shutdown, subsystems complete in-flight work and suspend themselves in an specific sequence and in a synchronized fashion, so that back-end subsystems like JDBC connection pools are available when front-end subsystems are suspending themselves.
The following list shows the order in which subsystems suspend themselves. Each subsystem completes its in-flight work before the next one commences its preparation to suspend.
ServerMBean has two new attributes for controlling the length of the graceful shutdown process. Their values are displayed and configurable on the Server
Note: Graceful Shutdown Timeout is a different attribute from ServerLifeCycleTimeoutVal, which applies only to a force shutdown.
The following sections describe how each subsystem handles work in process when it suspends itself during a graceful shutdown.
The RMI subsystem suspends in three steps. Each step in this process completes before the following step commences.
After these steps are completed, no remote client requests are allowed. Requests with administrative privileges and internal system calls are accepted.
When a clustered server instance is instructed to prepare to suspend, the RMI system refuses any in-memory replication calls, to allow other cluster members to choose new secondaries.
After the Web Container subsystem is instructed to prepare to suspend, it rejects new sessions requests. Existing sessions are handled according to the persistence method:
The completion of pending sessions is optional. To immediate drop all sessions, use the Ignore Sessions During Shutdown option on the Servers
The Timer Service cancels all triggers running on application execute queues. Application execute queues include the default queue and queues configured through the ExecuteQueueMBean.
The Application Service completes pending work in the application queues before suspending. Application execute queues include the default queue and queues configured through the ExecuteQueueMBean.
The EJB Container suspends MDBs.
The JMS Service marks itself as suspending and waits for its reference count of pending requests to drop to zero.
The JDBC Service closes idle connections in the connection pools.
The Transaction Service waits for the pending transaction count in the Transaction Manager to drop to zero before suspending. Completing all pending transactions can be a lengthy process, depending on the configuredbtransaction timeout.
If a graceful shutdown takes too long because of pending transactions, you can halt it with a forced shutdown command. A forced shutdown suspends all pending work in all subsystems.
A forced shutdown is immediate—WebLogic Server subsystems suspend all application processing currently in progress. A forced shutdown can be performed on a server instance in any state.
ServerMBean defines the ServerLifecycleTimeoutVal attribute, which specifies a timeout period for subsystems to suspend themselves. If a subsystem fails to suspend itself within the timeout period, the server instance is killed.