Tuesday 26 July 2011

Managing the weblogic server life cycle

Managing the Weblogic Server Life Cycle

In this post I am going to discuss about WebLogic Server Life Cycle. Before you dive into the deeper you must know each Java option that you can use, and also argument you can pass to the weblogic.Server class, which is a member of weblogic package given by Oracle WebLogic installation.
Usage: java [options] weblogic.Server [args...]
Where WebLogic options include:
-Djava.security.policy= the location of the security policyfile
-Dweblogic.Domain= WebLogic domain name
-Dweblogic.Name= WebLogic server name
-Dweblogic.ext.dirs=':' separated list of directories to pick up jars fromand add to the end of the server classpath.The list can also contain individual jars.
-Dweblogic.management.server=WebLogic Admin Server URL for starting a Managed Server, the value can be: host:port or http://host:port or https://host:port
-Dweblogic.home= The location of the WebLogic Server product install. By default, this will be derived from the classpath.
-Dweblogic.RootDirectory=The root directory of your domain, where your configuration is housed.
default is the current working directory
-Dweblogic.management.username= user name
-Dweblogic.management.password= user password
-Dweblogic.management.pkpassword= private key password
-Dweblogic.security.unixrealm.authProgram= the name of the program used to authenticate users in the unix
security realm
-Dweblogic.= specify a server attribute, it will override the attribute value set in config.xml for this server
-Dweblogic.admin.host= same as weblogic.management.server, an old property
-javaagent:$WL_HOME/server/lib/diagnostics-agent.jar enable diagnostics hot code-swap for application classes And WebLogic args include:
-? -help print this help message

1. Starting the AdminServer by 'weblogic.Server'

Here is the basic command how the WebLogic Server will be started in the script. Actually, inside story you can understand how it goes by executing this command at your command line. To Start a admin Server we need to go to domains directory and use the following command:

java weblogic.Server

The JVM parameters will be considered default as 256 MB minimum and 512MB maximum heap size. If you wish to change you can specify as follows:

java -Xms512m -Xmx1024m -XX:MaxPermSize=512m weblogic.Server

while starting the admin server by using the weblogic.Server command Line references, uses minmum capability to start the Server instances. When we open the WebLogic Console in a browser it requires the load the console portal which cannot run on the default heap size like -Xms512m -Xmx1024m , need to increase the heap size and Permanent Size for the JVM also need to increase with -XX:MaxPermSize=512m. following command also works for running Admin server.

java -XX:MaxPermSize=512m weblogic.Server

If we don't use the JVM parameter of XX:MaxPermSize=512m , we will face the issue of "Out of Memor Error(perm gen error)" when accessing the console of admin

2) Starting the Managed Server by weblogic.Server command

Syntax :

java -Dweblogic.Name=managed-server-name -Dweblogic.management.server=adminURL weblogic.Server


java -Dweblogic.Name=app02 -Dweblogic.management.server=http://WLHOST:7913 -Dweblogic.management.username='weblogic' -Dweblogic.management.password='weblogic' weblogic.Server


2.1 Starting a Managed Server in ADMIN Mode

You might feel very thril here, To run the command line for the managed server for our regular example:
(Here WLHost replace with your own)




nohup java -Dweblogic.Name=app02 \
-Dweblogic.management.server=http://WLHOST:7913 \
-Dweblogic.management.username='weblogic' \
-Dweblogic.management.password='weblogic' \
-Dweblogic.management.startupMode=ADMIN weblogic.Server >app02.out 2>&1 &



To check the status of the Server into the logs are as follows:

$tail -100f app02.out

2.2 Starting a Managed Server STANDBY Mode

Here one more wonder you can see here, To run the command line for the managed server for our regular example: (Here WLHost replace with your own)


Starting a WebLogic instance in STANDBY mode

nohup java -Dweblogic.Name=app02 \
-Dweblogic.management.server=http://WLHOST:7913 \
-Dweblogic.management.username='weblogic' \
-Dweblogic.management.password='weblogic' \
-Dweblogic.management.startupMode=STANDBY weblogic.Server >app02.out 2>&1 &


To check the status of the Server you need to look into the logs are as follows:

tail -100f app02.out

Normally we can start the managed server which is in remotely in command line by using the below :(starting managed server in remotely)

startManagedWebLogic.sh "app02" "http://wladminhost:7913"
app02 #remote managed server
http://wladminhost:7913 #admin url






No comments:

Post a Comment