At the end of this tutorial you will be able to:
Introduction and Roadmap
This document describes how you manage BEA WebLogic Server® startup, shutdown, and server life cycle. It also describes WebLogic features that you help prevent and recover from server failure.
Starting and Stopping Servers
WebLogic Server provides several ways to start and stop server instances. The method that you choose depends on whether you prefer using the Administration Console or a command-line interface, and on whether you are using Node Manager to manage the server’s life cycle.
No matter how you start a server, the result passes a set of configuration options to initialize a Java Virtual Machine (JVM). The server instance runs within the JVM, and the JVM can host only one server instance.
Starting Servers: Before You Begin:
Starting an Administration Server:
You can start an Administration Server with a default startup script or create your own. To start an Administration Server with the WebLogic Server-included startup script:
By default, this directory is BEA_HOME\user_projects\domains\DOMAIN_NAME, where DOMAIN_NAME is the root directory of the domain. (The name of this directory is the name of the domain.)
– bin/startWebLogic.cmd (Windows)
- bin\startWebLogic.sh (UNIX and Windows)
The startWebLogic script does the following:
When the server completes its startup process, it writes the following message to standard out (which, by default, is the command window):
<Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
2) Starting an Administration Server from the Windows Start Menu
When you create an Administration Server on a Windows computer, the Configuration Wizard creates a shortcut on the Start Menu for starting the server (User Projects→DOMAIN_NAME→Start Admin Server for WebLogic Domain).
3) Starting an Admin Server with the java weblogic.Server Command
The weblogic.Server class is the main class for a WebLogic Server instance. You start a server instance by directly invoking weblogic.Server in a Java command.
Run WL_HOME/server/bin/setWLSEnv.sh then run java weblogic.Server with the following Options if it is required
–Xms256m –Xmx512m
-Dweblogic.Name=%SERVER_NAME% -Dplatform.home=C:\bea\weblogic91
-Dweblogic.management.username=%WLS_USER%
-Dweblogic.management.password=%WLS_PW%
-Dweblogic.management.server=%ADMIN_URL%
-Dweblogic.ProductionModeEnabled=%STARTMODE%
-Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy
Note: Oracle recommends using java weblogic.Server primarily for initial development but not as a standard mechanism for starting production systems for the following reasons:
4) Starting an Administration Server Using WLST and Node Manager
Node Manager is a utility for remote control of WebLogic Server instances. Using Node Manager, you can control and monitor Managed Servers and also, start, stop, and restart Administration Servers.
You can access these Node Manager features using the WebLogic Scripting Tool commands and scripts. If you use the nmStart command with WLST connected to a Node Manager, Node Manager supports monitoring, stopping, and restarting the Administration Server.
5) Starting an Admin Server Using WLST without Node Manager
The WLST startServer command starts the Administration Server without using Node Manager. The server runs in a separate process from WLST; exiting WLST does not shut down the server. See Starting an Administration Server Without Node Manager in WebLogic Scripting Tool.
For example,
wls:offline/>startServer('AdminServer','mydomain','t3://localhost:7001','weblogic','weblogic','c:/bea/user_projects/domains/mydomain','true','60000','false')
Starting Managed Servers:
1) Starting Managed Servers with a Startup Script
If you use one of the Configuration Wizard templates that WebLogic Server provides, your domain directory includes a start script named startManagedWebLogic that you can use to start Managed Servers. You can use this script to start all the Managed Servers in a cluster.
DOMAIN_NAME\bin\startManagedWebLogic.cmd (Windows)
DOMAIN_NAME/bin/startManagedWebLogic.sh (UNIX)
– startManagedWebLogic.cmd managed_server_name admin_url (Windows)
– startManagedWebLogic.sh managed_server_name admin_url (UNIX)
Ex: startManagedWebLogic.cmd ms1 http://localhost:7001
The startManagedWebLogic script does the following:
WL_HOME\user_projects\domains\DOMAIN_NAME\bin\setDomainEnv.cmd
(setDomainEnv.sh on UNIX).
<Notice> <WebLogicServer> <000360> <Server started in RUNNING mode>
2) Starting Managed Servers from the Administration Console
3) Starting Managed Servers and Clusters with WLST and Node Manager
startServer([adminServerName], [domainName], [url], [username], [password],[domainDir], [block], [timeout], [serverLog], [systemProperties], [jvmArgs] [spaceAsJvmArgsDelimiter])
To start a Managed Server, enter the following command:
– To start a cluster, enter the following command:
start('clusterName', 'Cluster') where clusterName is the name of the cluster.
For example: start('mycluster', 'Cluster')
4) Starting Managed Servers with the java weblogic.Server Command
The weblogic.Server class is the main class for a WebLogic Server instance. You start a server instance by directly invoking weblogic.Server in a Java command.
Run WL_HOME/server/bin/setWLSEnv.sh then run java weblogic.Server with the following Options if it is required
–Xms256m –Xmx512m
-Dweblogic.Name=%SERVER_NAME% -Dplatform.home=C:\bea\weblogic91
-Dweblogic.management.username=%WLS_USER%
-Dweblogic.management.password=%WLS_PW%
-Dweblogic.management.server=%ADMIN_URL%
-Dweblogic.ProductionModeEnabled=%STARTMODE%
-Djava.security.policy=%WL_HOME%\server\lib\weblogic.policy
Shutting Down Instances of WebLogic Server
Shutting Down Servers with a Stop Script
For an Administration Server, invoke:
For Managed Servers, invoke:
Note: On the command line, specify parameters in the order shown. User credentials come before the ADMIN_URL with stopWebLogic.cmd and after the ADMIN_URL with stopManagedWebLogic.cmd.
Killing the JVM
Each WebLogic Server instance runs in its own JVM. If you are unable to shut down a server instance using the methods described in the previous sections, you can use an operating system command to kill the JVM.
Caution: If you kill the JVM, the server immediately stops all processing. Any session data is lost. If you kill the JVM for an Administration Server while the server is writing to the config.xml file, you can corrupt the config.xml file.
Some common ways to kill the JVM are as follows:
Configuring a Domain
Configuring Managed Servers
We can configure the Managed Server in three ways:
Configuring Machines
We can configure the Machines in three ways:
Creating a Boot Identity File
Running Multiple WLS Instances:
Multihoming
What Happens if the Administration Server Fails?
The failure of an Administration Server does not affect the operation of Managed Servers in the domain, but it does prevent you from changing the domain’s configuration. If an Administration Server fails because of hardware or software failure on its host machine, other server instances on the same machine may be similarly affected. However, the failure of an Administration Server itself does not interrupt the operation of Managed Servers in the domain.
If an Administration Server for a domain becomes unavailable while the server instances it manages—clustered or otherwise—are up and running, those Managed Servers continue to run. Periodically, the Managed Servers attempt to reconnect to the Administration Server. If the domain contains clustered server instances, the load balancing and failover capabilities supported by the domain configuration remain available, even if the Administration Server fails.
You can start a Managed Server even if the Administration Server is not running. In this case, the Managed Server uses a local copy of the domain’s configuration files for its starting configuration and then periodically attempts to connect with the Administration Server. When it does connect, it synchronizes its configuration state with that of the Administration Server.
Managed Server Independence…
By default, managed servers can function independently of the administration server.
Configure Managed Server Independence Mode from the Console
Server -> Configuration -> Tuning -> Advanced Option:
Administration Server Backup
WebLogic Server Exit Codes
When a server instance stops, it issues an exit code. The value of the exit code provides information about the conditions under which the server process ended. When a server instance under Node Manager Control exits, Node Manager uses the exit code to determine whether or not to restart the server instance. Other high-availability agents can use the server-exit code or scripts to determine what, if any action, to take after a server instance exits. Server exit codes are defined in the following table..
Exit Code Value - Less than 0
Meaning: A negative value indicates that the server instance failed during a state transition, and did not terminate in a stable condition. Example: If a Start in Standby command is issued for a server instance whose configuration is invalid, the server instance fails in the transitional STARTING state, and does not achieve the STANDBY state.
Restart Recommendation: Do not attempt to restart the server. Diagnose the problem that caused the server process to exit.
Exit Code Value - 0
Meaning: Indicates that the server process terminated normally, as a result of a shutdown command, either graceful or forced.
Restart Recommendation: None.
Exit Code Value: Greater than 0
Meaning: A positive value indicates that the server instance stopped itself after determining that one or more of its subsystems were unstable. Example: A server instance detects an out of memory condition or stuck threads, and shuts itself down.
Restart Recommendation: The server instance can be restarted.
Understanding Server Life Cycle
The series of states through which a WebLogic Server instance can transition is called the server life cycle. 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 operational state of a server instance.
Diagram of the Server Life Cycle
Figure 5-1 illustrates the server life cycle and the relationships between states and life cycle commands.
Getting and Using Server State
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:
Get server state as follows:
On the Summary of Servers page (Environment→Servers), the Servers table displays the current state of each server instance in the current domain.
The SERVER_NAME→Monitoring page displays the state of the currently running server instance, and the date and time it entered the state.
Diagnostics→Log Files, includes timestamped messages for state transitions that have occurred since the server instance was last started.
Understanding Server States in the Server Life Cycle
These sections describe each state in the WebLogic Server life cycle.
SHUTDOWN State
In the SHUTDOWN state, a WebLogic Server instance is configured but inactive.
A server instance enters the SHUTDOWN state as result of a Shutdown or Force Shutdown command. Also, a server instance can kill itself when it detects, as a result of self-health monitoring, that it has become unstable. Only a server instance with its Auto Kill If Failed attribute is true will kill itself when it detects that it is failed.
You can transition a server instance in the SHUTDOWN state to the STARTING state with the Start, Start in Admin, or Start in Standby commands.
STARTING State
During the STARTING state, a WebLogic Server instance transitions from SHUTDOWN to STANDBY, as a result of a Start, Start in Admin, or Start in Standby command.
In the STARTING state, a server instance cannot accept any client or administrative requests.
The server instance obtains its configuration data:
An Administration Server retrieves domain configuration data, including the domain security configuration, from its config directory.
A Managed Server contacts the Administration Server for its configuration and security data. If the Managed Server is configured for SSL communications, it uses its own certificate files, key files, and other SSL-related files and contacts the Administration Server for the remaining configuration and security data.
Note: If the Managed Server cannot contact its Administration Server, by default, it starts up in Managed Server Independence mode, using its locally cached copy of the domain config directory.
STANDBY State
A server instance in STANDBY does not process any request—its regular Listen Port is closed. The Administration Port is open, and accepts life cycle commands that transition the server instance to either the RUNNING or the SHUTDOWN state. Other Administration requests are not accepted.
Starting a server instance in standby is a method of keeping it available as a “hot” backup, a useful capability in high-availability environments.
The only life cycle command that causes a server instance to enter the STANDBY state and remain in that state is the Start in Standby command. A server instance transitions through the STANDBY state when you issue a Start or a Start in Admin command.
Summary:
In this Chapter we discussed:
Check out our Related Courses Weblogic Tutorials Introduction to Clustering Weblogic Oracle Apex Training In Bangalore Oracle Weblogic Server Installation
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.