bea.com | products | dev2dev | support | askBEA |
|
e-docs > WebLogic Server > Administration Console Online Help > Starting and Stopping Servers |
Administration Console Online Help |
WebLogic Server provides several ways to start and stop server instances. The method that you choose depends on whether you prefer using a graphical or command-line interface, and on whether you are using the Node Manager to manage a server's lifecycle.
No matter which way you choose to start a server, the end result passes a set of configuration options to initialize a Java Virtual Machine (JVM). The server instance runs as a process within the JVM, and the JVM can host only one server process.
The following sections provide a comprehensive description of starting and stopping server instances:
For a quick overview of starting and stopping servers, refer to "Starting and Stopping WebLogic Server Instances: Quick Reference."
Version Requirements for Starting Servers
The Administration Server and all Managed Servers in a domain must be the same WebLogic Server version. The Administration Server must be either at the same service-pack level or at a later service-pack level than the Managed Servers. For example, if the Managed Servers are at release 8.1, then the Administration Server can be either release 8.1 or 8.1 SP1. However, if the Managed Servers are at SP1, then the Administration Server must be at SP1.
Starting Administration Servers
An Administration Server is a WebLogic Server instance that maintains configuration data for a domain. In a development environment, it is usually sufficient to start an Administration Server and deploy your applications directly onto the Administration Server. In a production environment, you create Managed Servers to run applications. For more information about Administration Servers and Managed Servers, refer to "Overview of WebLogic Server Domains."
To start an Administration Server, do the following:
where domain_directory is the directory that you specified as the base domain directory.
Figure 4-1 Specifying the Base Domain Directory
To set environment variables, the script invokes WL_HOME\common\bin\commEnv.cmd (commEnv.sh on UNIX), where WL_HOME is the location in which you installed WebLogic Server.
After setting environment variables, the start script invokes the java weblogic.Server command, which starts a JVM and, within the JVM, a WebLogic Server instance.
When the server successfully completes its startup process, it writes the following message to standard out:
<Notice> <WebLogicServer> <000360> <Server started in RUNNING mode>
Alternate Ways to Start Administration Servers
The following sections describe alternate ways to start an Administration Server:
You cannot use the Node Manager to start an Administration Server.
Starting an Administration Server from the Windows Start Menu
When you create an Administration Server on a Windows computer, the Domain Configuration Wizard prompts you to install the server in the Windows Start Menu. If you choose yes, then you can do the following to start the server instance:
From the Windows desktop, click Start
The Start Server command opens a command window and calls the startup script that is described in Starting Administration Servers. When the server has successfully completed its startup process, it writes the following message to standard out:
<Notice> <WebLogicServer> <000360> <Server started in RUNNING mode>
Starting an Administration Server When the Host Computer Boots
If you want an Administration Server to start automatically when you boot a computer, you can set up the server as a UNIX daemon or a Windows service. For information on starting a server as a Windows service, refer to "Setting Up a WebLogic Server Instance as a Windows Service."
Starting an Administration Server in the STANDBY State
You can start an Administration Server so that at the end of its startup cycle, the sever is in the STANDBY state. In this state, the server listens for requests only on the domain-wide administration port.
To configure an Administration Server so that it starts in the STANDBY state, do the following:
When you are ready for this server to receive non-administrative requests, refer to Resuming a Server.
Starting an Administration Server With the java weblogic.Server Command
The weblogic.Server class is the main class for a WebLogic Server instance. You can start a server instance by directly invoking weblogic.Server in a Java command or by creating your own scripts that invoke the weblogic.Server class. (The scripts that WebLogic Server creates invoke weblogic.Server in a Java command.)
For information about invoking weblogic.Server in a Java command, refer to "weblogic.Server Command Line Reference."
Starting Managed Servers from the Administration Console
A Managed Server is a WebLogic Server instance that runs deployed applications. It refers to the Administration Server for all of its configuration and deployment information. Usually, you use Managed Servers to run applications in a production environment. For more information about Managed Servers and Administration Servers, refer to "Overview of WebLogic Server Domains."
To use the Administration Console to start a Managed Server, do the following:
The Node Manager is a standalone Java program provided with each WebLogic Server installation. In addition to starting and stopping Managed Servers, you can use the Node Manager to monitor and automatically restart Managed Servers based on server health. You cannot use the Node Manger to start Administration Servers. For more information on the Node Manger, refer to "Overview of Node Manager."
The Administration Console displays an animated status icon while the Node Manager starts the server on the target machine. (See Figure 4-3.)
When the Node Manager finishes its start sequence, the status icon is no longer displayed and the server's state is indicated in the Current Status table, under the State column. (See Figure 4-4.)
Figure 4-4 View the Node Manager Output
These messages are also written to the Node Manager log file for that server, as described in "Managed Server Log Files."
Starting Managed Servers From a WebLogic Server Script
A Managed Server is a WebLogic Server instance that runs deployed applications. It refers to the Administration Server for all of its configuration and deployment information. Usually, you use Managed Servers to run applications in a production environment. For more information about Managed Servers and Administration Servers, refer to "Overview of WebLogic Server Domains."
WebLogic Server provides scripts that you can use to start Managed Servers, however, these scripts do not use the Node Manager to start and manage the server.
To use the WebLogic Server scripts to start a Managed Server, do the following:
where domain_directory is the directory that you specified as the base directory for the domain. (See Figure 4-1.)
For example, if you installed WebLogic Server on the D drive of the remote computer, make sure the call command specifies the D drive:
@rem set up common environment
call "D:\bea\weblogic\common\bin\commEnv.cmd"
For example, the following command uses startManagedWebLogic.cmd to start a Managed Server named myManagedServer. The listen address for the domain's Administration Server is AdminHost://7001:
c:\user_domains\mydomain\startManagedWebLogic.cmd myManagedServer http://AdminHost://7001
For more information on configuring a connection to the Administration Server, refer to Configuring a Connection to the Administration Server.
To set environment variables, the script invokes WL_HOME\common\bin\commEnv.cmd (commEnv.sh on UNIX), where WL_HOME is the location in which you installed WebLogic Server.
After setting environment variables, the start script invokes the java weblogic.Server command, which starts a JVM and, within the JVM, a WebLogic Server instance.
When the server has successfully completes its startup process, it writes the following message to standard out:
<Notice> <WebLogicServer> <000360> <Server started in RUNNING mode>
Alternate Ways to Start Managed Servers
The following sections describe alternate ways to start a Managed Server:
Starting All Managed Servers in a Domain
The Administration Console provides an operation that starts all Managed Servers that have been configured to communicate with a Node Manager.
To start all Managed Servers in a domain., do the following:
The Node Manager is a standalone Java program provided with each WebLogic Server installation. In addition to starting and stopping Managed Servers, you can use the Node Manager to monitor and automatically restart Managed Servers based on server health. You cannot use the Node Manger to start Administration Servers. For more information on the Node Manger, refer to "Overview of Node Manager."
Figure 4-5 Click on the Name of the Domain
The Administration Console displays an animated status icon while the Node Manager starts each server on its target machine. (See Figure 4-3.)
When the Node Manager finishes the start sequence for all servers, the status icon is no longer displayed and the state of each server is indicated in the Current Status table, under the State column.
These messages are also written to the Node Manager log file for that server, as described in "Managed Server Log Files."
Starting a Managed Server in the STANDBY State
You can start a server instance so that at the end of its startup cycle, the sever is in the STANDBY state. In this state, the server listens for requests only on the domain-wide administration port.
Note: The instructions in this section apply only if you use a WebLogic Server start script (or invoke the java weblogic.Server command). If you want to use the Node Manager to start a Managed Server in the STANDBY state, refer to Starting Managed Servers from the Administration Console or the documentation for the weblogic.Admin STARTINSTANDBY command.
To start a Managed Server in the STANDBY state, do the following:
When you are ready for this server to receive non-administrative requests, refer to Resuming a Server.
Creating Scripts That Use the Node Manager
You can create your own scripts that use the Node Manager to start Managed Servers. The scripts must incorporate the weblogic.Admin START or weblogic.Admin STARTINSTANDBY commands. For more information on weblogic.Admin commands, refer to the "weblogic.Admin Command-Line Reference."
Starting a Managed Server When the Host Computer Boots
If you want a Managed Server to start automatically when you boot a computer, you can set up the server as a UNIX daemon or a Windows service. For information on starting a server as a Windows service, refer to "Setting Up a WebLogic Server Instance as a Windows Service."
Starting a Managed Server With the java weblogic.Server Command
The weblogic.Server class is the main class for a WebLogic Server instance. You can start a server instance by directly invoking weblogic.Server in a Java command or by creating your own scripts that invoke the weblogic.Server class. (The scripts that WebLogic Server creates invoke weblogic.Server in a Java command.)
For information about invoking weblogic.Server in a Java command, refer to "weblogic.Server Command Line Reference."
Starting a Managed Server if the Administration Server is Unavailable
Usually, a Managed Server contacts the Administration Server during its startup sequence to retrieve its configuration information. For information on starting Managed Servers when the Administration Server is unavailable, refer to "Starting a Managed Server When the Administration Server Is Not Available."
Note: The first time you start a Managed Server, it must be able to contact the Administration Server. Thereafter you can configure Managed Servers to start even if the Administration Server is unavailable.
Providing Usernames and Passwords to Start a Server
To start a WebLogic Server instance, you must provide the credentials of a user who is permitted to start servers. For information on user credentials, roles, and permissions, refer to "Protecting System Administration Operations."
This section describes the following tasks:
Specifying an Initial Administrative Username for a Domain
When you create a domain, the Configuration Wizard prompts you to provide a username and password. This user becomes the initial administrative user the myrealm security realm. A security realm is a collection of components (providers) that authenticate usernames, determine the type of resources that the user can access, and provide other security-related services for WebLogic resources. WebLogic Server installs the myrealm security realm and uses it by default.
The first time you start a WebLogic Server, enter this initial administrative username and password.
You can use the Administration Console to add users to myrealm. If you use an Authentication provider other than the one that WebLogic Server installs, you must use the provider's administration tools to create at least one user with administrative privileges. For information on granting administrative privileges, refer to "Protecting System Administration Operations."
You can configure a WebLogic Server to use a different security realm. If you set up different security realms, you must designate one of those realms as the default. During its startup cycle, a WebLogic Server uses the default realm to authenticate the username that you supply.
Bypassing the Prompt for Username and Password
By default, WebLogic Server prompts you for user credentials when you start an Administration Server. It also prompts for credentials when you start a Managed Server by invoking the java weblogic.Server command (either directly on the command line or through a script that invokes the command).
Note: WebLogic Server does not prompt you for user credentials if you use the Node Manager to start a Managed Server; you must provide these credentials when you configure Remote Startup properties in the Administration Console. For more information, refer to Specifying User Credentials When Starting a Server with the Node Manager.
If you want to bypass the prompt for username and password, we recommend that you create and use a boot identify file, which contains your username and password in an encrypted format.
This section contains the following subsections:
To create a boot identity file, place the following two lines in a text file:
username=username
password=password
The username and password values must match an existing user account in the Authentication provider for the default security realm and must belong to a role that has permission to start a server. For information on roles and permissions, refer to "Protecting System Administration Operations."
If you save the file as boot.properties and locate it in the server's root directory, the server will automatically use this file during startup. For information about specifying a server's root directory, refer to the -Dweblogic.RootDirectory argument in "Location of License and Configuration Data."
If you save the file under a different name or in a different location, you must use an additional command-line argument. For more information, refer to the next section, Using a Boot Identity File.
The first time you use this file to start a sever, the server reads the file and then overwrites it with an encrypted version of the username and password.
For a given server instance, use only the boot identity file that the instance has created. For example, if you use ServerA to generate a boot identity file, use only that boot identity file with ServerA. WebLogic Server does not support multiple server instance sharing a single boot identity file.
If a server's root directory contains a valid boot.properties, it uses this file by default.
If you want to specify a different file (or if you do not want to store boot identity files in a server's root directory), you can include the following argument in the server's weblogic.Server startup command:
-Dweblogic.system.BootIdentityFile=filename
where filename is the fully qualified pathname of a valid boot identity file.
To specify this argument in the startWebLogic script, add -Dweblogic.system.BootIdentityFile as a value of the JAVA_OPTIONS variable. For example:
JAVA_OPTIONS=-Dweblogic.system.BootIdentityFile=C:\BEA\user_domains\mydomain\myidentity.prop
If a server is unable to access its boot identity file, it displays the username and password prompt in its command shell and writes a message to the log file.
Boot Identity Files and Managed Server Independence
Managed Server Independence (MSI) enables Managed Servers to start even if the Administration Server is not available. If you want to use a boot identity file for a Managed Server that starts in MSI mode, you must copy it and other files to the root directory of the Managed Server. For more information, refer to "Starting a Managed Server When the Administration Server Is Not Accessible."
Removing a Boot Identity File After Startup
If you want to remove the boot identity file after a server starts, you can include the following argument in the server's weblogic.Server startup command:
-Dweblogic.system.RemoveBootIdentity=true
This argument removes only the file that the server used to start. For example, if you specify -Dweblogic.system.BootIdentityFile=c:\secure\boot.MyServer, only boot.MyServer is removed, even if the server's root directory contains a file named boot.properties.
To specify this argument in the startWebLogic script, add -Dweblogic.system.RemoveBootIdentity=true as a value of the JAVA_OPTIONS variable. For example:
JAVA_OPTIONS=-Dweblogic.system.RemoveBootIdentity=true
Alternate Method: Passing Identity Information on the Command Line
Using a boot identity file is the most secure and convenient way to bypass the interactive prompt. However, instead of using a boot identify file, you can add the following arguments to the weblogic.Server startup command:
-Dweblogic.management.username=username
-Dweblogic.management.password=password
If you supply both of these arguments, you can bypass the interactive prompt.
Because the command to start a server can be long, typically you place most of the startup command in a script. Unless you are in an environment in which security is not a concern, we recommend that you do not save the -Dweblogic.management.password=password argument in a startup script.
For more information about these arguments, refer to Starting in Development Mode or Production Mode.
Specifying User Credentials When Starting a Server with the Node Manager
If you use the Node Manager to start a Managed Server, you must provide user credentials on the Remote Start tab of the Administration Console. If you do not provide these credentials, the Node Manager throws an exception when it tries to start the server.
If you use the Administration Console to create a Managed Server, the Administration Console adds your WebLogic Server credentials to the server's Remote Start tab. The Administration Console encrypts the password before writing it to the config.xml file.
If you use the Domain Configuration Wizard to create Managed Servers, you must start the Administration Console and provide user credentials.
To specify or modify user credentials when starting a server with the Node Manager, do the following:
The user must be in a role that has permission to start servers. For information on roles and permissions, refer to "Protecting System Administration Operations."
The following sections describe miscellaneous startup tasks:
Running a Startup Script Outside the Server's Root Directory
All instances of WebLogic Server use a root directory to store runtime data and to provide the context for any relative pathnames in the server's configuration. An Administration Server requires the domain's config.xml file to be located in its root directory. For more information about a server's root directory, refer to "A Server's Root Directory."
If you use a WebLogic Server script to start a server instance, by default the server assumes that the directory from which you run the script is the server's root directory.
If you want to locate and run your startup script outside of a server's root directory, edit the WebLogic Server script so that the JAVA_OPTIONS variable specifies the following:
where path specifies the location of the root directory.
For example, if you use c:\bea\user_projects\mydomain\startManagedWebLogic.cmd to start a Managed Server, but you want the server's root directory to be d:\ManagedServerRoot, edit c:\bea\user_projects\mydomain\startManagedWebLogic.cmd to make the JAVA_OPTIONS variable specify the following:
JAVA_OPTIONS=-Dweblogic.RootDirectory=d:\ManagedServerRoot
Configuring a Connection to the Administration Server
If you start a Managed Server from a script that invokes the java weblogic.Server command, or if you invoke the java weblogic.Server command directly, you must make sure that the Managed Server specifies the correct listen address of the Administration Server. A Managed Server uses this address to retrieve its configuration from the Administration Server.
Use the following format to specify the listen address:
For protocol, you can specify any of the following:
If you do not specify a value, the servers use T3.
Note: Regardless of which protocol you use, the initial download of a Managed Server's configuration is over HTTP or HTTPS. After the RMI subsystem initializes, the server instance can use the T3 or T3S protocol.
For Admin-host, you can use any of the following by default:
Valid only if you are starting the Managed Server on the same computer as the Administration Server.
If the Administration Server's host computer is a multihomed machine, you cannot specify the DNS name. Instead, you must specify an IP address of the computer that is hosting the Administration Server.
Because of the following security issue, we recommend that you do not use IP addresses for Admin-host in a production environment:
To connect to the Administration Server through an SSL port, the Managed Server verifies that the Administration Server's host name matches the host name that is specified in the URL. If you specify an IP address, and if host name verification is enabled, the connection will fail because the IP address, which is a series of numbers, does not match the name of the host, which is a string of characters.
In a development environment, where security is less of a concern, you can disable host name verification on the Managed Server so SSL connections that specify an IP address will succeed. For more information, refer to "Using a Hostname Verifier."
If the Administration Server has been configured to use some other listen address, you must specify the configured listen address. For more information, refer to Setting the Listen Address.
For port, specify any of the following:
If you have enabled the domain-wide administration port, you must specify this port. You must specify either the T3S or HTTPS protocol to use this port.
If this listen port has been disabled for the Administration Server, you must use one of the other listen ports described in this list. You must specify either the T3 or HTTP protocol to use this port.
If this listen port has been disabled for the Administration Server, you must use one of the other listen ports described in this list. You must specify either the T3S or HTTPS protocol to use this port.
To verify the host IP address, name, and default listen port of the Administration Server, start the Administration Server in a shell (command prompt). When the server successfully finishes its startup cycle, it prints to standard out messages that are similar to the following (among other messages):
<Apr 19, 2002 9:24:19 AM EDT> <Notice> <WebLogicServer> <000355> <Thread "Listen Thread.Default" listening on port 7001, ip address 11.12.13.141>
...
<Apr 19, 2002 9:24:19 AM EDT> <Notice> <WebLogicServer> <000331> <Started WebLogic Admin Server "MedRecServer" for domain "MedRec" running in Development Mode>
For information on enabling SSL, refer to "Configuring the SSL Protocol." For more information on Administration Ports, refer to Enabling the Domain-Wide Administration Port.
Starting in Development Mode or Production Mode
You can run WebLogic Server in two different modes: development and production. The setting applies to all servers in a domain: either all servers run in development mode or all servers run in production mode.
Development mode enables WebLogic Server instances to automatically deploy and update applications that are in the domain_name/applications directory (where domain_name is the name of a WebLogic Server domain).
Production mode disables the auto-deployment feature. Instead, you must use the WebLogic Server Administration Console or the weblogic.Deployer tool. For more information on deployment, refer to "Deployment and Packaging."
In addition, the default values for some WebLogic Server attributes differ depending on the mode.
By default, WebLogic Server instances run in development mode. To make all servers in a domain start in production mode, do the following:
If you have started a server in the STANDBY state, when you are ready for the server to receive requests other than administration requests, do the following:
For information on how the server transitions from STANDBY to the RUNNING state, refer to "RESUMING."
Changing the JVM That Runs a WebLogic Server Instance
When you install WebLogic Server, the scripts that set up the WebLogic Server environment and that start server instances are all configured to use the JVM that the WebLogic installation program installed. The following sections describe how to use a JVM that was not installed with WebLogic Server:
Changing the JVM for a WebLogic Server Startup Script
If you use a WebLogic Server script to start servers, or if your own startup scripts refer to WL_HOME\common\bin\commEnv.cmd (commEnv.sh on UNIX), do the following:
All of the startup scripts that refer to the commEnv file will use the JVM that you specified.
Changing the JVM for the Node Manager and Servers
To change the JVM that the Node Manager uses and the default JVM for each Managed Server that the Node Manager starts, do the following:
If you want a specific Managed Server to use a JVM that is different from the one that the Node Manager is using, do the following:
Specifying Java Options for a WebLogic Server Instance
You use Java options to configure operating parameters for the JVM that runs a WebLogic Server instance. For example, you use Java options to tune the performance and monitoring capabilities of the JRockit JVM.
You can also use Java options to temporarily override a server's configuration. The Java options apply only to the current instance of the server. They are not saved in the domain's config.xml file and they are not visible from the Administration Console. For example, if a server is configured to listen on port 7201, you can use a Java option to start the server so that it listens on port 7555. The Administration Console will still indicate that the server is configured to listen on port 7201. If you do not use the Java option the next time you start the server, it will listen on port 7201.
The following sections describe how to specify Java options for the JVM that runs a WebLogic Server instance:
Specifying Java Options for a WebLogic Server Startup Script
If you use a WebLogic Server script to start servers, do the following:
where domain_directory is the directory that you specified as the base directory for the domain. (See Figure 4-1.)
For information on the Java options that the JRockit Virtual Machine supports, refer to "JRockit Java Virtual Machine User Guide." For information on the Java options that other JVMs support, refer to the documentation that the JVM vendor provides.
For information on the Java options that set runtime behavior of a WebLogic Server instance, refer to "weblogic.Server Command-Line Reference."
Specifying Java Options for a Managed Server that the Node Manager Starts
If you use the Node Manager to start Managed Servers, do the following for each server:
For information on the Java options that the JRockit Virtual Machine supports, refer to "JRockit Java Virtual Machine User Guide." For information on the Java options that other JVMs support, refer to the documentation that the JVM vendor provides.
For information on the Java options that set runtime behavior of a WebLogic Server instance, refer to "weblogic.Server Command-Line Reference."
Addressing Out of Memory Errors
When starting WebLogic Server, JDK 1.3 may throw an OutOfMemory error if you are trying to load a large number of classes. This error occurs even though there appears to be plenty of memory available. If you encounter a java.lang.OutOfMemory error exception when you start WebLogic Server, increase the value of the following JVM option:
where <value> is some number in kilobytes.
For JDK1.3.1, the default value for MaxPermSize is 64m, where m stands for megabytes.
Shutting Down Instances of WebLogic Server
You can do any of the following to shut down a WebLogic Server instance:
To shut down a server from the Administration Console, do the following.
A graceful shutdown gives WebLogic Server subsystems time to complete certain application processing currently in progress. For information, refer to Controlling Graceful Shutdowns and "Graceful Shutdown."
When you initiate a forced shutdown, the server instructs subsystems to immediately drop in-work requests. For more information, refer to Setting the Timeout Period for Forced Shutdown Operations and "Forced Shutdown."
If you shut down the Administration Server, the Administration Console is no longer active.
Shutting Down All Servers in a Domain
To shut down all Managed Servers and the Administration Server, do the following:
When you initiate a forced shutdown, each server notifies its subsystems to complete all in-work requests. A graceful shutdown gives WebLogic Server subsystems time to complete certain application processing currently in progress. For information, refer to Controlling Graceful Shutdowns and "Graceful Shutdown."
When you initiate a forced shutdown, the server instructs subsystems to immediately drop in-work requests. For more information, refer to Setting the Timeout Period for Forced Shutdown Operations and "Forced Shutdown."
Controlling Graceful Shutdowns
A graceful shutdown gives WebLogic Server subsystems time to complete certain application processing currently in progress. To control the length of the graceful shutdown process, do the following:
Setting the Timeout Period for Forced Shutdown Operations
For more information about LifeCycle operations, refer to "Server Lifecycle."
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: