Weblogic Interview QA and Weblogic
Weblogic Interview QA and Weblogic
If you create a domain in production mode, or if you want to change user credentials in an
existing boot identity file, you can create a new boot identity file.
What happens when a failure occurs and the stub cannot connect to a WebLogic
Server instance?
When the failure occurs, the stub removes the failed server instance from its list. If there are
no servers left in its list, the stubb uses DNS again to find a running server and obtain a
current list of running instances. Also, the stub periodically refreshes its list of available
server instances in the cluster; this allows the stub to take advantage of new servers as they
are added to the cluster.
Each WebLogic Server instance in a cluster uses multicast to broadcast regular "heartbeat"
messages that advertise its availability. By monitoring heartbeat messages, server instances
in a cluster determine when a server instance has failed. The other server instances will drop
a server instance from the cluster, if they do not receive three consecutive heartbeats from
that server instance
WebLogic Server also monitors socket errors to determine the availability of a server
instance. For example, if server instance A has an open socket to server instance B, and the
socket unexpectedly closes, server A assumes that server B is offline.
Failed servers can be more of a problem for browser-based clients, because they always use
DNS. To avoid unnecessary DNS requests with browser-based clients, use a third-party load-
balancer such as Resonate, BigIP, Alteon, and LocalDirector. These products mask multiple
DNS addresses as a single address. They also provide more sophisticated load-balancing
options than round-robin, and they keep track of failed servers to avoid routing unnecessary
requests.
In most cases, WebLogic Server clusters scale best when deployed with one WebLogic Server
instance for every two CPUs. However, as with all capacity planning, you should test the
actual deployment with your target web applications to determine the optimal number and
distribution of server instances.
Can I set the deployment order for application modules? For standalone modules?
The Load Order attribute controls the deployment order of standalone modules and
applications relative to other modules and applications of the same type. For example,
standalone EJBs with smaller Load Order values are deployed before those with higher
values.
Modules that are deployed as part of an Enterprise Application (EAR file or directory) are
deployed in the order in which they are specified in the application.xml deployment
descriptor.
The auto-deployment feature is enabled for servers that run in development mode. To
disable auto-deployment feature, use one of the following methods to place servers in
production mode:
In the Administration Console, click the name of the domain in the left pane, then
select the Production Mode checkbox in the right pane.
At the command line, include the following argument when starting the domain's
Administration Server:
-Dweblogic.ProductionModeEnabled=true
Production mode is set for all WebLogic Server instances in a given domain.
To ensure that all classes are loaded in an undeployable way. Every server must have
access to each EJB's classes so that it can be bound into the local JNDI tree. If only a
subset of the servers deploys the bean, the other servers will have to load the bean's
classes in their respective system classpaths which makes it impossible to undeploy
the beans.
A. When you create a domain, the Configuration Wizard prompts you to provide the
username and password for an initial administrative user. If you create the domain in
development mode, the wizard saves the username and encrypted password in a boot
identity file. A WebLogic Server instance can refer to a boot identity file during its
startup process. If a server instance does not find such a file, it prompts you to enter
credentials.
If you create a domain in production mode, or if you want to change user credentials in
an existing boot identity file, you can create a new boot identity file. WebLogic Server
does not support copying a boot identity file from one server root directory to another.
For information on creating and using boot identity files, see Boot Identity Files in
Administration Console Online Help.
WebLogic Server installs the following script that you can use to set the classpath that a
server requires:
WL_HOME\server\bin\setWLSEnv.cmd (on Windows)
WL_HOME/server/bin/setWLSEnv.sh (on UNIX)
where WL_HOME is the directory in which you installed WebLogic Server. For more
information, see "Setting the Classpath" in the WebLogic Server Command Reference.
Use the Administration Console. See "Using the Administration Console" in the
Administration Console Online Help.
If you want to create scripts that automate domain management, use the
weblogic.Admin utility. See "weblogic.Admin Command-Line Reference" in the
.
If you want to create Java-based management applications, use the Java
Management Extensions (JMX) Application Programming Interface (API). See
the Programming WebLogic Management Services with JMX guide.
If you want to edit the config.xml file directly (not recommended), see the BEA
WebLogic Server Configuration Reference.
For a streamlined approach, follow the instructions at "Starting Managed Servers From a
WebLogic Server Script" in the Administration Console Online Help.
Q. The Tree View pane of the WebLogic Console is not visible in my browser. How do I
enable it?
Answers -
Question 1: Correct Answer: D
Question 2: Correct Answer: B, C
Question 3: Correct Answer: D
Question 4: Correct Answer: A, D
Question 5: Correct Answer: B
Question 6: Correct Answer: D
Question 7: Correct Answer: A, B, C
Question 8: Correct Answer: A
Question 9: Correct Answer: B, C
Question 10: Correct Answer: B
Question 11: Correct Answer: B
Question 12: Correct Answer: C
Question 13: Correct Answer: D
Question 14: Correct Answer: B
Question 15: Correct Answer: C
Question 16: Correct Answer: C
Question 17: Correct Answer: B
Question 18: Correct Answer: A
Question 19: Correct Answer: A
Question 20: Correct Answer: D
Question 21: Correct Answer: C
Question 22: Correct Answer: A
Question 23: Correct Answer: A
Question 24: Correct Answer: C
Question 25: Correct Answer: B
Question 26: Correct Answer: B, D
Question 27: Correct Answer: B
Question 28: Correct Answer: A, B, D
Question 29: Correct Answer: C
Question 30: Correct Answer: A
Question 31: Correct Answer: B
Question 32: Correct Answer: B
Question 33: Correct Answer: A
Question 34: Correct Answer: C
Question 35: Correct Answer: A
Question 36: Correct Answer: A
Question 37: Correct Answer: C
Question 38: Correct Answer: A
Question 39: Correct Answer: A, B, C
Question 40: Correct Answer: B
See the WLST Command and Variable Reference for information about performing
deployment operations using the WebLogic Scripting Tool (WLST).
2. Add the WebLogic Server classes to the CLASSPATH environment variable, and
ensure that the correct JDK binaries are available in your PATH. You can use the
setWLSEnv.sh or setWLSEnv.cmd script, located in the server/bin subdirectory of
the WebLogic Server installation directory, to set the environment.
Command names and options are not case-sensitive. See Command Reference for
detailed syntax and examples of using weblogic.Deployer commands.
SSL Arguments
java [ -Dweblogic.security.TrustKeyStore=DemoTrust ]
[ -Dweblogic.security.JavaStandardTrustKeystorePassPhrase=password
]
[ -Dweblogic.security.CustomTrustKeyStoreFileName=filename
-Dweblogic.security.TrustKeystoreType=CustomTrust
[-Dweblogic.security.CustomTrustKeystorePassPhrase=password ]
]
[ -Dweblogic.security.SSL.hostnameVerifier=classname ]
[ -Dweblogic.security.SSL.ignoreHostnameVerification=true ]
weblogic.Deployer
[ User Credentials Arguments ]
COMMAND-NAME command-arguments
If you have enabled the domain-wide administration port, or if you want to secure your
administrative request by using some other listen port that is secured by SSL, you must
include SSL arguments when you invoke weblogic.Deployer. Table 7-1 describes all
SSL arguments for the weblogic.Deployer utility.
Argument
-Dweblogic.security. Causes weblogic.Deployer to trust the CA certificates
TrustKeyStore=
DemoTrust in the demonstration trust keystore
(WL_HOME\server\lib\DemoTrust.jks).
Connection Arguments
java [SSL Arguments] weblogic.Deployer
[-adminurl protocol://listen_address:port_number]
[User Credentials Arguments] COMMAND-NAME command-options [Common
Arguments]
Argument Definition
-adminurl The -adminurl value must specify the listen address and
[protocol://]Admin- listen port of the Administration Server.
Server-listen-
address:listen-port
To use a port that is not secured by SSL, the format is
-adminurl [protocol]Admin-Server-listen-
address:port where t3, http, iiop, and iiops are valid
protocols.
Most weblogic.Deployer commands require you to specify the arguments in Table 7-3
to provide the user credentials of a WebLogic Server administrator.
Argument Definition
-username The Administrator username. If you supply the -username option but
username
you do not supply a corresponding -password option,
weblogic.Deployer prompts you for the password.
-password The password of the Administrator user.
password
If you want to use a specific configuration file and key file, rather
than the default files, use the -userconfigfile and -userkeyfile options
to weblogic.Deployer.
-userconfigfile Specifies the location of a user configuration file to use for the
config-file
administrative username and password. Use this option, instead of
the -user and -password options, in automated scripts or in
situations where you do not want to have the password shown on-
screen or in process-level utilities such as ps. Before specifying the
-userconfigfile option, you must first generate the file using the
weblogic.Admin STOREUSERCONFIG command as described in
STOREUSERCONFIG in the weblogic.Admin Command-Line
Reference.
-userkeyfile Specifies the location of a user key file to use for encrypting and
admin-key
decrypting the username and password information stored in a user
configuration file (the -userconfigfile option). Before specifying
the -userkeyfile option, you must first generate the key file using
the weblogic.Admin STOREUSERCONFIG command as described in
STOREUSERCONFIG in the weblogic.Admin Command-Line
Reference.
Common Arguments
The common options described in Table 7-4 can be used with any of the commands
described in Command Reference.
Command Reference
Cancel
Deploy
Distribute
Listapps
List, Listtask
Redeploy
Start
Stop
Undeploy
Update
Cancel
Syntax
java [SSL Arguments] weblogic.Deployer
Connection Arguments [User Credentials Arguments]
-cancel task_id
[Common Arguments]
Argument or Definition
Option
task_id The identifier of the deployment task to cancel. The identifier can be
specified by using the id option with the deploy, distribute, update,
undeploy, redeploy, stop, and start commands.
Examples
The following command starts a deployment operation and specifies the task identifier,
myDeployment:
java weblogic.Deployer -adminurl http://localhost:7001
-username weblogic -password weblogic
-deploy ./myapp.ear -id myDeployment
If the deployment task has not yet completed, the following command attempts to cancel
the deployment operation:
Deploy
Syntax
java [SSL Arguments] weblogic.Deployer
Connection Arguments [User Credentials Arguments]
-deploy [[-name] deployment_name] [-source] file
[-plan file] [-targets target_list] [-submoduletargets
target_list]
[-upload]
[-stage | -nostage | -external_stage]
[-retiretimeout seconds]
[-library [-libspecver version] [-libimplver version]]
[-altappdd file] [-altwlsappdd file]
[-securityModel] [-enableSecurityValidation]
[-id task_id]
[Common Arguments]
Argument or Option Definition
-name deployment_name Specifies the deployment name to assign to a newly-
deployed application or stand-alone module.
Examples
See the following sections for examples of using the -deploy command:
Prepares deployment files for deployment by copying deployment files to target servers
and validating them.
A distributed application can be quickly started by using the Start command. You can
start the application in Administration mode, or make it available to Administration and
client requests. While in Administration mode, the application can be accessed only by
internal clients via a configured Administration port. External clients cannot access the
application.
Syntax
java [SSL Arguments] weblogic.Deployer
Connection Arguments [User Credentials Arguments]
-distribute [[-name] deployment_name] [-source] file
[-plan file] [-targets target_list] [-submoduletargets
target_list]
[-upload]
[-stage | -nostage | -external_stage]
[-library [-libspecver version] [-libimplver version]]
[-altappdd file] [-altwlsappdd file]
[-securityModel] [-enableSecurityValidation]
[-id task_id]
[Common Arguments]
Argument or Option Definition
-name deployment_name Specifies the deployment name to assign to the
distributed application or module.
Examples
The -distribute command operates similar to -deploy, but WebLogic Server does not
start the application or module on target servers. See the examples links for the Deploy
command for more information.
Listapps
Lists the deployment names for applications and stand-alone modules deployed,
distributed, or installed to the domain.
Syntax
java [SSL Arguments] weblogic.Deployer
Connection Arguments [User Credentials Arguments]
-listapps
[Common Arguments]
Examples
List, Listtask
Syntax
java [SSL Arguments] weblogic.Deployer Connection Arguments
[User Credentials Arguments] <-list | -listtask> [task_id]
[Common Arguments]
Argument or Definition
Option
task_id The identifier of a deployment task to display. The identifier can be
specified by using the -id argument to the DEPLOY, DISTRIBUTE,
UPDATE, UNDEPLOY, REDEPLOY, STOP, and START commands.
Examples
Redeploy
Redeploys a running application or part of a running application.
Syntax
java [SSL Arguments] weblogic.Deployer
Connection Arguments [User Credentials Arguments]
-redeploy [[-name] deployment_name] {-source file | filelist}
[-plan file] [-targets target_list] [-submoduletargets
target_list]
[-upload]
[-delete_files]
[-retiretimeout seconds] [-id task_id]
[Common Arguments]
Argument or Option Definition
-name Specifies the deployment name of a deployed application or
deployment_name
module. The -name option can be omitted, in which case the name
is taken from the -source file argument.
-source file Specifies the archive file or exploded archive directory to
distribute, deploy, or redeploy.
If you do not specify a target list with the -deploy command, the
target defaults to:
If you do not specify a target list with the -redeploy command, the
application is redeployed on all of its current target servers.
-submoduletargets Specifies JMS Server targets for resources defined within a JMS
target_list
application module. See Using Sub-Module Targeting with JMS
Application Modules and Using WLST to Manage JMS Servers
and JMS System Resources in Configuring and Managing
WebLogic JMS.
-upload Transfers the specified deployment files, including deployment
plans and alternate deployment descriptors, to the Administration
Server. Use this option when you are on a remote machine and you
cannot copy the deployment files to the Administration Server by
other means. The application files are uploaded to the WebLogic
Server Administration Server's upload directory prior to
distribution and deployment.
Use the -upload option with the REDEPLOY command when you
are upgrading an application to a new version.
-delete_files Removes static files from a server's staging directory.
delete_files is valid only for unarchived deployments, and only
for applications deployed using -stage mode. You must specify
target servers when using this option, as shown in the following
example:
Note: Because the -delete_files option deletes all specified files or,
if you specify a directory but do not specify files within the
directory, all files in the specified directory, BEA recommends that
you use caution when using the delete_files option and that you do
not use the delete_files option in production environments.
-retiretimeout Specifies the number of seconds before WebLogic Server
seconds
undeploys the currently-running version of this application or
module. See Redeploying a New Version of an Application.
-id task_id Specifies the task identifier of a running deployment task. You can
specify an identifier with the -deploy, -redeploy, or -undeploy
commands, and use it later as an argument to the -cancel or -list
commands. Make sure that the identifier is unique to all other
running deployment tasks. The system automatically generates a
unique identifier if you do not specify one.
Examples
See the following sections for examples of using the -redeploy command:
Start
Makes a stopped (inactive) application available to clients on target servers. -start does
not redistribute deployment files to target servers. Optionally, with the -adminmode
option, starts the application in Administration mode, which makes it available only via a
configured Administration channel. In order to issue a -start command, the files must
already be available via an earlier -deploy or -distribute command.
If you do not specify a target list with the -deploy command, the
target defaults to:
Examples
See the following sections for examples of using the -start command:
Stop
Makes an application inactive and unavailable administration and client requests. All of
the application's staged files remain available on target servers for subsequent -start,
-deploy, -redeploy, or -undeploy actions. You can optionally choose to stop the
application only to client requests by placing it in Administration mode with the
-adminmode option. While in Administration mode, the application be accessed only via
a configured Administration channel.
Syntax
java [SSL Arguments] weblogic.Deployer
Connection Arguments [User Credentials Arguments]
-stop [-adminmode] [-name] deployment_name
[-appversion version] [-planversion version]
[-targets target_list] [-submoduletargets target_list]
[-ignoresessions] [-graceful]
[-id task_id]
[Common Arguments]
Argument or Option Definition
-adminmode Indicates that a running application should switch to
Administration mode and accept only Administration requests via
a configured Administration channel. If this option is not specified,
the running application is stopped and cannot accept
Administration or client requests until is it restarted.
-name Specifies the deployment name of a deployed application or
deployment_name
module. The -name option can be omitted, in which case the name
is taken directly from the deployment_name. (If the
deployment_name specifies a file or directory name, the
deployment name is derived from the file specification.)
-appversion The version identifier of the deployed application.
version
-planversion The version identifier of the deployment plan.
version
-targets Specifies the targets on which to -distribute, -deploy, -redeploy,
target_list
-start, or -stop the application or module.
If you do not specify a target list with the -deploy command, the
target defaults to:
-id task_id Specifies the task identifier of a running deployment task. You can
specify an identifier with the -distribute, -deploy, -redeploy,
-start, -stop, or -undeploy commands, and use it later as an
argument to the -cancel or -list commands. Make sure that the
identifier is unique to all other running deployment tasks. The
system automatically generates a unique identifier if you do not
specify one.
Examples
See the following sections for examples of using the -stop command, see Stopping an
Application to Restrict Client Access.
Undeploy
Stops the deployment unit and removes staged files from target servers.
Warning: You should only undeploy applications that you are certain you want to
completely remove; to temporarily stop client access to applications, use the -stop
command, described in weblogic.Deployer Command-Line Reference, instead.
Syntax
java [SSL Arguments] weblogic.Deployer
Connection Arguments [User Credentials Arguments]
-undeploy [-name] deployment_name
[-appversion version] [-planversion version]
[-targets target_list] [-submoduletargets target_list]
[-graceful] [-ignoresessions]
[-id task_id]
[Common Arguments]
Argument or Option Definition
-name Specifies the deployment name of a deployed application or
deployment_name
module. The -name option can be omitted, in which case the name
is taken directly from the deployment_name. (If the
deployment_name specifies a file or directory name, the
deployment name is derived from the file specification.)
-appversion The version identifier of the deployed application.
version
-planversion The version identifier of the deployment plan.
version
-targets Specifies the targets from which the application or module are
target_list
undeployed.
Note: Any target not included in the target list is not removed.
Note: Any sub-module target not included in the target list is not
removed.
Examples
See the following sections for examples of using the -undeploy command:
Update
Note: -update cannot be used to update an application's resource bindings. To update the
resource bindings for an application, you must use the Redeploy command.
Syntax
java [SSL Arguments] weblogic.Deployer
Connection Arguments [User Credentials Arguments]
-update -plan deployment_plan [-name] deployment_name
[-appversion version] [-planversion version]
[-targets target_list] [-submoduletargets target_list]
[-upload] [-id task_id]
[Common Arguments]
Argument or Option Definition
-plan Identifies the deployment plan to use for updating the application's
deployment_plan configuration. The specified deployment plan must be valid for the
application's target servers. For example, the plan cannot contain
null variables for required resources unless those resources were
previously defined in the associated desrciptor.
If you do not specify a target list with the -deploy command, the
target defaults to:
Example
Assuming:
<AppDeployment
Name="dd-remote-cluster"
SourcePath="./udd-debug-deployment-on-remote-cluster-jms.xml"
Targets="mycluster">
<SubDeployment Name="RemoteCluster" Targets="mycluster"/>
<SubDeployment Name="D1C2S2" Targets="D1C2S2"/>
<SubDeployment Name="RemoteClusterServers" Targets="D1C2S1,D1C2S2"/>
<SubDeployment Name="RemoteClusterJMSServers"
Targets="RemoteJMSServer1,RemoteJMSServer2"/>
<SubDeployment Name="RemoteQueue1" Targets="RemoteJMSServer1"/>
</AppDeployment>
The following topics describe the steps required to create a new domain using the
Configuration Wizard:
Related Topics
Introduction to Domains
The Welcome window prompts you to choose whether you want to create a new domain
or extend an existing one.
Related Topics
Introduction to Domains
Creating a New Domain
The Select a Domain Source window prompts you to select the source from which to
create the domain. You can select the product components to include in your domain, or
select a custom template on which to base your domain.
Choose one of the following options for selecting the source for your domain:
To use this option, select the check boxes associated with the components you
want to include, and click Next.
To use this option, manually enter the full pathname to the template in the
Template location field and click Next, or click Browse to navigate to the
directory containing the desired template. Select the domain template that
contains the settings you want to use as the basis for your domain.
Note: While using the Configuration Wizard or WLST Offline to create or extend
a clustered domain with a template that has applications containing application-
scoped JDBC and/or JMS resources, you may need to perform additional steps
(after the domain is created or extended) to make sure that the application and its
application-scoped resources are targeted and deployed properly in a clustered
environment. For more information on the targeting and deployment of
application-scoped modules, see "Deploying Applications and Modules" in
Deploying Applications to WebLogic Server at the following URL:
http://e-docs.bea.com/wls/docs90/deployment/deploy.html
1. Enter a valid value in the Username field. This name is used to boot the
Administration Server and connect to it.
2. Enter a valid value in the User password field: a string of at least 8 case-sensitive
characters. The password value is encrypted.
Note: Do not use the name/password combination weblogic/weblogic in a
production environment.
The Configure Server Start Mode and JDK window prompts you to specify the:
Specify the startup mode for your domain as shown in the following table.
The following table describes the differences between development and production
modes in terms of key functions.
Function
SSL You can use the demonstration digital You should not use the
certificates and the demonstration keystores demonstration digital
provided by the WebLogic Server security certificates and the
services. With these certificates, you can demonstration keystores. If
design your application to work within you do so, a warning message
environments secured by SSL. is displayed.
For more information about managing
security, see "Configuring SSL" in
Securing WebLogic Server at the following
URL:
http://e-docs.bea.com/wls/docs90/
secmanage/ssl.html
Deploying WebLogic Server instances can The auto-deployment feature is
Applications automatically deploy and update disabled, so you must use the
applications that reside in the WebLogic Server
domain_name/autodeploy directory Administration Console, the
(where domain_name is the name of a weblogic.Deployer tool, or
domain). the WebLogic Scripting Tool
(WLST). For more
It is recommended that this method be used information, see Deploying
only in a single-server development Applications to WebLogic
environment. Server at the following URL:
http://e-docs.bea.com/wls/
docs90/deployment/deploy.html#autodeplo
y
Log File When you start a server, the server A server rotates its local log
Rotation automatically renames (rotates) its local file after the size of the file
server log file as server-name.log.n. For reaches 500 kilobytes.
the remainder of the server session, the
server rotates its local log file whenever the
size of the file reaches 500 kilobytes.
The JDK Selection pane prompts you to select the J2SE Development Kit (JDK) for the
startup mode you selected in the WebLogic Domain Startup Mode pane. The
Configuration Wizard presents a list of the JDKs supplied by BEA and installed with the
product, including:
Sun JDK
Select only those JDKs that are supported on the platform you are using. For a list of the
JDKs that are supported for a specific platform, see Supported Configurations. The
default selection reflects the JDK that best meets the requirements of your environment,
based on the platform on which you are installing the domain.
Note: If you plan to use the JRockit JDK in production mode, BEA recommends that you
develop and test your applications using BEA JRockit early in your project cycle. For
information about BEA JRockit, see the BEA JRockit JDK documentation at the
following URL:
http://e-docs.bea.com/wljrockit/docs50/index.html
• To use a JDK supplied by BEA, select BEA Supplied JDKs and then
select a JDK from the list.
• To use a JDK that is not installed with the product, select Other JDK,
click Browse, and navigate to the appropriate directory.
Note: The Configuration Wizard does not configure the start scripts to use
this type of JDK. You must change the start scripts manually.
Related Topics
For information on changing the run-time mode after you have created a domain, see
"Change to production mode" in the WebLogic Server Administration Console Online
Help at http://e-
docs.bea.com/wls/docs90/ConsoleHelp/taskhelp/domainconfig/ChangeRuntimeModes.ht
ml.
The Customize Environment and Services Settings window gives you the option to
change the distribution of your domain across servers, clusters, and machines, and to
modify existing JDBC and JMS file store settings.
If you choose not to customize any environment or services settings by accepting the
default (No), you proceed directly to creating the domain.
If the domain source on which you are basing your domain contains a database
configuration, you have the option to do the following:
Modify JDBC Data Source settings, including database type and drivers
Test the connections to the database
Load the database
If a JMS file store has been defined in the domain source, you can also change the file
store definition.
For more information, see Customizing Existing JDBC and JMS Settings.
The Create WebLogic Domain window prompts you to specify the name and pathname
for the domain, and initiate its creation.
1. Make sure that the Domain Name field contains the name of the required domain.
If you need to change the value in this field, click within the field and modify the
string displayed there.
2. Make sure that the Domain Location field contains the name of the required
domain directory. If you need to change the value in this field:
1. Click Browse to invoke the Select a WebLogic Domain Directory dialog
box.
2. In the dialog box, navigate to the appropriate directory or manually enter
its pathname in the Location field. Click OK.
3. Click Create.
Note: You cannot overwrite an existing domain. If a domain with the name you
specify already exists in the selected location, you must either delete the existing
domain, or specify a different name or location for this domain.
The Creating Domain window is opened to display status messages during the
domain creation process.
The Configuration Wizard stores the config.xml file and all other generated
components in the domain directory that you specify.
Creating Domain
The Creating Domain window displays status messages during the domain creation
process. When the process is complete, the new domain is ready for use.
If you do not want to start the server at this time, click Done.
Configuring SSL
Configuring SSL is an optional step; however, BEA recommends using SSL in a
production environment. The following sections describe how to configure SSL for
WebLogic Server:
SSL: An Introduction
One-Way and Two-Way SSL
Setting Up SSL: Main Steps
Using Host Name Verification
Enabling SSL Debugging
SSL Session Behavior
SSL Certificate Validation
Using the nCipher JCE Provider with WebLogic Server
Specifying the Version of the SSL Protocol
Notes: This chapter applies to WebLogic Server deployments using the security features
in this release of WebLogic Server as well as deployments using Compatibility Security.
All machines must be kept up to date with the current set of recommended patches from
the operating system vendors.
SSL: An Introduction
Secure Sockets Layer (SSL) provides secure connections by allowing two applications
connecting over a network connection to authenticate the other's identity and by
encrypting the data exchanged between the applications. Authentication allows a server
and optionally a client to verify the identity of the application on the other end of a
network connection. Encryption makes data transmitted over the network intelligible only
to the intended recipient.
SSL in WebLogic Server is an implementation of the SSL 3.0 and Transport Layer
Security (TLS) 1.0 specifications.
WebLogic Server supports SSL on a dedicated listen port which defaults to 7002. To
establish an SSL connection, a Web browser connects to WebLogic Server by supplying
the SSL listen port and the HTTPs protocol in the connection URL, for example,
https://myserver:7002.
Using SSL is computationally intensive and adds overhead to a connection. Avoid using
SSL in development environments when it is not necessary. However, always use SSL in
a production environment.
With one-way SSL, the server is required to present a certificate to the client but
the client is not required to present a certificate to the server. To successfully
negotiate an SSL connection, the client must authenticate the server, but the
server will accept a connection from any client. One-way SSL is common on the
Internet where customers want to create secure connections before they share
personal data. Often, clients will also use SSL to log on in order for the server can
authenticate them.
With two-way SSL, the server presents a certificate to the client and the client
presents a certificate to the server. WebLogic Server can be configured to require
clients to submit valid and trusted certificates before completing the SSL
connection.
Setting Up SSL: Main Steps
To set up SSL:
1. Obtain an identity (private key and digital certificates) and trust (certificates of
trusted certificate authorities) for WebLogic Server. Use the digital certificates,
private keys, and trusted CA certificates provided by the WebLogic Server kit, the
CertGen utility, Sun Microsystem's keytool utility, or a reputable vendor such as
Entrust or Verisign to perform this step.
2. Store the identity and trust. Private keys and trusted CA certificates which specify
identity and trust are stored in a keystore.
Note: This release of WebLogic Server supports private keys and trusted CA
certificates stored in files, or in the WebLogic Keystore provider for the purpose
of backward compatibility only.
3. Configure the identity and trust keystores for WebLogic Server in the WebLogic
Server Administration Console. See "Configure Keystores" in the Administration
Console Online Help.
4. Set SSL configuration options for the private key alias and password in the
WebLogic Server Administration Console. Optionally, set configuration options
that require the presentation of client certificates (for two-way SSL). See
"Configure SSL" and "Configure two-way SSL" in the Administration Console
Online Help.
Note: When starting a WebLogic Server instance, you can specify the command line
argument -Dweblogic.security.ssl.nojce=true to use a FIPS-compliant (FIPS 140-
2) crypto module.
For information on configuring identity and trust for WebLogic Server, see Obtaining
Private Keys, Digital Certificates, and Trusted Certificate Authorities and Storing Private
Keys, Digital Certificates, and Trusted Certificate Authorities.
A host name verifier ensures the host name in the URL to which the client connects
matches the host name in the digital certificate that the server sends back as part of the
SSL connection. A host name verifier is useful when an SSL client (or a WebLogic
Server acting as an SSL client) connects to an application server on a remote host. It
helps to prevent man-in-the-middle attacks.
By default, WebLogic Server has host name verification enabled. As a function of the
SSL handshake, WebLogic Server compares the common name in the SubjectDN in the
SSL server's digital certificate with the host name of the SSL server used to initiate the
SSL connection. If these names do not match, the SSL connection is dropped. The SSL
client is the actual party that drops the SSL connection if the names do not match.
If anything other than the default behavior is desired, either turn off host name
verification or configure a custom host name verifier. Turning off host name verification
leaves WebLogic Server vulnerable to man-in-the-middle attacks. BEA recommends
leaving host name verification on in production environments.
In this release of WebLogic Server, the host name verification feature is updated so that if
the host name in the certificate matches the local machine's host name, host name
verification passes if the URL specifies localhost, 127.0.01, or the default IP address
of the local machine.
For more information, see the following topics in the Administration Console Online
Help:
SSL debugging provides more detailed information about the SSL events that occurred
during an SSL handshake. The SSL debug trace displays information about:
-Dssl.debug=true -Dweblogic.StdoutDebugEnabled=true
The SSL debugging properties can be included in the start script of the SSL server, the
SSL client, and the Node Manager. For a Managed Server started by the Node Manager,
specify this command-line argument on the Remote Start page for the Managed Server.
SSL debugging dumps a stack trace whenever an ALERT is created in the SSL process.
The types and severity of the ALERTS are defined by the TLS specification.
The stack trace dumps information into the log file where the ALERT originated.
Therefore, when tracking an SSL problem, you may need to enable debugging on both
sides of the SSL connection (on both the SSL client or the SSL server). The log file
contains detailed information about where the failure occurred. To determine where the
ALERT occurred, confirm whether there is a trace message after the ALERT. An
ALERT received after the trace message indicates the failure occurred on the peer. To
determine the problem, you need to enable SSL debugging on the peer in the SSL
connection.
When tracking an SSL problem, review the information in the log file to ensure:
WebLogic Server allows SSL sessions to be cached. Those sessions live for the life of the
server.
Clients that use SSL sockets directly can control the SSL session cache behavior. The
SSL session cache is specific to each SSL context. All SSL sockets created by SSL
socket factory instances returned by a particular SSL context can share the SSL sessions.
Clients default to resuming sessions at the same IP address and port. Multiple SSL
sockets that use the same host and port share SSL sessions by default assuming the SSL
sockets are using the same underlying SSL context.
SSL sessions exist for the lifetime of the SSL context; they are not controlled by the
lifetime of the SSL socket. Therefore, creating a new SSL socket and connecting to the
same host and port can resume a previous session as long as the SSL socket is created
using an SSL socket factory from the SSL context that has the SSL session in its cache.
By default, clients that use HTTPS URLs get a new SSL session for each URL because
each URL uses a different SSL context and therefore SSL sessions can not be shared or
reused. The SSL session can be retrieved using the weblogic.net.http.HttpsClient
class or the weblogic.net.http.HttpsURLConnection class. Clients can also resume
URLs by sharing a SSLSocket Factory between them.
Session caching is maintained by the SSL context, which can be shared by threads. A
single thread has access to the entire session cache, not just one SSL session, so multiple
SSL sessions can be used and shared in a single (or multiple) thread.
2. Configure the client Object Request Broker (ORB) to use SSL. Refer to the
product documentation for your client ORB for information about configuring
SSL.
3. Use the host2ior utility to print the WebLogic Server IOR to the console. The
host2ior utility prints two versions of the interoperable object reference (IOR),
one for SSL connections and one for non-SSL connections. The header of the IOR
specifies whether or not the IOR can be used for SSL connections.
4. Use the SSL IOR when obtaining the initial reference to the CosNaming service
that accesses the WebLogic Server JNDI tree.
For more information about using RMI over IIOP, see Programming WebLogic RMI.
WebLogic Server ensures that each certificate in a certificate chain was issued by a
certificate authority. All X509 V3 CA certificates used with WebLogic Server must have
the Basic Constraint extension defined as CA, thus ensuring that all certificates in a
certificate chain were issued by a certificate authority. By default, any certificates for
certificate authorities not meeting this criteria are rejected. This section describes the
command-line argument that controls the level of certificate validation.
Note: If WebLogic Server is booted with a certificate chain that will not pass the
certificate validation, an information message is logged noting that clients could reject it.
By default WebLogic Server rejects any certificates in a certificate chain that do not have
the Basic Constraint extension defined as CA. However, you may be using certificates
that do not meet this requirement or you may want to increase the level of security to
conform to the IETF RFC 2459 standard. Use the following command-line argument to
control the level of certificate validation performed by WebLogic Server:
-Dweblogic.security.SSL.enforceConstraints=option
Option
strong or true Use this option to check that the Basic Constraints
extension on the CA certificate is defined as CA.
For example:
-
Dweblogic.security.SSL.enforceConstraints
=strong
or
-
Dweblogic.security.SSL.enforceConstraints
=true
For example:
-
Dweblogic.security.SSL.enforceConstraints
=strict
For example:
-
Dweblogic.security.SSL.enforceConstraints
=off
Determine where the certificate chain is being rejected, and decide whether to update the
certificate chain with one that will be accepted or change the setting of the
-Dweblogic.security.SSL.enforceConstraints command-line argument.
-Dssl.debug=true -Dweblogic.StdoutDebugEnabled=true
The following message indicates the SSL failure is due to problems in the
certificate chain:
When using one-way SSL, look for this error in the client log. When using two-
way SSL, look for this error in the client and server logs.
SSL debugging provides more detailed information about the SSL events that occurred
during an SSL handshake. The SSL debug trace displays information about:
-Dssl.debug=true -Dweblogic.StdoutDebugEnabled=true
The SSL debugging properties can be included in the start script of the SSL server, the
SSL client, and the Node Manager. For a Managed Server started by the Node Manager,
specify this command-line argument on the Remote Start page for the Managed Server.
SSL debugging dumps a stack trace whenever an ALERT is created in the SSL process.
The types and severity of the ALERTS are defined by the TLS specification.
The stack trace dumps information into the log file where the ALERT originated.
Therefore, when tracking an SSL problem, you may need to enable debugging on both
sides of the SSL connection (on both the SSL client or the SSL server). The log file
contains detailed information about where the failure occurred. To determine where the
ALERT occurred, confirm whether there is a trace message after the ALERT. An
ALERT received after the trace message indicates the failure occurred on the peer. To
determine the problem, you need to enable SSL debugging on the peer in the SSL
connection.
When tracking an SSL problem, review the information in the log file to ensure:
WebLogic Server SSL has built-in certificate validation, which given a set of trusted
CAs:
Verifies that the last certificate in the chain is either a trusted CA or is issued by a
trusted CA.
Completes the certificate chain with trusted CAs.
Verifies the signatures in the chain.
Ensures that the chain has not expired.
You can use certificate lookup and validation (CLV) providers to perform additional
validation on the certificate chain. In this release, WebLogic Server has added two CLV
providers:
Outbound SSL and two-way inbound SSL in a WebLogic Server instance receive
certificate chains during the SSL handshake that must be validated. An example of two-
way inbound SSL is a browser connecting to a Web application over HTTPS where the
browser sends the client's certificate chain to the Web application. The inbound
certificate validation setting is used for all two-way client certificate validation in the
server.
Examples of WebLogic Server using outbound SSL (that is, acting as an SSL client)
include:
Using the Administration Console or WLST, you can independently configure inbound
and outbound SSL certificate validation using these SSLMBean attributes:
InboundCertificateValidation and OutboundCertificateValidation.
Note: Java Cryptography Extension (JCE) providers are written using the application
programming interfaces (APIs) in the JCE available in JDK 5.0. This type of provider is
different from the providers written using the WebLogic Security Service Provider
Interfaces (SSPIs). WebLogic Server does not provide a JCE provider by default.
The JDK JCE provider (SunJCE) in the JDK 5.0. For more information about the
features in the JDK JCE provider, see http://java.sun.com/products/jce/.
By default, the JCE provider in the JDK 5.0 has export strength jurisdiction policy
files. After filling out the appropriate forms, the domestic strength jurisdiction
policy files are downloadable from Sun Microsystems at
http://java.sun.com/products/jce/javase.html#UnlimitedDownload.
The BEA license will continue to control the strength of the cryptography used by
the WebLogic Server Application Programming Interfaces (APIs). Client code
without the appropriate domestic strength cryptography license will only be able
to use the J2SE export strength default cryptography. On the server, there will
always be a BEA license that will enable either export or domestic strength
cryptography.
The nCipher JCE provider. For more information about the nCipher JCE provider,
see http://www.ncipher.com/solutions/sslsecurity.html.
1. Install and configure the hardware for the nCipher JCE provider per the product's
documentation.
2. Install the files for the nCipher JCE provider. The following files are required:
• Jurisdiction policy files—The JDK installs these files by default but they
are of limited export strength.
• Certificate that signed the JAR file
Note: This step may have been performed as part of installing the
hardware for nCipher JCE provider. In that case, verify that the files are
correctly installed.
JAVA_HOME/jre/lib/ext
For example:
BEA_HOME/jdk150_03/jre/lib/ext
3. Edit the Java security properties file (java.security) to add the nCipher JCE
provider to the list of approved JCE providers for WebLogic Server. The Java
security properties file is located in:
JAVA_HOME/jre/lib/security/java.security
security.provider.n=com.ncipher.provider.km.mCipherKM
where
n specifies the preference order that determines the order in which providers are
searched for requested algorithms when no specific provider is requested. The
order is 1-based; 1 is the most preferred, followed by 2, and so on.
The nCipher JCE provider must follow the RSA JCA provider in the security
properties file. For example:
security.provider.1=sun.security.provider.Sun
security.provider.2=com.sun.rsajca.Provider
security.provider.3=com.ncipher.provider.km.mCipherKM
WebLogic Server supports both the SSL V3.0 and TLS V1.0 protocols. When WebLogic
Server is acting as an SSL server, it will agree to use whichever of these protocols the
client specifies as preferred in its client hello message. When WebLogic Server is acting
as an SSL client, it will specify TLS1.0 as the preferred protocol in its SSL V2.0 client
hello message, but will agree to SSL V3.0 as well, if that is the highest version that the
SSL server on the other end supports. The peer must respond with an SSL V3.0 or TLS
V1.0 message or the SSL connection is dropped.
While in most cases the SSL V3.0 protocol is acceptable there are circumstances
(compatibility, SSL performance, and environments with maximum security
requirements) where the TLS V1.0 protocol is desired. The
weblogic.security.SSL.protocolVersion command-line argument lets you specify
which protocol is used for SSL connections.
Note: The SSL V3.0 and TLS V1.0 protocols can not be interchanged. Only use the TLS
V1.0 protocol if you are certain all desired SSL clients are capable of using the protocol.
Keytool
From ConchShell
Create your key (this also creates the keystore if it doesn't exist). Make sure to use the
full state spelling and cn of your web site.
Generate the CSR. Be sure and specify sigalg here or it won't work
Now go to http://digitalid.verisign.com/
I highly recommend two-years as it will save you the hassle-factor! When it asks for your
vendor, just choose BEA WebLogic, as Javasoft has recently been removed. This choice
is probably less important than you might think -- when I asked Verisign customer
service I was told this is more of a survey than anything else.
Verisign will email you the signed certificate as an attachment. Save the attachment as
www.example.com.crt, then import it into the keystore
If you chose to get a Global Server ID (128-bit) you will need to import the intermediate
CA certificate.
You'll know this is the case if you receive this error when you try to install the certificate
that Verisign emailed to you.
[edit]
References
• http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Security10.html
• http://java.sun.com/j2se/1.4.2/docs/tooldocs/solaris/keytool.html
• http://www.churchillobjects.com/c/11201e.html
• http://www.churchillobjects.com/c/11201g.html
[edit]
See Also
• http://www.techie-blogs.com/wordpress/web/support/security/howto-compare-
two-cacerts-unix/
• http://mark.foster.cc/kb/openssl-keytool.html
• http://mark.foster.cc/kb/cacert-keystore-extraction.html
How to obtain an SSL certificate for your server (but using openssl)
• http://www.credentia.cc/certs/howto/obtain.html
Production-time Redeployment of Applications in WebLogic Server 9.0
Abstract
Upgrading a running application in a J2EE production environment isn't easy. You either
have to undeploy the old version of the application and deploy the new one—causing a
temporary outage—or you may have to set up a redundant server/cluster to route the new
requests.
BEA WebLogic Server 9.0 supports a production redeployment feature that provides a
way to seamlessly upgrade an application in a production environment without affecting
application availability. After redeploying a new version of the application, all new client
connection requests go to the new application. The existing client connections continue to
use the old application that will be undeployed/retired after all the existing connections
are closed. The two application versions are completely isolated from each other and do
not share any resources. Alternatively, the old version of the application can be retired by
specifying a retire timeout for the application.
Requirements
Currently, WebLogic Server 9.0 supports this production redeployment feature only for
Web application (WAR) modules and enterprise applications (EARs). All other types of
archives (EJB JAR, JCA RAR, WebServices archives, JMS, or JDBC standalone
modules) are not supported. EARs can contain all supported module types, except
WebServices archives. Production redeployment only supports HTTP clients; Java clients
are not supported. Attempting to perform production redeployment with an unsupported
archive type will result in an error. To redeploy such modules, remove their version
identifiers and explicitly redeploy the modules.
In addition, only versioned applications can be redeployed using this feature. A versioned
application is an application that has an application archive version specified in the
manifest of the application archive.
A deployed application must specify a version number before you can perform
subsequent production redeployment operations on the application. In other words, you
cannot deploy a non-versioned application and later perform production redeployment
with a new version of the application.
WebLogic Server 9.0 can host a maximum of two different versions of an application at
any one time. Also, when you redeploy a new version of an application, you cannot
change the application's deployment targets, security model, or persistent store settings.
To change any of the above features, you must first undeploy the active version of the
application.
For example, an application archive whose application archive version is "v1" could have
the following manifest content:
Manifest-Version: 1.0
WebLogic-Application-Version: v1
The application archive version is a string that can only contain the following characters:
alphanumeric ("A"-"Z," "a"-"z," "0"-"9"), period ("."), underscore ("_"), and hyphen
("-"). The length of the application archive version should be less than 215 characters.
Additionally, the application archive version string cannot be "." or "..". You can either
specify a version for an application using the manifest file, or assign one when using the
Deployer tool's -appversion option. The value specified in MANIFEST.MF file will
take precedence over the -appversion value.
The attached sample application (VersionedApp1) contains a Web application, which has
three JSP files:
The other application, VersionedApp2, contains the same set of files, but the
versionedjsp.jsp file will print a different message.
The sample applications provided along with this article do not have version information
in their manifest files. If you want to use production redeployment with an application
that does not include a version string in the manifest file, the Deployer tool allows you to
manually specify a unique version string using the -appversion option when deploying
or redeploying an application. Run this command to deploy the application with a version
of version1:
Note that the version string specified with -appversion is applied only when the
deployment source files do not specify a version string in MANIFEST.MF. For
applications with version information in the manifest files, you need not provide the
-appversion option.
You can also display version information for deployed applications from the command
line using the Deployer -listapps command. So for example, after deploying the above
application you can run this command to list the application:
Now that we've deployed the application, let's look at redeploying it. Since our
deployment files do not contain version information in the manifest files, we perform
redeploy with the -appversion option as mentioned above:
If you want to specify a fixed time period after which the older version of the application
is undeployed (regardless of whether clients finish their work), use the -retiretimeout
option with the -redeploy command. (-retiretimeout specifies the number of seconds
after which the older version of the application is retired):
If WebLogic Server has not yet retired an application version, you can immediately
undeploy the application version without waiting for retirement to complete. This may be
necessary if, for example, an application remains in the retiring state with only one or two
long-running client sessions that you do not want to preserve. To force the undeployment
of a retiring version of an application, use the -undeploy command and specify the
application version:
If you do not explicitly specify an application version with the -appversion option,
WebLogic Server undeploys the active version and all retired versions of the application.
After deploying the first version of the application, open a browser and invoke the
versionedjsp.jsp:
http://localhost:8802/VersionedApp/versionedjsp.jsp
That should establish an HTTP session to the VersionedApp1 application. In the browser
window we should see the "Output from VersionedApp1 JSP" message. After deploying
the VersionedApp2 application, open another browser window and invoke the
versionedjsp.jsp. Now we should see the "Output from VersionedApp2 JSP" message
from the VersionedApp2 application. At this time, both the versions of application should
be alive.
http://localhost:8802/VersionedApp/invalidatesession.jsp
This will invalidate all the established sessions to the VersionedApp1 application. Take a
look at the server console window. The retirement process should have started now. Wait
a few moments for the retirement process to complete and invoke versionedjsp.jsp
from the first browser window:
http://localhost:8802/VersionedApp/versionedjsp.jsp
This time you should see the "Output from VersionedApp2 JSP" message from the
VersionedApp2 application.
Reversing the production redeployment process switches the state of the active and
retiring applications and redirects new client connection requests accordingly. Reverting
the production redeployment process may be necessary if you detect a problem with a
newly deployed version of an application, and you want to stop clients from accessing it.
To roll back the production redeployment process, issue a second -redeploy command
and specify the deployment source files for the older version:
Downloads
References:
Abhijit Patil works as a Senior Software Engineer at BEA Systems. His expertise includes
WebLogic application clustering and deployment.
Seetharam Param works as a Senior Software Engineer at BEA Systems. His expertise
includes application deployment in WebLogic Server.
The following sections describe how to install and configure the Apache HTTP Server
Plug-In:
The Apache HTTP Server Plug-In allows requests to be proxied from an Apache HTTP
Server to WebLogic Server. The plug-in enhances an Apache installation by allowing
WebLogic Server to handle those requests that require the dynamic functionality of
WebLogic Server.
The plug-in is intended for use in an environment where an Apache Server serves static
pages, and another part of the document tree (dynamic pages best generated by HTTP
Servlets or JavaServer Pages) is delegated to WebLogic Server, which may be operating
in a different process, possibly on a different host. To the end user—the browser—the
HTTP requests delegated to WebLogic Server still appear to be coming from the same
source.
HTTP-tunneling, a technique which allows HTTP requests and responses access through
a company's firewall, can also operate through the plug-in, providing non-browser clients
access to WebLogic Server services.
The Apache HTTP Server Plug-In operates as an Apache module within an Apache
HTTP Server. An Apache module is loaded by Apache Server at startup, and then certain
HTTP requests are delegated to it. Apache modules are similar to HTTP servlets, except
that an Apache module is written in code native to the platform.
Version 1.3x of the Apache HTTP Server has several limitations with the WebLogic
Server plug-in that do not exist in later versions.
Version 1.3.x of the Apache HTTP Server Plug-In creates a socket for each request and
closes the socket after reading the response. Because Apache HTTP Server is
multiprocessed, connection pooling and keep-alive connections between WebLogic
Server and the Apache HTTP Server Plug-In cannot be supported.
Inconsistent States
The Apache HTTP Server has a multi-process architecture, and the state of the plug-in
cannot be synchronized across multiple child processes. The following types of problems
may occur:
To avoid these issues, upgrade to Apache 2.0.x, and configure Apache to use the multi-
threaded and single-process model by setting MaxSpareServers=1 in
httpd.conf. For information about editing httpd.conf, see Configuring the
Apache HTTP Server Plug-In.
Version 2.0 of the Apache HTTP Server Plug-In improves performance by using a
reusable pool of connections from the plug-in to WebLogic Server. The plug-in
implements HTTP 1.1 keep-alive connections between the plug-in and WebLogic Server
by reusing the same connection in the pool for subsequent requests from the same client.
If the connection is inactive for more than 30 seconds, (or a user-defined amount of time)
the connection is closed and returned to the pool. You can disable this feature if desired.
For more information, see "KeepAliveEnabled".
Proxying Requests
The plug-in proxies requests to WebLogic Server based on a configuration that you
specify. You can proxy requests based on the URL of the request (or a portion of the
URL). This is called proxying by path. You can also proxy requests based on the MIME
type of the requested file. Or you can use a combination of both methods. If a request
matches both criteria, the request is proxied by path. You can also specify additional
parameters for each type of request that define additional behavior of the plug-in. For
more information, see Configuring the Apache HTTP Server Plug-In.
Certifications
The Apache HTTP Server Plug-In is supported on Linux, Solaris, AIX, Windows, and
HPUX11 platforms. Plug-ins are not supported on all operating systems for all
releases.For information on platform support for specific versions of Apache, see
Platform Support for WebLogic Server Plug-ins and Web Servers in Supported
Configurations for WebLogic Server 7.0.
You install the Apache HTTP Server Plug-In as an Apache module in your Apache
HTTP Server installation. The module is installed either as a Dynamic Shared Object
(DSO) or as a statically linked module. (Installation as a statically linked module is only
available for Apache version 1.3.x). There are separate instructions in this section for
DSO and statically linked module installation.
The Apache plug-in is distributed as a shared object (.so) for use on Solaris,
Linux, Windows, AIX and HPUX11 platforms. Each shared object file is
distributed as a separate version, depending on the platform, whether or not
SSL is to be used between the client and Apache, and the encryption strength
for SSL (regular or 128 bit— 128 bit versions are only installed if you install
the 128 bit version of WebLogic Server). The shared object files are located in
the following directories of your WebLogic Server installation (where
WL_HOME is the top-level installation directory for the WebLogic platform
and the Server directory contains WebLogic Server installation files):
Operating System
Solaris WL_HOME/server/lib/solaris
Linux WL_HOME/server/lib/linux/i686
WL_HOME/server/lib/linux/s390
Windows WL_HOME\server\bin\mod_wl_20.so
(applicable to Apache versions 2.0.x )
WL_HOME\server\bin
HPUX11 WL_HOME/server/lib/hpux11
AIX WL_HOME/server/lib/aix
Warning: If you are running Apache 2.0.x server on HP-UX11, set the
environment variables specified below before you build the Apache server.
Because of a problem with the order in which linked libraries are loaded on
HP-UX, a core dump can result if the load order is not preset as an
environment variable before building. Set the following environment
variables:
(Stronghold,
modssl etc.)
Apache + Raven mod_wl_ssl_raven.so mod_wl128_ssl_raven.so
Version 1.x
Required because
Raven applies
frontpage patches
that makes the
plug-in
incompatible with
the standard shared
object
Standard Apache mod_wl_20.so mod_wl28_20.so
Version 2.0.x
The Apache HTTP Server Plug-In will be installed in your Apache HTTP
Server installation as an Apache Dynamic Shared Object (DSO). DSO
support in Apache is based on a module named mod_so.c that must be
enabled before mod_wl.so is loaded. If you installed Apache using the
supplied script, mod_so.c should already be enabled. To verify that
mod_so.c is enabled, execute one of the following commands:
...
--enable-module=so
--enable-rule=SHARED_CORE
...
3. Install the Apache HTTP Server Plug-In in the Apache 1.x server with
a support program called apxs (APache eXtenSion, see Manual Page: apxs at
http://httpd.apache.org/docs/programs/apxs.html). Issue the following
command :
$ apxs mod_so.c
AddModule mod_so.c
Note: Apache -t is a valid command for Apache 2.0.x on Windows. However, for Apache
2.0.x on HP-UX, Apache -t is not a valid command, because Apache 2.0.x on HP-UX has
apachectl and not the Apache command file.
8. Start (or restart if you have changed the configuration) Apache HTTP
Server.
9. Test the Apache plug-in by opening a browser and setting the URL to
the Apache Server + "/weblogic/", which should bring up the default
WebLogic Server HTML page, welcome file, or default servlet, as defined for
the default Web Application on WebLogic Server. For example:
http://myApacheserver.com/weblogic/
Solaris
WL_HOME/Server/lib/solaris
Linux
WL_HOME/Server/lib/linux
HPUX11
WL_HOME/Server/lib/hpux11
If you are using the Gnu C Compiler (gcc), gcc 2.95.x is the required version.
configure --activate-module=src\modules\weblogic\libweblogic.a
8. If you are using 128 bit encryption, execute the following command
(on a single line) from the Apache 1.3 home directory:
configure--activate-module=
src\modules\weblogic\libweblogic128.a
make
make install
11. Follow steps 4 through 8, inInstalling the Apache HTTP Server Plug-
In as a Dynamic Shared Object
After you install the plug-in in the Apache HTTP server, edit the httpd.conf file to
configure the Apache plug-in. Editing the httpd.conf file informs the Apache Web
server that it should load the native library for the plug-in as an Apache module and also
describes which requests should be handled by the module.
3. For Apache 2.0.x, add the following line to the httpd.conf file:
For example:
<IfModule mod_weblogic.c>
WebLogicHost myweblogic.server.com
WebLogicPort 7001
</IfModule>
<IfModule mod_weblogic.c>
WebLogicHost myweblogic.server.com
WebLogicPort 7001
MatchExpression *.jsp
</IfModule>
<IfModule mod_weblogic.c>
WebLogicHost myweblogic.server.com
WebLogicPort 7001
MatchExpression *.jsp
MatchExpression *.xyz
</IfModule>
6. If you want to proxy requests by path, use the Location block and
the SetHandler statement. SetHandler specifies the handler for the Apache
HTTP Server Plug-In module. For example the following Location block
proxies all requests containing /weblogic in the URL:
<Location /weblogic>
SetHandler weblogic-handler
</Location>
7. Define any additional parameters for the Apache HTTP Server Plug-
In.
<IfModule mod_weblogic.c>
# Config file for WebLogic Server that defines the parameters
Include conf/weblogic.conf
</IfModule>
Enter each parameter on a new line. Do not put an `=' between the
parameter and its value. For example:
PARAM_1 value1
PARAM_2 value2
PARAM_3 value3
<IfModule mod_weblogic.c>
WebLogicCluster agarwalp02:8005,agarwalp02:8006
Debug ON
WLLogFile c:/tmp/global_proxy.log
WLTempDir "c:/myTemp"
DebugConfigInfo On
KeepAliveEnabled ON
KeepAliveSecs 15
</IfModule>
<Location /jurl>
SetHandler weblogic-handler
WebLogicCluster agarwalp01:7001
</Location>
<Location /web>
SetHandler weblogic-handler
PathTrim /web
Debug OFF
WLLogFile c:/tmp/web_log.log
</Location>
<Location /foo>
SetHandler weblogic-handler
PathTrim /foo
Debug ERR
WLLogFile c:/tmp/foo_proxy.log
</Location>
All the requests which match /jurl/* will have Debug Level set to ALL and log messages
will be logged to c:/tmp/global_proxy.log file. All the requests which match /web/* will
have Debug Level set to OFF and no log messages will be logged. All the requests which
match /foo/* will have Debug Level set to ERR and log messages will be logged to
c:/tmp/foo_proxy.log file
This section contains a sample httpd.conf file. You can use this sample as a template
that you can modify to suit your environment and server. Lines beginning with # are
comments. Note that Apache HTTP Server is not case sensitive, and that the
LoadModule and AddModule lines are automatically added by the apxs utility.
####################################################
APACHE-HOME/conf/httpd.conf file
####################################################
LoadModule weblogic_module libexec/mod_wl.so
AddModule mod_weblogic.c
<Location /weblogic>
SetHandler weblogic-handler
PathTrim /weblogic
ErrorPage http://myerrorpage1.mydomain.com
</Location>
<Location /servletimages>
SetHandler weblogic-handler
PathTrim /something
ErrorPage http://myerrorpage1.mydomain.com
</Location>
<IfModule mod_weblogic.c>
MatchExpression *.jsp
WebLogicCluster w1s1.com:7001,w1s2.com:7001,w1s3.com:7001
ErrorPage http://myerrorpage.mydomain.com
</IfModule>
You must define a unique value for 'ServerName'or some Plug-In parameters will not
work as expected.
You can use the Secure Sockets Layer (SSL) protocol to protect the connection between
the Apache HTTP Server Plug-In and WebLogic Server. The SSL protocol provides
confidentiality and integrity to the data passed between the Apache HTTP Server Plug-In
and WebLogic Server.
The Apache HTTP Server Plug-In does not use the transport protocol (http or https)
specified in the HTTP request (usually by the browser) to determine whether or not the
SSL protocol is used to protect the connection between the Apache HTTP Server Plug-In
and WebLogic Server.
Although two-way SSL can be used between the HTTP client and Apache HTTP server,
note that one-way SSL is used between Apache HTTP Server and WebLogic Server.
• javax.net.ssl.peer_certificates
• java.security.cert.X509Certificate
request.getAttribute("javax.net.ssl.peer_certificates");
To use the SSL protocol between Apache HTTP Server Plug-In and WebLogic Server:
1. Configure WebLogic Server for SSL. For more information, see
Configuring the SSL Protocol.
For the HTTPClusterServlet, add the parameter to the web.xml file as follows:
<context-param>
<param-name>clientCertProxy</param-name>
<param-value>true</param-value>
</context-param>
For Web applications, add the parameter to the web.xml file as follows:
ServletRequestImpl context-param
<context-param>
<param-name>weblogic.httpd.clientCertProxy</param-name>
<param-value>true</param-value>
</context-param>
The following known issues may arise when you configure the Apache plug-in to use
SSL:
* Display it
* Detail and then copy this certificate to a file using the Coded "Base
64 X509" option
<Location /weblogic>
SetHandler weblogic-handler
</Location>
<IfModule mod_weblogic.c>
WebLogicHost localhost
WebLogicPort 7001
PathTrim /weblogic
</IfModule>
<Location /weblogic>
SetHandler weblogic-handler
PathTrim /weblogic
</Location>
The Include directive does not work with Apache SSL. You must
configure all parameters directly in the httpd.conf file. Do not use the
following configuration when using SSL:
<IfModule mod_weblogic.c>
MatchExpression *.jsp
Include weblogic.conf
</IfModule>
cd ..
cd mod_ssl-2.8.12-1.3.27
export LD_LIBRARY_PATH=/home/egross/solaris/ssl/lib
./configure "--with-apache=../apache_1.3.27"
"--with-ssl=/home/egross/solaris/ssl" "--
prefix=/usr/local/apache_so"
"--enable-rule=SHARED_CORE" "--enable-shared=ssl" "--
enable-module=so" "$@"
cd ../apache_1.3.27
make
make install
When the Apache HTTP Server Plug-In attempts to connect to WebLogic Server, the
plug-in uses several configuration parameters to determine how long to wait for
connections to the WebLogic Server host and, after a connection is established, how long
the plug-in waits for a response. If the plug-in cannot connect or does not receive a
response, the plug-in attempts to connect and send the request to other WebLogic Server
instances in the cluster. If the connection fails or there is no response from any WebLogic
Server in the cluster, an error message is sent.
Failure of the WebLogic Server host to respond to a connection request could indicate
possible problems with the host machine, networking problems, or other server failures.
Failure of all WebLogic Server instances to respond, could indicate that WebLogic
Server is not running or is unavailable, a hung server, a database problem, or other
application failure.
If you are running only a single WebLogic Server instance the plug-in only attempts to
connect to the server defined with the WebLogicHost parameter. If the attempt fails, an
HTTP 503 error message is returned. The plug-in continues trying to connect to that
same WebLogic Server instance until ConnectTimeoutSecs is exceeded.
The Dynamic Server List
When you specify a list of WebLogic Servers in the WebLogicCluster parameter, the
plug-in uses that list as a starting point for load balancing among the members of the
cluster. After the first request is routed to one of these servers, a dynamic server list is
returned containing an updated list of servers in the cluster. The updated list adds any
new servers in the cluster and deletes any that are no longer part of the cluster or that
have failed to respond to requests. This list is updated automatically with the HTTP
response when a change in the cluster occurs.
When a request contains a session information stored in a cookie, in the POST data, or by
URL encoding, the session ID contains a reference to the specific server instance in
which the session was originally established (called the primary server) and a reference
to an additional server where the original session is replicated (called the secondary
server). A request containing a cookie attempts to connect to the primary server. If that
attempt fails, the request is routed to the secondary server. If both the primary and
secondary servers fail, the session is lost and the plug-in attempts to make a fresh
connection to another server in the dynamic cluster list. For more information, see
Figure 2-1 Connection Failover.
Note: If the POST data is larger than 64K, the plug-in will not parse the POST data to
obtain the session ID. Therefore, if you store the session ID in the POST data, the plug-in
cannot route the request to the correct primary or secondary server, resulting in possible
loss of session data.
On the other hand, the HTTP error code 503 is returned when:
Make sure that the JDBC drivers that you want to use to create database connections are
installed on all servers on which you want to deploy the data source. Some JDBC drivers
are installed with WebLogic Server, including BEA WebLogic Type 4 JDBC drivers for
DB2, Informix, MS SQL Server, Oracle, and Sybase. For more information about
working with JDBC drivers, see Using Third-Party JDBC Drivers with WebLogic Server
In WebLogic Server, you configure database connectivity by adding JDBC data sources
to your WebLogic domain. A data source is a J2EE standard method of configuring
connectivity to a database. Each WebLogic data source contains a pool of database
connections. Applications look up the data source on the JNDI tree or in the local
application context and then reserve a database connection with the getConnection
method. Data sources and their connection pools provide connection management
processes that help keep your system running and performant.
1. If you have not already done so, in the Change Center of the
Administration Console, click Lock & Edit (see Use the Change Center).
2. In the Domain Structure tree, expand Services > JDBC, then select
Data Sources.
3. On the Summary of Data Sources page, click New.
4. On the JDBC Data Source Properties page, enter or select the following
information:
Name - Enter a name for this JDBC data source. This name is used in
the configuration file (config.xml) and throughout the Administration
Console whenever referring to this data source.
JNDI Name - Enter the JNDI path to where this JDBC data source will
be bound. Applications look up the data source on the JNDI tree by
this name when reserving a connection.
Database Type - Select the DBMS of the database that you want to
connect to. If your DBMS is not listed, select Other.
Database Driver - Select the JDBC driver you want to use to connect
to the database. The list includes common JDBC drivers for the
selected DBMS.
Note: You must install JDBC drivers before you can use them to create
database connections. Some JDBC drivers are installed with WebLogic
Server, but many are not installed.
Click Next to continue.
Database Name - Enter the name of the database that you want to
connect to. Exact database name requirements vary by JDBC driver
and by DBMS.
Host Name - Enter the DNS name or IP address of the server that
hosts the database.
Port - Enter the port on which the database server listens for
connections requests.
Database User Name - Enter the database user account name that
you want to use for each connection in the data source.
Password/Confirm Password - Enter the password for the database
user acccount.
Click Next to continue.
4. On the Select Targets page, select the servers or clusters on which you
want to deploy the data source.
5. Click Finish to save the JDBC data source configuration and deploy the
data source to the targets that you selected.
The heap size has an impact on allocation speed, garbage collection frequency
and garbage collection times. A small heap will become full quickly and must be
garbage collected more often. It is also prone to more fragmentation, making
object allocation slower. A large heap introduces a slight overhead in garbage
collection times. A heap that is larger than the available physical memory in the
system must be paged out to disk, which leads to long access times or even
application freezes, especially during garbage collection.
In general, the extra overhead caused by a larger heap is smaller than the gains
in garbage collection frequency and allocation speed, as long as the heap
doesn't get paged to disk. Thus a good heap size setting would be a heap that is
as large as possible within the available physical memory.
There are two parameters for setting the heap size:
For example:
java -Xms:1g -Xmx:1g MyApplication
If the optimal heap size for the application is known, we recommend that you
set -Xms and -Xmx to the same value. This gives you a controlled environment
where you get a good heap size right from the start.
The size of the nursery has an impact on allocation speed, garbage collection
frequency and garbage collection times. A small nursery will become full quickly
and must be garbage collected more often, while garbage collection of a large
nursery takes slightly longer time. A nursery that is so small that few or no
objects have died before a young collection is started is of very little use, and
neither is a nursery that is so large that no young collections are performed
between garbage collections of the whole heap that are triggered due to
allocation of large objects in old space.
An optimal nursery size for maximum application throughput is such that as
many objects as possible are garbage collected by young collection rather than
old collection. This value approximates to about half of the free heap. In BEA
JRockit R27.3.0 and later releases, the dynamic garbage collection mode
optimized for throughput, -Xgcprio:throughput, and the static generational
parallel garbage collector, -Xgc:genpar, will dynamically set the nursery size to
an approximation of the optimal value.
The optimal nursery size for throughput is often quite large, which may lead to
long young collection times. Since all Java threads are paused while the young
collection is performed, you may want to reduce the nursery size below the
optimal value to reduce the young collection pause times.
The nursery size is set using the command line option -Xns:<size>. For
example:
java -Xns:100m MyApplication
This starts up the JVM with a fixed nursery size of 100 MB.
For default values and limitations, see the documentation on -Xns.
Keep Area
Command line option: -XXkeepAreaRatio:<percentage>
The keep area size has an impact on both old collection and young collection
frequency. A large keep area causes more frequent young collections, while a
keep area that is too small causes more frequent old collections when objects
are promoted prematurely.
An optimal keep area size is as small as possible while maintaining a low
promotion ratio. The promotion ratio can be observed in JRA recordings (see
Using Mission Control Tools for more information) and verbose outputs from
-Xverbose:memory=debug, as well as in the garbage collection report printed out
by -XgcReport. By default the keep area is 25% of the nursery.
The keep area size can be changed using the command line option
-XXkeepAreaRatio:<percentage>, and is defined as a percentage of the
nursery. For example:
java -XXkeepAreaRatio:10 MyApplication
This starts up the JVM with a keep area that is 10% of the nursery size.
pausetime, which optimizes the garbage collector for short and even
pausetimes
deterministic, which optimizes the garbage collector for very short and
deterministic pause times
The dynamic garbage collection modes use advanced heuristics to tune the
following parameters in runtime:
Garbage collection strategy
Nursery size
Use a dynamic garbage collection mode if you don't want to go through the time
consuming process of tuning these parameters manually, or when a static
environment isn't optimal for your application.
Throughput Mode
Command line option: -XgcPrio:throughput
This starts up the JVM with the garbage collection mode optimized for
throughput.
For more information, see the documentation on -XgcPrio.
Pausetime Mode
Command line option: -XgcPrio:pausetime
The dynamic garbage collection mode optimizing over pause times aims to keep
the garbage collection pauses below a given pause target while maintaining as
high throughput as possible. BEA JRockit achieves this by choosing between a
mostly concurrent garbage collection strategy that allows the Java application to
continue running during large portions of the garbage collection duration, and a
parallel garbage collection strategy that stops the Java application during the
entire garbage collection duration. The mostly concurrent garbage collector
introduces some extra overhead in keeping track of changes during the
concurrent phases, and will also cause more frequent garbage collections. This
will lower the overall throughput somewhat, but keeps down the individual
garbage collection pauses.
Use pausetime mode for applications that are sensitive to long latencies, for
example transaction based systems where transaction times must be stable.
Pausetime mode is enabled with the command line option -XgcPrio:pausetime.
For example:
java -XgcPrio:pausetime MyApplication
This starts up the JVM with the garbage collection mode optimized for short
pauses.
For more information, see the documentation on -XgcPrio.
The pausetime mode uses a pause target for optimizing the pause times. The
pause target impacts the application throughput, as a lower pause target will
inflict more overhead on the memory management system. Set the pause target
as high as your application can tolerate.
The pause target for pausetime mode is by default 500 ms, and can be changed
with the command line option -XpauseTarget:<time in ms>. For example:
java -XgcPrio:pausetime -XpauseTarget:300ms MyApplication
This starts up the JVM with the garbage collection optimized for short pauses
and a pause target of 300 ms.
For more information, see the documentation on -XpauseTarget.
Deterministic Mode
Command line option: -XgcPrio:deterministic
Note: This feature is available only as part of BEA WebLogic Real Time. If
you attempt to enable it without the proper license, or with an invalid
or expired license, a warning message will be written to the console.
The dynamic garbage collection mode optimizing for deterministic pause times is
designed to ensure extremely short garbage collection pause times and limit the
total pause time within a prescribed window. BEA JRockit achieves this by using
a specially designed mostly concurrent garbage collector, which allows the Java
application to continue running as much as possible during the garbage
collection.
Use the deterministic mode for applications with strict demands on short and
deterministic latencies, for example transaction based applications.
Deterministic mode is enabled with the command line option
-XgcPrio:deterministic. For example:
java -XgcPrio:deterministic MyApplication
This starts up the JVM with the garbage collection mode optimized for short and
deterministic pauses.
For more information, see the documentation on -XgcPrio.
Memory leak trend analysis can cause longer garbage collection pauses,
similar to JRA recordings.
On requests for more information when the Memory Leak Detector is using
its graphical user interface or the Ctrl-Break handler—for example to retrieve
the number of instances of a type of object or to retrieve the list of references
to an instance or to a class—a longer pause can be introduced.
For more information on JRockit Mission Control, please refer to Using Mission
Control Tools.
The deterministic mode uses a pause target for optimizing the pause times. The
pause target impacts the application throughput, as a lower pause target will
inflict more overhead on the memory management system. Set the pause target
as high as your application can tolerate.
The garbage collector will aim on keeping the garbage collection pauses below
the given pause target. How well it will succeed depends on the application and
the hardware. For example, a pause target on 30 ms has been verified on an
application with 1 GB heap and an average of 30% live data or less at collection
time, running on the following hardware:
Running on slower hardware, with a different heap size and/or with more live
data might break the deterministic behavior or cause performance degradation
over time, while faster hardware or less live data might allow you to set a lower
pause target.
The pause target for deterministic mode is by default 30 ms, and can be
changed with the command line option -XpauseTarget:<time>. For example:
java -XgcPrio:deterministic -XpauseTarget:40ms MyApplication
This starts up the JVM with the garbage collection optimized for short and
deterministic pauses and a pause target of 40ms.
For more information, see the documentation on -XpauseTarget.
For example, the BEA WebLogic Sip Server is a transaction based system that
allocates new objects for each transaction and has short time-outs for
transactions. Long garbage collection pauses would cause transactions to time
out, so a mostly concurrent garbage collection should be used. This suggests
either gencon or singlecon. The transactions generate a lot of temporary or
short lived objects, which suggests a two-generational garbage collector,
gencon.
You can set a static garbage collection strategy with the command line option
-Xgc:<strategy>, for example:
java -Xgc:gencon MyApplication
This starts up the JVM with the generational concurrent garbage collector.
For more information, see the documentation on -Xgc.
If you are using the dynamic garbage collection mode optimized for
deterministic pause times.
If you are using static single-spaced parallel garbage collection.
For more information, consult BEA JRockit Management Console's online help.
When you are using a concurrent strategy for garbage collection (in either the
mark or the sweep phase, or both), BEA JRockit dynamically adjusts when to
start an old generation garbage collection in order to avoid running out of free
heap space during the concurrent phases of the garbage collection. The
triggering is based on such characteristics as how much space is available on the
heap after previous collections. BEA JRockit dynamically tries to optimize this
space and will occasionally run out of free heap during the concurrent garbage
collection while it does. When the limit is hit, the verbose printout:
appears below the command line (assuming you have set -Xverbose:memdbg).
This message means that a concurrent sweep could not finish in time and the
JVM is using all currently available resources to make up for it. In this case, a
parallel sweep is made. If BEA JRockit fails to adapt and the above printout
continues to appear, performance is being adversely affected. To avoid this, set
the -XXgcTrigger option to trigger a garbage collection when there is still X%
left of the heap, for example:
will trigger an old generation garbage collection when less than 20% of the free
heap size is left unused.
If you are using a parallel garbage collection strategy (in both the mark and the
sweep phase), then old generation garbage collections are performed whenever
the heap is completely full.
Adjusting Compaction
Even though the compaction heuristics in BEA JRockit are designed to keep the
garbage collection pauses low and even, you may sometimes want to limit the
compaction ratio further to reduce the garbage collection pauses. In other cases
you may want to increase the compaction ratio to keep heap fragmentation in
control. There are several ways to adjust the compaction:
Setting a static compaction ratio will force BEA JRockit to compact a specified
percentage of the heap at each old collection. This disables the heuristics for
selecting a dynamic compaction ratio that depends on the heap layout. The
compact ratio can be defined to a static percentage of the heap using the
command line option -XXcompactRatio:<percentage>. For example:
java -XXcompactRatio:1 MyApplication
This starts up the JVM with a static compact ratio of about 1% of the heap.
For more information, see the documentation on -XXcompactRatio.
Use this option if you need to force BEA JRockit to use a smaller or larger
compaction ratio than it would select by default. You can monitor the
compaction ratio in -Xverbose:memory=debug outputs and JRA recordings. A
high compaction ratio keeps down the fragmentation on the heap but increases
the compaction pause times.
When compaction has moved objects, the references to these objects must be
updated. The garbage collector does this before the Java threads are allowed to
run again, which increases the garbage collection pause proportionally to the
number of references that have been updated. The compact set limit defines
how many references there may be from objects outside the compaction area to
objects within the compaction area, thus limiting a portion of the compaction
pause. If, during a garbage collection, the number of references to the chosen
compaction area exceeds the compact set limit, the compaction will be canceled.
The compact set limit depends on the garbage collection mode used, and will for
some modes adjust dynamically in runtime. You can set a static compact set
limit by using the command line option -XXcompactSetLimit:<references>,
where "references" specifies the maximum number of references to objects
within the compaction area. For example:
java -XXcompactSetLimit:20000 MyApplication
This starts up the JVM with a compact set limit of 20000 references.
For more information, see the documentation for -XXcompactSetLimit.
Use this option to increase the compact set limit if too many compactions are
canceled (aborted), or to decrease the limit if the compaction pause times are
too long. You can monitor the compaction behavior in -Xverbose:memory=debug
outputs and JRA recordings, and compaction pause times in
-Xverbose:gcpause=debug outputs and JRA recordings.
Very few applications survive in the long run without any compaction at all, but
for those that do you can turn off the compaction entirely.
To turn off compaction entirely, use the command line option -XXnoCompaction,
for example:
java -XXnoCompaction MyApplication
Some applications are not sensitive to garbage collection pauses or perform old
collections very infrequently. For these applications you may want to try running
full compaction, as this maximizes the object allocation performance between
the garbage collections. Note however that a full compaction of a large heap
with a lot of objects may take several seconds to perform.
To turn on full compaction, use the command line option -XXfullCompaction,
for example:
java -XXfullCompaction MyApplication
The thread local area (TLA) is a chunk of free space reserved on the heap or in
the nursery and given to a thread for its exclusive use. A thread can allocate
small objects in its own TLA without synchronizing with other threads. Objects
allocated in a TLA are however not thread local. They can be accessed by any
thread and will be garbage collected globally. When the TLA gets full the thread
simply requests a new TLA.
The thread local area size influences the allocation speed, but can also have an
impact on garbage collection frequency. A large TLA size allows each thread to
allocate a lot of objects before requesting a new TLA, and in BEA JRockit R27.2
and later it also allows the thread to allocate larger objects in the thread local
area. On the other hand, a large TLA size prevents small chunks of free memory
from being used for object allocation, which increases the impact of
fragmentation. In BEA JRockit R27.1 and later, the TLA size is dynamic
depending on the size of the available chunks of free space, and varies between
a minimum and a preferred size.
Increasing the preferred TLA size is beneficial for applications where each thread
allocates a lot of objects. When a two-generational garbage collection strategy is
used, a large minimum and preferred TLA size will also allow larger objects to be
allocated in the nursery. Note however that the preferred TLA size should always
be less than about 5% of the nursery size.
Increasing the minimum TLA size may improve garbage collection times slightly,
as the garbage collector can ignore any free chunks that are smaller than the
minimum TLA size.
Decreasing the preferred TLA size is beneficial for applications where each
thread allocates only a few objects before it is terminated, so that a larger TLA
wouldn't ever become full. A small preferred TLA size is also beneficial for
applications with very many threads, where the threads don't have time to fill
their TLAs before a garbage collection is performed.
Decreasing the minimum TLA size lessens the impact of fragmentation.
A common setting for the TLA size is a minimum TLA size of 2-4 kB and a
preferred TLA size of 16-256 kB.
To adjust the TLA size, you can use the command line option
-XXtlaSize:min=<size>,preferred=<size>. For example:
java -XXtlaSize:min=1k,preferred=512k MyApplication
This starts up the JVM with a minimum TLA size of 1 kB and a preferred TLA size
of 512 kB.
For more information and default values, see the documentation on -XXtlaSize.
Note: If you are using BEA JRockit R27.1 or older and want to adjust the
TLA size, you should set -XXlargeObjectLimit:<size> and
-XXminBlockSize:<size> to the same value as the minimum TLA
size.
Note: If you are using BEA JRockit R27.0 or older the minimum and
preferred TLA size will always be the same value. The syntax for
setting the TLA size is -XXtlaSize:<size>.
Java parameters must be specified whenever you start WebLogic Server. For simple
invocations, this can be done from the command line with the weblogic.Server
command. However, because the arguments needed to start WebLogic Server from the
command line can be lengthy and prone to error, BEA recommends that you incorporate
the command into a script. To simply this process, you can modify the default values in
the sample scripts that are provided with the WebLogic distribution to start WebLogic
Server, as described in "Specifying Java Options for a WebLogic Server Instance".
If you used the Configuration Wizard to create your domain, the WebLogic startup
scripts are located in the domain-name directory where you specified your domain. By
default, this directory is BEA_HOME\user_projects\domain\domain-name, where
BEA_HOME is the directory that contains the product installation, and domain-name is
the name of the domain directory defined by the selected configuration template. For
more information about creating domains using the Configuration Wizard, see "Creating
Domains Using the Configuration Wizard".
You need to modify some default Java values in these scripts to fit your environment and
applications. The important performance tuning parameters in these files are the
JAVA_HOME parameter and the Java heap size parameters:
Change the value of the variable JAVA_HOME to the location of your JDK. For
example:
set JAVA_HOME=C:\bea\jdk141_03
For higher performance throughput, set the minimum java heap size equal to the
maximum heap size. For example:
Within a WebLogic Server domain, the configuration file is located on the machine that
hosts the Administration Server, and provides persistent storage of WebLogic MBean
attribute values. The Administration Server serves as a central point of contact for server
instances and system administration tools. A domain may also include additional
WebLogic Server instances called Managed Servers, which are used mainly for servicing
applications.
When the Administration Server starts, it reads the domain configuration file and
overrides the default attribute values of the administration MBeans with any attribute
values found in the configuration file. Every time you change an attribute using the
system administration tools (using either the command-line interface or the
Administration Console), its value is stored in the appropriate administration MBean and
written to the configuration file.
Table 4-1 lists the config.xml file parameters that affect server performance.
Element
Server NativeIOEnabled Native IO See Using
Enabled WebLogic
Server "Native
IO"
Performance
Packs.
ExecuteQueue ThreadCount Thread See Tuning the
Count Default
Execute Queue
Threads.
ExecuteQueue QueueLength Queue See Tuning
Length Execute
Queues for
QueueLengthThresholdPercent Queue Overflow
Length Conditions.
ThreadsIncrease
Threshold
ThreadsMaximum
Percent
Threads
Maximum
Thread
Priority
Server StuckThreadMaxTime Stuck See Tuning the
Thread Execute
StuckThreadTimerInterval
Max Time Thread
Detection
Stuck Behavior.
Thread
Timer
Interval
Server ThreadPoolPercentSocketReaders Socket See Allocating
Readers Execute
Threads to Act
as Socket
Readers.
Server AcceptBacklog Accept See Tuning
Backlog Connection
Backlog
Buffering.
JDBCConnectionPool InitialCapacity Initial See How
Capacity JDBC
MaxCapacity
Connection
Max Pools Enhance
Capacity Performance.
JDBCConnectionPool StatementCacheSize Statement See Caching
Cache Size Prepared and
Callable
Statements.
Tuning Parameter
Execute Queue: ThreadCount 15 threads 25 threads
JDBC Connection Pool: MaxCapacity 15 connections 25 connections
The tuning defaults discussed in throughout WebLogic Performance and Tuning Guide
refer to the "development mode" defaults, which is the default startup mode when
WebLogic Server is installed. For information on switching the startup mode from
development to production, see Changing the Runtime Mode in the Administration
Console Online Help.
For a complete listing of the differences between development and production startup
modes, see the "Differences Between Configuration Startup Modes" section in Creating
WebLogic Configurations Using the Configuration Wizard.
Benchmarks show major performance improvements when you use native performance
packs on machines that host WebLogic Server instances. Performance packs use a
platform-optimized, native socket multiplexor to improve server performance. For
example, the native socket reader multiplexor threads have their own execute queue and
do not borrow threads from the default execute queue, which frees up default execute
threads to do application work.
However, if you must use the pure-Java socket reader implementation for host machines,
you can still improve the performance of socket communication by configuring the
proper number of socket reader threads for each server instance and client machine.
2. From the list of supported configurations, click on the link for the platform that
you need.
The ensuing page contains tables of information for each supported WebLogic
Server releases (including service packs). Within each release table there is a
"Performance Pack" entry that indicates whether a performance pack is
"Included" in the release.
The use of native performance packs are enabled by default in the config.xml shipped
with your distribution. To verify this setting in your configuration file, check that the
NativeIOEnabled attribute of the Server element is set to "true"
(NativeIOEnabled=true).
You can also use the Administration Console to verify that performance packs are
enabled:
3. Expand the Servers node in the left pane to display the servers configured in your
domain.
4. Click the name of the server instance that you want to configure.
6. If the Enable Native IO check box is not selected, select the check box.
7. Click Apply.
Note: If native performance packs are not being used for your platform, you may need to
tune the default number of execute queue threads and the percentage of threads that act as
socket readers to achieve optimal performance. For more information, see Allocating
Execute Threads to Act as Socket Readers.
Adding more threads to the default execute queue does not necessarily imply that you can
process more work. Even if you add more threads, you are still limited by the power of
your processor. Because threads consume memory, you can degrade performance by
increasing the value of the ThreadCount attribute unnecessarily. A high execute thread
count causes more memory to be used and increases context switching, which can
degrade performance.
The value of the ThreadCount attribute depends very much on the type of work your
application does. For example, if your client application is thin and does a lot of its work
through remote invocation, that client application will spend more time connected — and
thus will require a higher thread count — than a client application that does a lot of
client-side processing.
If you do not need to use more than 15 threads (the development default) or 25 threads
(the production default) for your work, do not change the value of this attribute. As a
general rule, if your application makes database calls that take a long time to return, you
will need more execute threads than an application that makes calls that are short and turn
over very rapidly. For the latter case, using a smaller number of execute threads could
improve performance.
To determine the ideal thread count for an execute queue, monitor the queue's throughput
while all applications in the queue are operating at maximum load. Increase the number
of threads in the queue and repeat the load test until you reach the optimal throughput for
the queue. (At some point, increasing the number of threads will lead to enough context
switching that the throughput for the queue begins to decrease.)
Note: The WebLogic Server Administration Console displays the cumulative throughput
for all of a server's execute queues. To access this throughput value, follow steps 1-6 in
Modifying the Default Thread Count.
Table 4-3 shows default scenarios for adjusting available threads in relation to the
number of CPUs available in the WebLogic Server domain. These scenarios also assume
that WebLogic Server is running under maximum load, and that all thread requests are
satisfied by using the default execute queue. If you configure additional execute queues
and assign applications to specific queues, monitor results on a pool-by-pool basis.
Table 4-3 Results Do This:
Scenarios for
Modifying the
Default Thread
Count
When...
Thread Count < Your thread count is too Increase the thread count.
number of CPUs low if:
CPU is waiting to
do work, but there
is work that could
be done.
3. Expand the Servers node in the left pane to display the servers configured in your
domain.
4. Right-click the name of the server instance that contains the execute queue you
want to configure, and then select View Execute Queues on the pop-up menu to
display a table of execute queues that can be modified.
Note: You can only modify the default execute queue for the server or a user-
defined execute queue.
5. In the Name column, click directly on the default execute queue name to display
the Configuration tab for modifying execute queues.
6. Locate the Thread Count value and increase or decrease it, as appropriate.
8. Reboot the selected server to enable the new execute queue settings.
Although you can configure the default execute queue to supply the optimal number
threads for all WebLogic Server applications, configuring multiple execute queues can
provide additional control for key applications. By using multiple execute queues, you
can guarantee that selected applications have access to a fixed number of execute threads,
regardless of the load on WebLogic Server. See Using Execute Queues to Control Thread
Usage for more information on assigning applications to configured execute queues.
For best socket performance, BEA recommends that you use the native socket reader
implementation, rather than the pure-Java implementation, on machines that host
WebLogic Server instances (see Using WebLogic Server "Native IO" Performance
Packs). However, if you must use the pure-Java socket reader implementation for host
machines, you can still improve the performance of socket communication by
configuring the proper number of execute threads to act as socket reader threads for each
server instance and client machine.
Allocating execute threads to act as socket reader threads increases the speed and the
ability of the server to accept client requests. It is essential to balance the number of
execute threads that are devoted to reading messages from a socket and those threads that
perform the actual execution of tasks in the server.
To use the Administration Console to set the maximum percentage of execute threads
that read messages from a socket:
3. Expand the Servers node in the left pane to display the servers configured in your
domain.
6. Edit the percentage of Java reader threads in the Socket Readers attribute field.
The number of Java socket readers is computed as a percentage of the number of
total execute threads (as shown in the Thread Count field for the Execute Queue).
On client machines, you can configure the number of available socket reader threads in
the JVM that runs the client. Specify the socket readers by defining the following
parameters in the java command line for the client:
-Dweblogic.ThreadPoolSize=value
-Dweblogic.ThreadPoolPercentSocketReaders=value
You can configure WebLogic Server to detect and optionally address potential overflow
conditions in the default execute queue or any user-defined execute queue. WebLogic
Server considers a queue to have a possible overflow condition when its current size
reaches a user-defined percentage of its maximum size. When this threshold is reached,
the server changes its health state to "warning" and can optionally allocate additional
threads to perform the outstanding work in the queue, thereby reducing its size.
To automatically detect and address overflow conditions in a queue, you configure the
following items:
The threshold at which the server indicates an overflow condition. This value is
set as a percentage of the configured size of the execute queue (the QueueLength
value).
The number of threads to add to the execute queue when an overflow condition is
detected. These additional threads work to reduce the size of the queue to its
normal operating size.
The maximum number of threads available to the queue. In particular, setting the
maximum number of threads prevents the server from assigning an overly high
thread count in response to overload conditions.
3. Expand the Servers node in the left pane to display the servers configured in your
domain.
4. Right-click the name of the server instance that contains the execute queue you
want to configure, and then select View Execute Queues from the pop-up menu to
display a table of execute queues that can be modified.
Note: You can only modify the default execute queue for the server or a user-
defined execute queue.
5. In the Name column, directly click the default execute queue name (or the user-
defined execute queue) that you want to configure.
6. On the execute queue Configuration tab, specify how the server instance should
detect an overflow condition for the selected queue by modifying the following
attributes:
• Queue Length: Specifies the maximum number of simultaneous requests
that the server can hold in the queue. The default of 65536 requests
represents a very large number of requests; outstanding requests in the
queue should rarely, if ever reach this maximum value. Always leave the
Queue Length at the default value of 65536 entries.
• Queue Length Threshold Percent: The percentage (from 1-99) of the
Queue Length size that can be reached before the server indicates an
overflow condition for the queue. All actual queue length sizes below the
threshold percentage are considered normal; sizes above the threshold
percentage indicate an overflow. By default, the Queue Length Threshold
Percent is set to 90 percent.
• Thread Priority: The priority of the threads associated with the queue.
By default, the Thread Priority is set to 5.
7. To specify how this server should address an overflow condition for the selected
queue, modify the following attribute:
• Threads Increase: The number of threads WebLogic Server should add
to this execute queue when it detects an overflow condition. If you specify
zero threads (the default), the server changes its health state to "warning"
in response to an overflow condition in the execute queue, but it does not
allocate additional threads to reduce the workload.
8. To limit the maximum number of threads that can be added to the selected queue,
modify the following attribute:
• Threads Maximum: The maximum number of threads that this execute
queue can have; this value prevents WebLogic Server from creating an
overly high thread count in the queue in response to continual overflow
conditions. By default, Threads Maximum is set to 400.
10. Reboot the selected server to enable the new execute queue settings.
If all threads in the default queue become stuck, the server changes its health state
to "critical." (You can set up the Node Manager application to automatically shut
down and restart servers in the critical health state. For more information, see
"Node Manager Capabilities" in Configuring and Managing WebLogic Server.)
If all threads in weblogic.admin.HTTP, weblogic.admin.RMI, or a user-defined
execute queue become stuck, the server changes its health state to "warning."
WebLogic Server diagnoses a thread as stuck if it is continually working (not idle) for a
set period of time. You can tune a server's thread detection behavior by changing the
length of time before a thread is diagnosed as stuck, and by changing the frequency with
which the server checks for stuck threads.
Note: Although you can change the criteria WebLogic Server uses to determine whether
a thread is stuck, you cannot change the default behavior of setting the "warning" and
"critical" health states when all threads in a particular execute queue become stuck. For
more information, see Overview of WebLogic Logging Services.
3. Expand the Servers node in the left pane to display the servers configured in your
domain.
4. Click the name of the server instance that you want to modify for improved stuck
thread detection.
6. Modify the following attributes as necessary to tune thread detection behavior for
the server:
• Stuck Thread Max Time: Enter the number of seconds, that a thread
must be continually working before this server diagnoses the thread as
being stuck. By default, WebLogic Server considers a thread to be "stuck"
after 600 seconds of continuous use.
• Stuck Thread Timer Interval: Enter the number of seconds, after
which WebLogic Server periodically scans threads to see if they have
been continually working for the length of time specified by Stuck
Thread Max Time. By default, WebLogic Server sets this interval to 600
seconds.
Use the AcceptBacklog attribute of the Server element in the config.xml file to set the
number of connection requests the WebLogic Server instance will accept before refusing
additional requests. The AcceptBacklog attribute specifies how many Transmission
Control Protocol (TCP) connections can be buffered in a wait queue. This fixed-size
queue is populated with requests for connections that the TCP stack has received, but the
application has not accepted yet. The default value is 50 and the maximum value is
operating system dependent.
3. Expand the Servers node in the left pane to display the servers configured in your
domain.
4. Click the name of the server instance that you want to configure.
6. Modify the default Accept Backlog value as necessary to tune how many TCP
connections can be buffered in a wait queue:
• During operations, if many connections are dropped or refused at the
client, and no other error messages are on the server, the Accept Backlog
value might be set too low.
• If you are getting "connection refused" messages when you try to access
WebLogic Server, raise the Accept Backlog value from the default by 25
percent. Continue increasing the value by 25 percent until the messages
cease to appear.
7. Click Apply to save your changes.
Establishing a JDBC connection with a DBMS can be very slow. If your application
requires database connections that are repeatedly opened and closed, this can become a
significant performance issue. WebLogic connection pools offer an efficient solution to
the problem.
When WebLogic Server starts, connections from the connection pools are opened and are
available to all clients. When a client closes a connection from a connection pool, the
connection is returned to the pool and becomes available for other clients; the connection
itself is not closed. There is little cost to opening and closing pool connections.
How many connections should you create in the pool? A connection pool can grow and
shrink according to configured parameters, between a minimum and a maximum number
of connections. The best performance occurs when the connection pool has as many
connections as there are concurrent client sessions.
The MaxCapacity attribute of the JDBCConnectionPool element allows you to set the
maximum number of physical database connections that a connection pool can contain.
Different JDBC drivers and database servers might limit the number of possible physical
connections.
The default settings for development and production mode are equal to the default
number of execute threads: 15 for development mode; 25 for production mode. However,
in production, it is advisable that the number of connections in the pool equal the number
of concurrent client sessions that require JDBC connections. The pool capacity is
independent of the number of execute threads in the server. There may be many more
ongoing user sessions than there are execute threads.
When you use a prepared statement or callable statement in an application or EJB, there
is considerable processing overhead for the communication between the application
server and the database server and on the database server itself. To minimize the
processing costs, WebLogic Server can cache prepared and callable statements used in
your applications. When an application or EJB calls any of the statements stored in the
cache, WebLogic Server reuses the statement stored in the cache. Reusing prepared and
callable statements reduces CPU usage on the database server, improving performance
for the current statement and leaving CPU cycles for other tasks. For more details, see
"Increasing Performance with the Statement Cache" in the Administration Console
Online Help.
Using the statement cache can dramatically increase performance, but you must consider
its limitations before you decide to use it. For more details, see "Usage Restrictions for
the Statement Cache" in the Administration Console Online Help.
The standard Java compiler for compiling JSP servlets is javac. You can improve
performance significantly by setting your server's java compiler to sj or jikes instead of
javac. The following sections discuss this procedure and other compiler considerations.
3. Expand the Servers node in the left pane to display the servers configured in your
domain.
4. Click the name of the server instance that you want to configure.
5. Select the Configuration —> General tab and enter the full path of the compiler in
the Java Compiler field. For example:
c:\visualcafe31\bin\sj.exe
7. Enter the full path to the JRE rt.jar library in the Append to the Classpath field.
For example:
BEA_HOME\jdk141_02\jre\lib\rt.jar
8. Click Apply.
9. Restart your server for the new Java Compiler and Append to Classpath values to
take effect.
In the weblogic.xml file, the jsp-descriptor element defines parameter names and
values for servlet JSPs.
Use the compileCommand parameter to specify the Java compiler for compiling
the generated JSP servlets.
Use the precompile parameter to configure WebLogic Server to precompile your
JSPs when WebLogic Server starts up.
For more information about setting your server's java compiler in the weblogic.xml file,
see the jsp-descriptor element.
Use the weblogic.appc utility to compile EJB 2.0 and 1.1 container classes. If you
compile Jar files for deployment into the EJB container, you must use weblogic.appc
to generate the container classes. By default, ejbc uses the javac compiler. For faster
performance, specify a different compiler (such as Symantec sj) using the -compiler
flag.
Compiling on UNIX
If you receive the following error message received when compiling JSP files on a UNIX
machine:
Use the -native flag to use native threads when starting the JVM.
Using WebLogic Server Clusters to Improve Performance
A domain can include multiple WebLogic Server clusters and non-clustered WebLogic
Server instances. Clustered WebLogic Server instances within a domain behave similarly
to non-clustered instances, except that they provide failover and load balancing. The
Administration Server for the domain manages all the configuration parameters for the
clustered and non-clustered instances.
For more information about clusters, see "Introduction to WebLogic Server Clustering".
Scalability is the ability of a system to grow in one or more dimensions as more resources
are added to the system. Typically, these dimensions include (among other things), the
number of concurrent users that can be supported and the number of transactions that can
be processed in a given unit of time.
Caution: Provided that you have resolved all application and environment bottleneck
issues, adding additional servers to a cluster should provide linear scalability. When
doing benchmark or initial configuration test runs, isolate issues in a single server
environment before moving to a clustered environment.
How to Ensure Scalability for WebLogic Clusters
In general, any operation that requires communication between the servers in a cluster is
a potential scalability hindrance. The following sections provide information on issues
that impact the ability to linearly scale clustered WebLogic servers:
Database Bottlenecks
Session Replication
Invalidation of Entity EJBs
Invalidation of HTTP sessions
JNDI Binding, Unbinding and Rebinding
Database Bottlenecks
In many cases where a cluster of WebLogic servers fails to scale, the database is the
bottleneck. In such situations, the only solutions are to tune the database or reduce load
on the database by exploring other options. See JDBC Application Tuning.
Session Replication
User session data can be stored in two standard ways in a J2EE application: stateful
session EJBs or HTTP sessions. By themselves, they are rarely a impact cluster
scalability. However, when coupled with a session replication mechanism required to
provide high-availability, bottlenecks are introduced. If a J2EE application has Web and
EJB components, you should store user session data in HTTP sessions rather than stateful
session EJBs as HTTP session management provides more replication options than
stateful session EJBs. See Managing Sessions.
This applies to entity EJBs that use a concurrency strategy of Optimistic or ReadOnly
with a read-write pattern.
ReadOnly with a read-write pattern—In this pattern, persistent data that would otherwise
be represented by a single EJB are actually represented by two EJBs: one read-only and
the other updateable. When the state of the updateable bean changes, the container
automatically invalidates corresponding read-only EJB instance. If updates to the EJBs
are frequent, the work done by the servers to invalidate the read-only EJBs becomes a
serious bottleneck.
Invalidation of HTTP sessions
Similar to Invalidation of Entity EJBs, HTTP sessions can also be invalidated. This is not
as expensive as entity EJB invalidation, since only the session data stored in the
secondary server needs to be invalidated. BEA advises users to not invalidate sessions
unless absolutely required.
In general, JNDI binds, unbinds and rebinds are expensive operations. However, these
operations become a bigger bottleneck in clustered environments because JNDI tree
changes have to be propagated to all members of a cluster. If such operations are
performed too frequently, they can reduce cluster scalability significantly.
With multi-processor machines, additional consideration must be given to the ratio of the
number of available CPUs to clustered WebLogic Server instances. Because WebLogic
Server has no built-in limit to the number of server instances that reside in a cluster,
large, multi-processor servers, such as Sun Microsystems' Sun Enterprise 10000, can
potentially host very large clusters or multiple clusters.
In order to determine the optimal ratio of CPUs to WebLogic server instances, you must
first ensure that an application is truly CPU-bound, rather than network or disk I/O-
bound. Use the following steps to determine the optional ratio of CPUs to server
instances:
3. Begin performance tests using a ratio of one WebLogic Server instance for every
available CPU.
The tool for monitoring the health and performance of your WebLogic Server domain is
the Administration Console. Using the Administration Console, you can view status and
statistics for WebLogic Server resources such as servers, HTTP, the JTA subsystem,
JNDI, security, CORBA connection pools, EJB, JDBC, and JMS.
For more details, see "Monitoring a WebLogic Server Domain in Configuring and
Managing WebLogic Server.
For example, there is a Server —> Monitoring —> Performance tab on the
Administration Console that provides performance metrics related to pending and
processed requests for the current server instance. It includes the following information:
On Linux
1. Reserve memory to be used for large pages by executing the following
command:
You should do this step as soon as possible after the machine has been
started since ongoing memory usage creates fragmentation and Linux
might be unable to allocate the number of specified pages.
2. Grant the user executing the Java application read and write permission to
the file system. You can do this with either the mount command or with the
chmod and chown commands.
For a more thorough description of large pages on Linux, read the file
vm/hugetlbpage.txt available in the documentation for the Linux kernel.
Setting Up WebLogic Server for HTTP Tunneling
HTTP tunneling provides a way to simulate a stateful socket connection
between WebLogic Server and a Java client when your only option is to use the
HTTP protocol. It is generally used to tunnel through an HTTP port in a security
firewall. HTTP is a stateless protocol, but WebLogic Server provides tunneling
functionality to make the connection appear to be a regular T3Connection.
However, you can expect some performance loss in comparison to a normal
socket connection.
When an HTTP tunnel connection is set up, the client automatically sends a
request to the server, so that the server may volunteer a response to the
client. The client may also include instructions in a request, but this
behavior happens regardless of whether the client application needs to
communicate with the server. If the server does not respond (as part of the
application code) to the client request within the number of seconds set in
this attribute, it does so anyway. The client accepts the response and
automatically sends another request immediately.
Default is 45 seconds; valid range is 20 to 900 seconds.
Tunneling Client Timeout
If the number of seconds set in this attribute have elapsed since the client
last sent a request to the server (in response to a reply), then the server
regards the client as dead, and terminates the HTTP tunnel connection. The
server checks the elapsed time at the interval specified by this attribute,
when it would otherwise respond to the client's request.
Default is 40 seconds; valid range is 10 to 900 seconds.
Configure Clusters
A cluster is a group of WebLogic Server instances that work together to provide
scalability and high-availability for applications. This window is displayed only if your
domain contains at least one Managed Server.
The Configure Clusters window prompts you to configure the clusters in your domain.
This step is optional.
To configure clusters:
1. Review the current list of cluster configurations. Default values may vary,
based on the domain source you selected earlier.
Note: The wizard provides two views: a concise tabular view of all the
clusters and an individual view of each cluster, where each cluster is
represented by a tab—you switch between clusters by selecting the
corresponding tab. To toggle the display mode between table and tab formats,
click Switch Display.
Note: If you are creating a domain that includes Service Bus functionality,
you can configure only one cluster per domain.
In this Enter a . . .
field . . .
Name* Valid cluster name: a string of characters that can include spaces.
The name of the cluster must be unique among all component
names within the domain.
The default value in this field is new_Cluster_n, where n specifies
a numeric value that is used to differentiate among all default
cluster names; the value of n for the first cluster is 1. The value is
incremented by 1 for each cluster that is added.
Multicast Multicast address for the cluster. This address is used by cluster
address members to communicate with each other. The default value is
239.192.0.0.
Valid multicast addresses are any valid IP addresses from
224.0.0.1 to 239.255.255.255.
Multicast Multicast port for the cluster. The multicast port is used by cluster
port members to communicate with each other. The default value is
7001.
Valid values for multicast ports are from 1 to 65534.
Cluster Cluster address that identifies the Managed Servers in the cluster.
address
A cluster address can be one of the following:
Comma-separated list of IP addresses or DNS
names and ports, for example: dns_name:port,
dns_name:port
DNS name that maps to multiple IP addresses
localhost, DNS name, or IP address if the listen
address of all Managed Servers is listening to the same
address with unique port numbers
The cluster address is used in entity and stateless EJBs to construct
the host name portion of URLs. If the cluster address is not set,
EJB handles may not work properly.
Web applications can consist of different types of objects, including Enterprise Java
Beans (EJBs), servlets, and Java Server Pages (JSPs). Each object type has a unique set
of behaviors related to control, invocation, and how it functions within an application.
For this reason, the methods that WebLogic Server uses to support clustering—and hence
to provide load balancing and failover—can vary for different types of objects. The
following types of objects can be clustered in a WebLogic Server deployment:
Servlets
JSPs
EJBs
Remote Method Invocation (RMI) objects
Java Messaging Service (JMS) destinations
Java Database Connectivity (JDBC) connections
Different object types can have certain behaviors in common. When this is the case, the
clustering support and implementation considerations for those similar object types may
be same. In the sections that follow, explanations and instructions for the following types
of objects are generally combined:
The sections that follow briefly describe the clustering, failover, and load balancing
support that WebLogic Server provides for different types of objects.
WebLogic Server provides clustering support for servlets and JSPs by replicating the
HTTP session state of clients that access clustered servlets and JSPs. WebLogic Server
can maintain HTTP session states in memory, a filesystem, or a database.
To enable automatic failover of servlets and JSPs, session state must persist in memory.
For information about how failover works for servlets and JSPs, and for related
requirements and programming considerations, see HTTP Session State Replication.
You can balance the servlet and JSP load across a cluster using a WebLogic Server proxy
plug-in or external load balancing hardware. WebLogic Server proxy plug-ins perform
round robin load balancing. External load balancers typically support a variety of session
load balancing mechanisms. For more information, see Load Balancing for Servlets and
JSPs.
Load balancing and failover for EJBs and RMI objects is handled using replica-aware
stubs, which can locate instances of the object throughout the cluster. Replica-aware
stubs are created for EJBs and RMI objects as a result of the object compilation process.
EJBs and RMI objects are deployed homogeneously—to all the server instances in the
cluster.
Failover for EJBs and RMI objects is accomplished using the object's replica-aware stub.
When a client makes a call through a replica-aware stub to a service that fails, the stub
detects the failure and retries the call on another replica. To understand failover support
for different types of objects, see Replication and Failover for EJBs and RMIs.
WebLogic Server clusters support multiple algorithms for load balancing clustered EJBs
and RMI objects: round-robin, weight-based, random, round-robin-affinity, weight-
based-affinity, and random-affinity. By default, a WebLogic Server cluster will use the
round-robin method. You can configure a cluster to use one of the other methods using
the Administration Console. The method you select is maintained within the replica-
aware stub obtained for clustered objects. For details, see Load Balancing for EJBs and
RMI Objects.
JDBC Connections
WebLogic Server allows you to cluster JDBC objects, including data sources and multi
data sources, to improve the availability of cluster-hosted applications. Each JDBC object
you configure for your cluster must exist on each managed server in the cluster—when
you configure the JDBC objects, target them to the cluster.
For more information about JDBC, see Configuring WebLogic JDBC Resources in the
Configuring and Managing WebLogic JDBC.
Load balancing is supported for JMS. To enable load balancing, you must configure
targets for JMS servers. For more information about load balancing and JMS
components, see Load Balancing for JMS. For instructions on setting up clustered JMS,
see Configure Migratable Targets for Pinned Services and Deploying, Activating, and
Migrating Migratable Services.
The following APIs and internal services cannot be clustered in WebLogic Server:
You can still use these services on individual WebLogic Server instances in a cluster.
However, the services do not make use of load balancing or failover features.
WebLogic Server instances in a cluster communicate with one another using two basic
network technologies:
The way in which WebLogic Server uses IP multicast and socket communication affects
the way you configure your cluster.
Note: The default multicast value used by WebLogic Server is 239.192.0.0. You should
not use any multicast address within the range x.0.0.1.
IP multicast broadcasts messages to applications, but it does not guarantee that messages
are actually received. If an application's local multicast buffer is full, new multicast
messages cannot be written to the buffer and the application is not notified when
messages are "dropped." Because of this limitation, WebLogic Server instances allow for
the possibility that they may occasionally miss messages that were broadcast over IP
multicast.
WebLogic Server uses IP multicast for all one-to-many communications among server
instances in a cluster. This communication includes:
Cluster-wide JNDI updates—Each WebLogic Server instance in a cluster
uses multicast to announce the availability of clustered objects that are deployed
or removed locally. Each server instance in the cluster monitors these
announcements and updates its local JNDI tree to reflect current deployments of
clustered objects. For more details, see Cluster-Wide JNDI Naming Service.
Cluster heartbeats— Each WebLogic Server instance in a cluster uses
multicast to broadcast regular "heartbeat" messages that advertise its availability.
By monitoring heartbeat messages, server instances in a cluster determine when a
server instance has failed. (Clustered server instances also monitor IP sockets as a
more immediate method of determining when a server instance has failed.)
In many deployments, clustered server instances reside within a single subnet, ensuring
multicast messages are reliably transmitted. However, you may want to distribute a
WebLogic Server cluster across multiple subnets in a Wide Area Network (WAN) to
increase redundancy, or to distribute clustered server instances over a larger geographical
area.
If you choose to distribute a cluster over a WAN (or across multiple subnets), plan and
configure your network topology to ensure that multicast messages are reliably
transmitted to all server instances in the cluster. Specifically, your network must meet the
following requirements:
Note: Distributing a WebLogic Server cluster over a WAN may require network facilities
in addition to the multicast requirements described above. For example, you may want to
configure load balancing hardware to ensure that client requests are directed to server
instances in the most efficient manner (to avoid unnecessary network hops).
Although it may be possible to tunnel multicast traffic through a firewall, this practice is
not recommended for WebLogic Server clusters. Treat each WebLogic Server cluster as a
logical unit that provides one or more distinct services to clients of a Web application. Do
not split this logical unit between different security zones. Furthermore, any technologies
that potentially delay or interrupt IP traffic can disrupt a WebLogic Server cluster by
generating false failures due to missed heartbeats.
Although multiple WebLogic Server clusters can share a single IP multicast address and
port, other applications should not broadcast or subscribe to the multicast address and
port used by your cluster or clusters. That is, if the machine or machines that host your
cluster also host other applications that use multicast communications, make sure that
those applications use a different multicast address and port than the cluster does.
Sharing the cluster multicast address with other applications forces clustered server
instances to process unnecessary messages, introducing overhead. Sharing a multicast
address may also overload the IP multicast buffer and delay transmission of WebLogic
Server heartbeat messages. Such delays can result in a WebLogic Server instance being
marked as failed, simply because its heartbeat messages were not received in a timely
manner.
For these reasons, assign a dedicated multicast address for use by WebLogic Server
clusters, and ensure that the address can support the broadcast traffic of all clusters that
use the address.
Note: The use of IP sockets in WebLogic Server extends beyond the cluster scenario—all
RMI communication takes place using sockets, for example, when a remote Java client
application accesses a remote object.
Proper socket configuration is crucial to the performance of a WebLogic Server cluster.
Two factors determine the efficiency of socket communications in WebLogic Server:
You must package applications before you deploy them to WebLogic Server. For more
information, see the packaging topic in Deploying the Application in Developing
Applications for WebLogic Server.
Deploy Applications
The console automates deploying replica-aware objects to clusters. When you deploy an
application or object to a cluster, the console automatically deploys it to all members of
the cluster (whether they are local to the Administration Server machine or they reside on
remote machines.) For a discussion of application deployment in clustered environments
see Methods of Configuring Clusters. For a broad discussion of deployment topics, see
Deploying WebLogic Server Applications.
Note: All server instances in your cluster should be running when you deploy
applications to the cluster using the Administration Console
You can perform a pinned deployment using the Administration Console or from the
command line, using weblogic.Deployer.
From a command shell, use the following syntax to target a server instance:
From a command shell, use the following syntax to cancel the deployment task ID:
In the Administration Console, open the Tasks node to view and to cancel any current
deployment tasks.
This following sections explain how the information that defines the configuration of a
cluster is stored and maintained, and the methods you can use to accomplish
configuration tasks:
The Administration Server is the WebLogic Server instance that configures and manages
the WebLogic Server instances in its domain.
A domain can include multiple WebLogic Server clusters and non-clustered WebLogic
Server instances. Strictly speaking, a domain could consist of only one WebLogic Server
instance—however, in that case that sole server instance would be an Administration
Server, because each domain must have exactly one Administration Server.
There are a variety of ways to invoke the services of the Administration Server to
accomplish configuration tasks, as described in Methods of Configuring Clusters.
Whichever method is used, the Administration Server for a cluster must be running when
you modify the configuration.
When the Administration Server starts, it loads the config.xml for the domain. It looks
for config.xml in the directory:
BEA_HOME/user_projects/domains/<domain_name>/config
where domain_name is a domain-specific directory, with the same name as the domain.
Each time the Administration Server starts successfully, a backup configuration file
named config.xml.booted is created in the domain directory. In the unlikely event that
the config.xml file should be corrupted during the lifetime of the server instance, it is
possible to revert to this previous configuration.
The following figure shows a typical production environment that contains an
Administration Server and multiple WebLogic Servers instances. When you start the
server instances in such a domain, the Administration Server is started first. As each
additional server instance is started, it contacts the Administration Server for its
configuration information. In this way, the Administration Server operates as the central
control entity for the configuration of the entire domain.
The failure of an Administration Server for a domain does not affect 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. 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.
WebLogic Server allows you to change the configuration attributes of domain resources
dynamically—while server instances are running. In most cases you do not need to restart
the server instance for your changes to take effect. When an attribute is reconfigured, the
new value is immediately reflected in both the current run-time value of the attribute and
the persistent value stored in config.xml.
Not all configuration changes are applied dynamically. For example, if you change a
Managed Server's ListenPort value, the new port will not be used until the next time
you start the Managed Server. The updated value is stored in config.xml, but the
runtime value is not affected.
The Administration Console validates attribute changes, checking for out-of-range errors
and data type mismatch errors, and displays an error message for erroneous entries.
Once the Administration Console has been started, if another process captures the listen
port assigned to the Administration Server, you should stop the process that captured the
port. If you are not able to remove the process that captured the listen port, edit the
config.xml file to change the ListenPort value.
You can write a program to modify the configuration attributes, based on the
configuration application programming interface (API) provided with
WebLogic Server. This method is not recommended for initial cluster
implementation.
WebLogic Scripting Tool (WLST)
The Domain Configuration Wizard uses pre-configured domain templates to ease the
process of creating a domain and its server instances. Using the wizard, you can select a
domain template, and then supply key information, such as machine addresses, names,
and port numbers for the server instances you wish to created.
Note: The Domain Configuration Wizard can install the appropriate directory structure
and scripts for a domain on a Managed Server that is running on a remote machine from
the Administration Server. This is helpful if you need to use a Managed Server as a
backup Administration Server for a domain.
The wizard prompts you to select one of four typical domain configurations:
After you select the desired configuration type, the wizard prompts you to provide
relevant details about the domain and its server instances.
For information on how to use the Domain Configuration Wizard, see Creating
WebLogic Domains Using the Configuration Wizard.
Servers
Clusters
Deploying Applications and Modules
Monitoring a Server
Monitoring a Cluster"
This section describes the load balancing support that a WebLogic Server cluster
provides for different types of objects, and related planning and configuration
considerations for architects and administrators. It contains the following information:
For information about replication and failover in a cluster, see Failover and Replication in
a Cluster.
Load balancing of servlets and JSPs can be accomplished with the built-in load balancing
capabilities of a WebLogic proxy plug-in or with separate load balancing hardware.
Note: In addition to distributing HTTP traffic, external load balancers can distribute
initial context requests that come from Java clients over t3 and the default channel. See
Load Balancing for EJBs and RMI Objects for a discussion of object-level load balancing
in WebLogic Server.
The WebLogic proxy plug-in maintains a list of WebLogic Server instances that host a
clustered servlet or JSP, and forwards HTTP requests to those instances on a round-robin
basis. This load balancing method is described in Round Robin Load Balancing.
The plug-in also provides the logic necessary to locate the replica of a client's HTTP
session state if a WebLogic Server instance should fail.
WebLogic Server supports the following Web servers and associated proxy plug-ins:
Clusters that utilize a hardware load balancing solution can use any load balancing
algorithm supported by the hardware. These can include advanced load-based balancing
strategies that monitor the utilization of individual machines.
SSL Persistence
When SSL persistence is used, the load balancer performs all encryption and
decryption of data between clients and the WebLogic Server cluster. The load
balancer then uses the plain text cookie that WebLogic Server inserts on the
client to maintain an association between the client and a particular server in
the cluster.
Load Balancers and the WebLogic Session Cookie
A load balancer that uses passive cookie persistence can use a string in the WebLogic
session cookie to associate a client with the server hosting its primary HTTP session
state. The string uniquely identifies a server instance in the cluster. You must configure
the load balancer with the offset and length of the string constant. The correct values for
the offset and length depend on the format of the session cookie.
sessionid!primary_server_id!secondary_server_id
where:
Note: For sessions using non-replicated memory, cookie, JDBC, or file-based session
persistence, the secondary_server_id is not present. For sessions that use in-memory
replication, if the secondary session does not exist, the secondary_server_id is
"NONE".
For general instructions on configuring load balancers, see Configuring Load Balancers
that Support Passive Cookie Persistence. Instructions for configuring BIG-IP, see
Configuring BIG-IPTM Hardware with Clusters.
This section describes WebLogic Server load balancing algorithms for EJBs and RMI
objects.
The load balancing algorithm for an object is maintained in the replica-aware stub
obtained for a clustered object.
By default, a WebLogic Server cluster uses round-robin load balancing, described in
Round Robin Load Balancing. You can configure a different default load balancing
method for the cluster by using the Administration Console to set
weblogic.cluster.defaultLoadAlgorithm. For instructions, see Configure Load
Balancing Method for EJBs and RMIs. You can also specify the load balancing algorithm
for a specific RMI object using the -loadAlgorithm option in rmic, or with the home-
load-algorithm or stateless-bean-load-algorithm in an EJB's deployment
descriptor. A load balancing algorithm that you configure for an object overrides the
default load balancing algorithm for the cluster.
In addition to the standard load balancing algorithms, WebLogic Server supports custom
parameter-based routing. For more information, see Parameter-Based Routing for
Clustered Objects.
WebLogic Server uses the round-robin algorithm as the default load balancing strategy
for clustered object stubs when no algorithm is specified. This algorithm is supported for
RMI objects and EJBs. It is also the method used by WebLogic proxy plug-ins.
The round-robin algorithm cycles through a list of WebLogic Server instances in order.
For clustered objects, the server list consists of WebLogic Server instances that host the
clustered object. For proxy plug-ins, the list consists of all WebLogic Server instances
that host the clustered servlet or JSP.
The advantages of the round-robin algorithm are that it is simple, cheap and very
predictable. The primary disadvantage is that there is some chance of convoying.
Convoying occurs when one server is significantly slower than the others. Because
replica-aware stubs or proxy plug-ins access the servers in the same order, a slow server
can cause requests to "synchronize" on the server, then follow other servers in order for
future requests.
Note: WebLogic Server does not always load balance an object's method calls. For more
information, see Optimization for Collocated Objects.
If you change the specified weight of a server and reboot it, the new weighting
information is propagated throughout the cluster via the replica-aware stubs. For related
information see Cluster-Wide JNDI Naming Service.
Notes: WebLogic Server does not always load balance an object's method calls. For more
information, see Optimization for Collocated Objects.
In this version of WebLogic Server, weight-based load balancing is not supported for
objects that communicate using the RMI/IIOP protocol.
The random method of load balancing applies only to EJB and RMI object clustering.
In random load balancing, requests are routed to servers at random. Random load
balancing is recommended only for homogeneous cluster deployments, where each server
instance runs on a similarly configured machine. A random allocation of requests does
not allow for differences in processing power among the machines upon which server
instances run. If a machine hosting servers in a cluster has significantly less processing
power than other machines in the cluster, random load balancing will give the less
powerful machine as many requests as it gives more powerful machines.
Random load balancing distributes requests evenly across server instances in the cluster,
increasingly so as the cumulative number of requests increases. Over a small number of
requests the load may not be balanced exactly evenly.
Disadvantages of random load balancing include the slight processing overhead incurred
by generating a random number for each request, and the possibility that the load may not
be evenly balanced over a small number of requests.
Note: WebLogic Server does not always load balance an object's method calls. For more
information, see Optimization for Collocated Objects.
WebLogic Server provides three load balancing algorithms for RMI objects that provide
server affinity. Server affinity turns off load balancing for external client connections:
instead, the client considers its existing connections to WebLogic server instances when
choosing the server instance on which to access an object. If an object is configured for
server affinity, the client-side stub attempts to choose a server instance to which it is
already connected, and continues to use the same server instance for method calls. All
stubs on that client attempt to use that server instance. If the server instance becomes
unavailable, the stubs fail over, if possible, to a server instance to which the client is
already connected.
The purpose of server affinity is to minimize the number IP sockets opened between
external Java clients and server instances in a cluster. WebLogic Server accomplishes this
by causing method calls on objects to "stick" to an existing connection, instead of being
load balanced among the available server instances. With server affinity algorithms, the
less costly server-to-server connections are still load-balanced according to the
configured load balancing algorithm—load balancing is disabled only for external client
connections.
Server affinity is used in combination with one of the standard load balancing methods:
round-robin, weight-based, or random:
round-robin-affinity
weight-based-affinity
random-affinity
Server affinity is supported for all types of RMI objects including JMS objects, all EJB
home interfaces, and stateless EJB remote interfaces.
The server affinity algorithms consider existing connections between an external Java
client and server instances in balancing the client load among WebLogic server instances.
Server affinity:
turns off load balancing between external Java clients and server instances
causes method calls from an external Java client to stick to a server
instance to which the client has an open connection, assuming that the connection
supports the necessary protocol and QOS
in the case of failure, causes the client to failover to a server instance to
which it has an open connection, assuming that the connection supports the
necessary protocol and QOS
does not affect the load balancing performed for server-to-server
connections
The following examples illustrate the effect of server affinity under a variety of
circumstances. In each example, the objects deployed are configured for round-robin-
affinity.
In this example, the client obtains context from the cluster. Lookups on the context and
object calls stick to a single connection. Requests for new initial context are load
balanced on a round-robin basis.
2. Client does a lookup on the context for Object A. The lookup goes to MS1.
3. Client issues a call to Object A. The call goes to MS1, to which the client is
already connected. Additional method calls to Object A stick to MS1.
5. Client does a lookup on the context for Object B. The call goes to MS2, to
which the client is already connected. Additional method calls to Object B stick to
MS2.
This example illustrates the effect that server affinity has on object failover. When a
Managed Server goes down, the client fails over to another Managed Server to which it
has a connection.
This example illustrates the fact that server affinity does not affect the connections
between server instances.
WebLogic Server always uses the local, collocated copy of Object A, rather than
distributing the client's calls to other replicas of Object A in the cluster. It is more
efficient to use the local copy, because doing so avoids the network overhead of
establishing peer connections to other servers in the cluster.
This optimization is often overlooked when planning WebLogic Server clusters. The
collocation optimization is also frequently confusing for administrators or developers
who expect or require load balancing on each method call. If your Web application is
deployed to a single cluster, the collocation optimization overrides any load balancing
logic inherent in the replica-aware stub.
If you require load balancing on each method call to a clustered object, see
Recommended Multi-Tier Architecture for information about how to plan your
WebLogic Server cluster accordingly.
Transactional Collocation
As an extension to the basic collocation strategy, WebLogic Server attempts to use
collocated clustered objects that are enlisted as part of the same transaction. When a
client creates a UserTransaction object, WebLogic Server attempts to use object
replicas that are collocated with the transaction. This optimization is depicted in the
figure below.
This transactional collocation strategy is even more important than the basic optimization
described in Optimization for Collocated Objects. If remote replicas of A and B were
used, added network overhead would be incurred for the duration of the transaction,
because the peer connections for A and B would be locked until the transaction
committed. Furthermore, WebLogic Server would need to employ a multi-tiered JDBC
connection to commit the transaction, incurring additional network overhead.
By using collocating clustered objects during a transaction, WebLogic Server reduces the
network load for accessing the individual objects. The server also can make use of a
single-tiered JDBC connection, rather than a multi-tiered connection, to do the work of
the transaction.
WebLogic Server JMS supports server affinity for distributed JMS destinations and client
connections.
By default, a WebLogic Server cluster uses the round-robin method to load balance
objects. To use a load balancing algorithm that provides server affinity for JMS objects,
you must configure the desired method for the cluster as a whole. You can configure the
load balancing algorithm by using the Administration Console to set
weblogic.cluster.defaultLoadAlgorithm. For instructions, see Configure Load
Balancing Method for EJBs and RMIs.
For detailed information on how the JMS connection factory's Server Affinity Enabled
option affects the load balancing preferences for distributed destination members, see
How Distributed Destination Load Balancing Is Affected When Using the Server Affinity
Enabled Attribute in Programming WebLogic JMS.
A system administrator can establish load balancing of JMS destinations across multiple
servers in a cluster by configuring multiple JMS servers and using targets to assign them
to the defined WebLogic Servers. Each JMS server is deployed on exactly one WebLogic
Server and handles requests for a set of destinations. During the configuration phase, the
system administrator enables load balancing by specifying targets for JMS servers. For
instructions on setting up targets, see Configure Migratable Targets for Pinned Services.
For instructions on deploying a JMS server to a migratable target, see Deploying,
Activating, and Migrating Migratable Services.
The application uses the Java Naming and Directory Interface (JNDI) to look up a
connection factory and create a connection to establish communication with a JMS
server. Each JMS server handles requests for a set of destinations. Requests for
destinations not handled by a JMS server are forwarded to the appropriate server.
WebLogic Server provides server affinity for client connections. If an application has a
connection to a given server instance, JMS will attempt to establish new JMS connections
to the same server instance.
When creating a connection, JMS will try first to achieve initial context affinity. It will
attempt to connect to the same server or servers to which a client connected for its initial
context, assuming that the server instance is configured for that connection factory. For
example, if the connection factory is configured for servers A and B, but the client has an
InitialContext on server C, then the connection factory will not establish the new
connection with A, but will choose between servers B and C.
If a connection factory cannot achieve initial context affinity, it will try to provide
affinity to a server to which the client is already connected. For instance, assume the
client has an InitialContext on server A and some other type of connection to server B. If
the client then uses a connection factory configured for servers B and C it will not
achieve initial context affinity. The connection factory will instead attempt to achieve
server affinity by trying to create a connection to server B, to which it already has a
connection, rather than server C.
If a connection factory cannot provide either initial context affinity or server affinity, then
the connection factory is free to make a connection wherever possible. For instance,
assume a client has an initial context on server A, no other connections and a connection
factory configured for servers B and C. The connection factory is unable to provide any
affinity and is free to attempt new connections to either server B or C.
Note: In the last case, if the client attempts to make a second connection using the same
connection factory, it will go to the same server as it did on the first attempt. That is, if it
chose server B for the first connection, when the second connection is made, the client
will have a connection to server B and the server affinity rule will be enforced.
Load balancing of JDBC connection requires the use of a multi data source configured
for load balancing. Load balancing support is an option you can choose when configuring
a multi data source.
A load balancing multi data source provides the high available behavior described in
Failover and JDBC Connections, and in addition, balances the load among the data
sources in the multi data source. A multi data source has an ordered list of data sources it
contains. If you do not configure the multi data source for load balancing, it always
attempts to obtain a connection from the first data source in the list. In a load-balancing
multi data source, the data sources it contains are accessed using a round-robin scheme.
In each successive client request for a multi data source connection, the list is rotated so
the first pool tapped cycles around the list.
WebLogic Server instances in a cluster detect failures of their peer server instances by
monitoring:
WebLogic Server instances monitor the use of IP sockets between peer server instances
as an immediate method of detecting failures. If a server connects to one of its peers in a
cluster and begins transmitting data over a socket, an unexpected closure of that socket
causes the peer server to be marked as "failed," and its associated services are removed
from the JNDI naming tree.
If a server monitoring the multicast address misses three heartbeats from a peer server
(i.e., if it does not receive a heartbeat from the server for 30 seconds or longer), the
monitoring server marks the peer server as "failed." It then updates its local JNDI tree, if
necessary, to retract the services that were hosted on the failed server.
In this way, servers can detect failures even if they have no sockets open for peer-to-peer
communication.
Note: For more information about how WebLogic Server uses IP sockets and multicast
communications see WebLogic Server Communication in a Cluster.
Cluster Architectures
This following sections describe alternative architectures for a WebLogic Server cluster:
Architecture
In this context the architecture refers to how the tiers of an application are deployed to
one or more clusters.
A Web application is divided into several "tiers" that correspond to the logical services
the application provides. Because not all Web applications are alike, your application
may not utilize all of the tiers described below. Also keep in mind that the tiers represent
logical divisions of an application's services, and not necessarily physical divisions
between hardware or software components. In some cases, a single machine running a
single WebLogic Server instance can provide all of the tiers described below.
Web Tier
The web tier provides static content (for example, simple HTML pages) to
clients of a Web application. The web tier is generally the first point of
contact between external clients and the Web application. A simple Web
application may have a web tier that consists of one or more machines
running WebLogic Express, Apache, Netscape Enterprise Server, or
Microsoft Internet Information Server.
Presentation Tier
The presentation tier provides dynamic content (for example, servlets or Java
Server Pages) to clients of a Web application. A cluster of WebLogic Server
instances that hosts servlets and/or JSPs comprises the presentation tier of a
web application. If the cluster also serves static HTML pages for your
application, it encompasses both the web tier and the presentation tier.
Object Tier
The object tier provides Java objects (for example, Enterprise JavaBeans or
RMI classes) and their associated business logic to a Web application. A
WebLogic Server cluster that hosts EJBs provides an object tier.
A cluster architecture in which all tiers of the Web application are deployed to a single
WebLogic Server cluster is called a combined tier architecture.
The De-Militarized Zone (DMZ) is a logical collection of hardware and services that is
made available to outside, untrusted sources. In most Web applications, a bank of Web
servers resides in the DMZ to allow browser-based clients access to static HTML content.
The DMZ may provide security against outside attacks to hardware and software.
However, because the DMZ is available to untrusted sources, it is less secure than an
internal system. For example, internal systems may be protected by a firewall that denies
all outside access. The DMZ may be protected by a firewall that hides access to
individual machines, applications, or port numbers, but it still permits access to those
services from untrusted clients.
Load Balancer
In this document, the term load balancer describes any technology that distributes client
connection requests to one or more distinct IP addresses. For example, a simple Web
application may use the DNS round-robin algorithm as a load balancer. Larger
applications generally use hardware-based load balancing solutions such as those from
Alteon WebSystems, which may also provide firewall-like security capabilities.
Load balancers provide the capability to associate a client connection with a particular
server in the cluster, which is required when using in-memory replication for client
session information. With certain load balancing products, you must configure the cookie
persistence mechanism to avoid overwriting the WebLogic Server cookie which tracks
primary and secondary servers used for in-memory replication. See For a discussion of
external load balancers, session cookie persistence, and the WebLogic Server session
cookie, see Load Balancing HTTP Sessions with an External Load Balancer on page 5-2
for more information.
Proxy Plug-In
The recommended basic architecture is a combined tier architecture—all tiers of the Web
application are deployed to the same WebLogic Server cluster. This architecture is
illustrated in the following figure.
Robust security
Placing a firewall in front of your load balancing hardware enables you to set
up a De-Militarized Zone (DMZ) for your web application using minimal
firewall policies.
Optimal performance
The combined tier architecture offers the best performance for applications in
which most or all of the servlets or JSPs in the presentation tier typically
access objects in the object tier, such as EJBs or JDBC objects
Note: When using a third-party load balancer with in-memory session replication, you
must ensure that the load balancer maintains a client's connection to the WebLogic Server
instance that hosts its primary session state (the point-of-contact server). For more
information about load balancers, see For a discussion of external load balancers, session
cookie persistence, and the WebLogic Server session cookie, see Load Balancing HTTP
Sessions with an External Load Balancer on page 5-2.
Because most load balancing and failover occurs between clients and the cluster itself, a
combined tier architecture meets the needs of most Web applications.
However, combined-tier clusters provide no opportunity for load balancing method calls
to clustered EJBs. Because clustered objects are deployed on all WebLogic Server
instances in the cluster, each object instance is available locally to each server. WebLogic
Server optimizes method calls to clustered EJBs by always selecting the local object
instance, rather than distributing requests to remote objects and incurring additional
network overhead.
This collocation strategy is, in most cases, more efficient than load balancing each
method request to a different server. However, if the processing load to individual servers
becomes unbalanced, it may eventually become more efficient to submit method calls to
remote objects rather than process methods locally.
To utilize load balancing for method calls to clustered EJBs, you must split the
presentation and object tiers of the Web application onto separate physical clusters, as
described in the following section.
Consider the frequency of invocations of the object tier by the presentation tier when
deciding between a combined tier and multi-tier architecture. If presentation objects
usually invoke the object tier, a combined tier architecture may offer better performance
than a multi-tier architecture.
This section describes the Recommended Multi-Tier Architecture, in which different tiers
of your application are deployed to different clusters.
The recommended multi-tier architecture uses two separate WebLogic Server clusters:
one to serve static HTTP content and clustered servlets, and one to serve clustered EJBs.
The multi-tier cluster is recommended for Web applications that:
Note: Consider the frequency of invocations from the presentation tier to the object tier
when considering a multi-tier architecture. If presentation objects usually invoke the
object tier, a combined tier architecture may offer better performance than a multi-tier
architecture.
In the Recommended Multi-Tier Architecture the application tiers are hosted on two
separate physical layers of hardware and software.
Web/Presentation Layer
Object Layer
The object layer consists of a cluster of WebLogic Server instances that hosts only
clustered objects—EJBs and RMI objects as necessary for the web application. By
hosting the object tier on a dedicated cluster, you lose the default collocation optimization
for accessing clustered objects described in Optimization for Collocated Objects.
However, you gain the ability to load balance on each method call to certain clustered
objects, as described in the following section.
Separating the presentation and object tiers onto separate clusters provides
more options for distributing the load of the web application. For example, if
the application accesses HTTP and servlet content more often than EJB
content, you can use a large number of WebLogic Server instances in the
presentation tier cluster to concentrate access to a smaller number of servers
hosting EJBs.
Higher Availability
By separating the presentation and object tiers onto separate clusters, you can
use a firewall policy that places only the servlet/JSP cluster in the DMZ.
Servers hosting clustered objects can be further protected by denying direct
access from untrusted clients. For more information, see Security Options for
Cluster Architectures.
The net effect of isolating the object tier is that no client (HTTP client, Java client, or
servlet) ever acquires a replica-aware stub on the same server that hosts the clustered
object. Because of this, WebLogic Server cannot use its collocation optimization
(described in Optimization for Collocated Objects), and servlet calls to clustered objects
are automatically load balanced according to the logic contained in the replica-aware
stub. The following figure depicts a client accessing a clustered EJB instance in the
multi-tier architecture.
The servlet looks up the EJB on the WebLogic Server cluster that hosts
clustered objects. The servlet obtains a replica-aware stub for the bean, which
lists the addresses of all servers that host the bean, as well as the load
balancing logic for accessing bean replicas.
Note: EJB replica-aware stubs and EJB home load algorithms are specified
using elements of the EJB deployment descriptor. See weblogic-ejb-jar.xml
Deployment Descriptor Reference in Programming WebLogic Enterprise
JavaBeans for more information.
4. When the servlet next accesses the EJB (for example, in response to
another client), it uses the load-balancing logic present in the bean's stub to locate
a replica. In the example above, multiple method calls are directed using the
round-robin algorithm for load balancing.
In this example, if the same WebLogic Server cluster hosted both servlets and EJBs (as in
the Recommended Basic Architecture), WebLogic Server would not load balance
requests for the EJB. Instead, the servlet would always invoke methods on the EJB
replica hosted on the local server. Using the local EJB instance is more efficient than
making remote method calls to an EJB on another server. However, the multi-tier
architecture enables remote EJB access for applications that require load balancing for
EJB method calls.
Configuration Considerations for Multi-Tier Architecture
IP Socket Usage
Because the multi-tier architecture provides load balancing for clustered object calls, the
system generally utilizes more IP sockets than a combined-tier architecture. In particular,
during peak socket usage, each WebLogic Server in the cluster that hosts servlets and
JSPs may potentially use a maximum of:
One socket for replicating HTTP session states between primary and
secondary servers, plus
One socket for each WebLogic Server in the EJB cluster, for accessing
remote objects
For example, in Figure 7-2, each server in the servlet/JSP cluster could potentially open a
maximum of five sockets. This maximum represents a worst-case scenario where primary
and secondary session states are equally dispersed throughout the servlet cluster, and
each server in the servlet cluster simultaneously accesses a remote object on each server
in the object cluster. In most cases, the number of sockets actual sockets in use would be
less than this maximum.
If you use a pure-Java sockets implementation with the multi-tier architecture, ensure that
you configure enough socket reader threads to accommodate the maximum potential
socket usage. For details, see Configuring Reader Threads for Java Socket
Implementation.
Because the multi-tier architecture uses a hardware load balancer, you must configure the
load balancer to maintain a "sticky" connection to the client's point-of-contact server if
you use in-memory session state replication. For details, see Configure Load Balancing
Method for EJBs and RMIs.
No Collocation Optimization
Because the Recommended Multi-Tier Architecture cannot optimize object calls using
the collocation strategy, the Web application incurs network overhead for all method
calls to clustered objects. This overhead may be acceptable, however, if your Web
application requires any of the benefits described in Benefits of Multi-Tier Architecture.
For example, if your Web clients make heavy use of servlets and JSPs but access a
relatively small set of clustered objects, the multi-tier architecture enables you to
concentrate the load of servlets and object appropriately. You may configure a servlet
cluster of ten WebLogic Server instances and an object cluster of three WebLogic Server
instances, while still fully utilizing each server's processing power.
Firewall Restrictions
If you place a firewall between the servlet cluster and object cluster in a multi-tier
architecture, you must bind all servers in the object cluster to public DNS names, rather
than IP addresses. Binding those servers with IP addresses can cause address translation
problems and prevent the servlet cluster from accessing individual server instances.
If the internal and external DNS names of a WebLogic Server instance are not identical,
use the ExternalDNSName attribute for the server instance to define the server's external
DNS name. Outside the firewall the ExternalDNSName should translate to external IP
address of the server.
You can configure WebLogic Server clusters to operate alongside existing Web servers.
In such an architecture, a bank of Web servers provides static HTTP content for the Web
application, using a WebLogic proxy plug-in or HttpClusterServlet to direct servlet
and JSP requests to a cluster.
The two-tier proxy architecture illustrated in the following figure is similar to the
Recommended Basic Architecture, except that static HTTP servers are hosted on a bank
of Web servers.
The two-tier proxy architecture contains two physical layers of hardware and software.
Web Layer
The proxy architecture utilizes a layer of hardware and software dedicated to the task of
providing the application's web tier. This physical web layer can consist of one or more
identically-configured machines that host one of the following application combinations:
Regardless of which Web server software you select, keep in mind that the physical tier
of Web servers should provide only static Web pages. Dynamic content—servlets and
JSPs—are proxied via the proxy plug-in or HttpClusterServlet to a WebLogic Server
cluster that hosts servlets and JSPs for the presentation tier.
Servlet/Object Layer
The recommended two-tier proxy architecture hosts the presentation and object tiers on a
cluster of WebLogic Server instances. This cluster can be deployed either on a single
machine or on multiple separate machines.
The Servlet/Object layer differs from the combined-tier cluster described in
Recommended Basic Architecture in that it does not provide static HTTP content to
application clients.
This architecture provides the same benefits (and the same limitations) as the
Recommended Multi-Tier Architecture. It differs only insofar as the web tier is placed on
a separate bank of Web servers that utilize WebLogic proxy plug-ins.
Using standalone Web servers and proxy plug-ins provides the following advantages:
Using a Web server proxy at the front-end of your Web application enables
you to use familiar firewall policies to define your DMZ. In general, you can
continue placing the Web servers in your DMZ while disallowing direct
connections to the remaining WebLogic Server clusters in the architecture.
The figures above depict this DMZ policy.
Using standalone Web servers and proxy plug-ins limits your Web application in the
following ways:
Additional administration
The Web servers in the proxy architecture must be configured using third-
party utilities, and do not appear within the WebLogic Server administrative
domain. You must also install and configure WebLogic proxy plug-ins to the
Web servers in order to benefit from clustered servlet access and failover.
Using a load balancer directly with a WebLogic Server cluster provides several benefits
over proxying servlet requests. First, using WebLogic Server with a load balancer
requires no additional administration for client setup—you do not need to set up and
maintain a separate layer of HTTP servers, and you do not need to install and configure
one or more proxy plug-ins. Removing the Web proxy layer also reduces the number of
network connections required to access the cluster.
Using load balancing hardware provides more flexibility for defining load balancing
algorithms that suit the capabilities of your system. You can use any load balancing
strategy (for example, load-based policies) that your load balancing hardware supports.
With proxy plug-ins or the HttpClusterServlet, you are limited to a simple round-
robin algorithm for clustered servlet requests.
Note, however, that using a third-party load balancer may require additional
configuration if you use in-memory session state replication. In this case, you must
ensure that the load balancer maintains a "sticky" connection between the client and its
point-of-contact server, so that the client accesses the primary session state information.
When using proxy plug-ins, no special configuration is necessary because the proxy
automatically maintains a sticky connection.
The sections that follow describe several common ways of defining your DMZ to create
varying levels of application security.
The basic firewall configuration uses a single firewall between untrusted clients and the
Web server layer, and it can be used with either the Recommended Basic Architecture or
Recommended Multi-Tier Architecture cluster architectures.
In the above configuration, the single firewall can use any combination of policies
(application-level restrictions, NAT, IP masquerading) to filter access to three HTTP
servers. The most important role for the firewall is to deny direct access to any other
servers in the system. In other words, the servlet layer, the object layer, and the database
itself must not be accessible from untrusted clients.
Note that you can place the physical firewall either in front of or behind the Web servers
in the DMZ. Placing the firewall in front of the Web servers simplifies your firewall
policies, because you need only permit access to the web servers and deny access to all
other systems.
If you place a firewall between the proxy layer and the cluster, follow these configuration
guidelines:
Note: If the clustered servers segregate https and http traffic on a pair of custom
channels, see Channels, Clusters, and Firewalls in Designing and Configuring WebLogic
Server Environments.
By denying access to all but the Web server layer, the basic firewall configuration creates
a small-footprint DMZ that includes only three Web servers. However, a more
conservative DMZ definition might take into account the possibility that a malicious
client may gain access to servers hosting the presentation and object tiers.
For example, assume that a hacker gains access to one of the machines hosting a Web
server. Depending on the level of access, the hacker may then be able to gain information
about the proxied servers that the Web server accesses for dynamic content.
If you choose to define your DMZ more conservatively, you can place additional
firewalls using the information in Additional Security for Shared Databases.
If you use load balancing hardware with a recommended cluster architecture, you must
decide how to deploy the hardware in relationship to the basic firewall. Although many
hardware solutions provide security features in addition to load balancing services, most
sites rely on a firewall as the first line of defense for their Web applications. In general,
firewalls provide the most well-tested and familiar security solution for restricting web
traffic, and should be used in front of load balancing hardware, as shown below.
Figure 7-7 Basic Proxy with Firewall and Load Balancer Architecture
The above setup places the load balancer within the DMZ along with the web tier. Using
a firewall in this configuration can simplify security policy administration, because the
firewall need only limit access to the load balancer. This setup can also simplify
administration for sites that support internal clients to the Web application, as described
below.
If you support internal clients that require direct access to your Web application (for
example, remote machines that run proprietary Java applications), you can expand the
basic firewall configuration to allow restricted access to the presentation tier. The way in
which you expand access to the application depends on whether you treat the remote
clients as trusted or untrusted connections.
If you use a Virtual Private Network (VPN) to support remote clients, the clients may be
treated as trusted connections and can connect directly to the presentation tier going
through a firewall. This configuration is shown below.
In the above configuration, the boundary between the object tier and the database is
hardened using an additional firewall. The firewall maintains a strict application-level
policy that denies access to all connections except JDBC connections from WebLogic
Servers hosting the object tier.
You can do a number of things to help prevent problems before you boot the cluster.
Your WebLogic Server license must include the clustering feature. If you try to start a
cluster without a clustering license, you will see the error message Unable to find a
license for clustering.
All servers in the cluster must have the same major version number, but can have
different minor version numbers and service packs.
The cluster's Administration Server is typically not configured as a cluster member, but it
should run the same major version of WebLogic Server used on the managed servers.
A problem with the multicast address is one of the most common reasons a cluster does
not start or a server fails to join a cluster.
A multicast address is required for each cluster. The multicast address can be an IP
number between 224.0.0.0 and 239.255.255.255, or a host name with an IP address
within that range.
You can check a cluster's multicast address and port on its Configuration-->Multicast tab
in the Administration Console.
For each cluster on a network, the combination of multicast address and port must be
unique. If two clusters on a network use the same multicast address, they should use
different ports. If the clusters use different multicast addresses, they can use the same port
or accept the default port, 7001.
Before booting the cluster, make sure the cluster's multicast address and port are correct
and do not conflict with the multicast address and port of any other clusters on the
network.
The errors you are most likely to see if the multicast address is bad are:
Make sure the value of CLASSPATH is the same on all managed servers in the cluster.
CLASSPATH is set by the setEnv script, which you run before you run
startManagedWebLogic to start the managed servers.
By default, setEnv sets this value for CLASSPATH (as represented on Windows systems):
set WL_HOME=C:\bea\weblogic700
set JAVA_HOME=C:\bea\jdk131
.
.
set CLASSPATH=%JAVA_HOME%\lib\tools.jar;
%WL_HOME%\server\lib\weblogic_sp.jar;
%WL_HOME%\server\lib\weblogic.jar;
%CLASSPATH%
If you change the value of CLASSPATH on one managed server, or change how setEnv
sets CLASSPATH, you must change it on all managed servers in the cluster.
Each server instance in the cluster has a default execute queue, configured with a fixed
number of execute threads. To view the thread count for the default execute queue,
choose the Configure Execute Queue command on the Advanced Options portion of the
Configuration> General tab for the server. The default thread count for the default queue
is 15, and the minimum value is 5. If the value of Thread Count is below 5, change it to a
higher value so that the Managed Server does not hang on startup.
If the cluster fails to start, or a server fails to join the cluster, the first step is to check any
commands you have entered, such as startManagedWebLogic or a java interpreter
command, for errors and misspellings.
Before contacting BEA Technical Support for help with cluster-related problems, collect
diagnostic information. The most important information is a log file with multiple thread
dumps from a Managed Server. The log file is especially important for diagnosing cluster
freezes and deadlocks.
Remember: a log file that contains multiple thread dumps is a prerequisite for
diagnosing your problem.
Redirecting both standard error and standard output places thread dump
information in the proper context with server informational and error
messages and provides a more useful log.
4. Continue running the cluster until you have reproduced the problem.
Note: If you are running the JRockit JVM under Linux, see Getting a JRockit Thread
Dump Under Linux.
7. Attach the compressed log file to an e-mail to your BEA Technical Support
representative. Do not cut and paste the log file into the body of an e-mail.
8. If the compressed log file is too large, you can use the BEA Customer
Support FTP site.
If you use the JRockit JVM under Linux, use one of the following methods to generate a
thread dump.
If the JVM's management server is enabled (by starting the JVM with the
-Xmanagement option), you can generate a thread dump using the JRockit
Management Console.
Use Kill -3 PID, where PID is the root of the process tree.
using a grep argument that is a string that will be found in the process stack
that matches the server startup command. The first PID reported will be the
root process, assuming that the ps command has not been piped to another
routine.
Under Linux, each execute thread appears as a separate process under the
Linux process stack. To use Kill -3 on Linux you supply must match PID of
the main WebLogic execute thread, otherwise no thread dump will be
produced.
If you are experiencing cluster problems, you should also check the garbage collection on
the managed servers. If garbage collection is taking too long, the servers will not be able
to make the frequent heartbeat signals that tell the other cluster members they are running
and available.
If garbage collection (either first or second generation) is taking 10 or more seconds, you
need to tune heap allocation (the msmx parameter) on your system.
Run utils.MulticastTest
You can verify that multicast is working by running utils.MulticastTest from one of
the managed servers. See Using the WebLogic Server Java Utilities in WebLogic Server
Command Reference.