Tuesday, September 28, 2010

WebLogic Administration issues Part 1

WLA production support Issues

Day to day there are many issues comes to WebLogic Administrator, When issues comes I feel more happy because variety tricks need to be developed, this is the situation where we can explore things into the deeper level, understand and get the effective resolution after a little bit brainstorming research. This might be good habit of any WLA, What do you say guys?? Here I going to share with you guys, my recent issues (this week) faced and fixed them on time

There is issue going in a Data center, all the people in the data center are feeling panic. There lift their hands unable to find from where this issue originated. While starting the WebLogic instance unable to start.

A smart WLA, How is not only think in WebLogic, he is having fantastic knowledge about UNIX too. Just within few minutes after he found the root cause of the issue is one of the mounted Disk space is overloaded 100% disk utilization FULL!!

How he found the space issue you can see here. It the problem is that there is not enough space to start the sever instance. In the server instance log it is going to show space issue. A small JVM kid unable to have sufficient memory.


/logs> du - sk *|sort –rn |head
12050 lof_09-14-2010.log
2950 LOF_PERF_09-14-2010.log
2951 346 startWebLogic.OUT
488 PERF_09-14-2010.log
489 452 LOG_09-14-2010.log
---
Above command shows that we can see the file or directories, which occupied how much disk sizes on a particular filesystem, mount point. Accordingly we can resolve the issue by rotate the logs to clear off the space for particular instance is being occupied more disk space. So be brave to face the issue!!

Sourced by : Sarangapani Matoori WLA

Sunday, September 5, 2010

Creating a Domains using weblogic.Server

It was chilling January days, when I was doing my experiments for WebLogic System Administration certificate. You might think that how come this is possible a domain using weblogic.Server?? But it is true, you can do this, you can configure a domain using java weblogic.Server. This blog enables you to help you to make that domain with weblogic.Server class and the same command will Start the Admin Server of-course you can name your Admin Server here I did as Server2. The command can be given as follows:

java -XX:MaxPermSize=512m -Dweblogic.RootDirectory=.
-Dweblogic.Domain=domain2 -Dweblogic.Name=Server2 -Dweblogic.management.username=weblogic
-Dweblogic.management.password=weblogic -Dweblogic.ListenAddress=WLHost.com
-Dweblogic.ListenPort=9015 weblogic.Server

Let us see new scenario
If we have config.xml file copied from an existing domain then we can run the server with the override the exiting values present in the urconfig.xml file with ListenAddress, ListenPort new values given in command line.

No config.xml was found.
Would you like the server to create a default configuration and boot? (y/n): y

The response 'y' indicates to the weblogic.Server to create a domain directyory with all required files and directories for it.
If you don't specify the ListenAddress then weblogic will search for all possible network channels to connect with the given port.

java -XX:MaxPermSize=512m -Dweblogic.RootDirectory=. -Dweblogic.ConfigFile=urconfig.xml
-Dweblogic.Domain=domain2 -Dweblogic.Name=Server2 -Dweblogic.management.username=weblogic
-Dweblogic.management.password=weblogic -Dweblogic.ListenAddress=WLHost.com
-Dweblogic.ListenPort=9015 weblogic.Server


Above highlighted text in single line in a command prompt or keep this into a shell script or batch script for respective operating environments. Here the domain can be created for only single server (Admin Server) instance, and we cannot add managed server and cluster etc. if we have already a config.xml file available then we can specify using -Dweblogic.ConfigFile=urconfig.xml.

Creating the Domains using ANT

This is my one more attempt to creating the WebLogic domain with ANT Script that is build.xml.

In the Oracle WebLogic we have wonderful options to define the parameters to create a domain with ant script (build.xml). Here it comes the most powerful ANT task given by WebLogic with a specialized parameters i.e., wlserver.

My experiment is going to create a simple single server domain and starts the Admin server also with this script.

You can use any editor to edit this build.xml and enter the following lines then run ant in your command prompt

My Successful build.xml made for Solaris operating environment where all PATH, CLASSPATH variables already defined as told in earlier post which already assigned in previous domain creation.

Note: Each line keep it in the lessthan Open tag(<) and greaterthan close tag(/>) and remove if open or close braces () are there in there before using it



Execution Results as follows:
bash-3.00$ ant
Buildfile: build.xml
newserver:
[delete] Deleting directory /export/home/wluser/testant/tmp
[mkdir] Created dir: /export/home/wluser/testant/tmp
BUILD SUCCESSFUL
Total time: 1 minute 26 seconds
[WLServer wsant] Server will not be killed due to noExit flagwsant


Noticed following changes to work it properly:

1. The folder name tmp is used for creating domain that can be domain directory path, we change it once the ant script run successful.
2. When I used the e-docs given ant script it is running the server after configuring domain with given parameters and automatically
Killing the ant generated process. To stop this added attribute noExit with true as value.
3. The default jvmags to start WebLogic Server not sufficient. it is throughing following Error:
java.lang.OutOfMemoryError: PermGen space
To resolve this wlserver standalone tag changed to paired tag, and a child tag added as jvmarg.

Ref: "Starting Servers and Creating Domains Using the wlserver Ant Task" on Oracle Documents

Creating Domain using pack and unpack

Though there are many ways to configuring a WebLogic domain, Here I am going to experiment with pack and unpack commands for my Certification. Later I found it is very handy for migrating old domains to new and it is best suites for extending the domains also.

You have one more chance of creating domain template with Domain Template Builder

http://download.oracle.com/docs/cd/E13179_01/common/docs102/tempbuild/index.html

 Create new domains using custom Domain/Configuration Templates

Creating Domain by using pack and unpack command of new feature in Weblogic Server 9.x and above 10g or 11g:

The WebLogic provides two compressing and uncompressing the domain for reusing to another remote machine or it can be used as backup for the existing domain.

Which requires the PATH need to set to /common/bin

export PATH=/export/home/wlsuser/bea/weblogic92/common/bin:$PATH

PACK Process

Now let us see PACK Process how it works

Syntax:

pack -domain=domain -template=template -template_name=“template_name”
[-template_author=“author”][-template_desc=“description”]
[-managed={true|false}][-log=log_file] [-log_priority=log_priority]

if it is in the pack command in the path you can give pack.sh from any directory otherwise you need to goto that path.
Example

bash-3.00$ pack.sh -domain="/export/home/wlsuser/domains/wlscldom"
-template="/export/home/wlsuser/templates/wlscltemp.jar" -template_name="WLS
CLUSTER DOMAIN" -log=/export/home/wlsuser/logs/wlscldompack.log -log_priority=INFO

<< read domain from "/export/home/wlsuser/domains/wlscldom" >> succeed: read domain from "/export/home/wlsuser/domains/wlscldom"
<< write template to "/export/home/wlsuser/templates/wlscltemp.jar" ................................................................................. ................... >> succeed: write template to "/export/home/wlsuser/templates/wlscltemp.jar"
<< close template >> succeed: close template

To confirm that domain created in the current directory check with ls command.
bash-3.00$ ls -l
total 30
drwxr-xr-x 8 wlsuser wlproj512 Dec 19 07:58 bea
drwxr-xr-x 3 wlsuser wlproj512 Dec 24 10:48 domains
bash-3.00$ cd logs
bash-3.00$ ls -l
total 130
-rw-r--r-- 1 wlsuser wlproj948 Dec 24 12:06 wlscldompack.log

To View the logged info related to pack process.
bash-3.00$ tail -100 wlscldompack.log
2008-12-24 12:06:43,569 INFO [runScript]
com.bea.plateng.domain.script.ScriptExecutor - read domain from
"/export/home/wlsuser/domains/wlscldom"
2008-12-24 12:06:52,643 INFO [runScript]
com.bea.plateng.domain.script.ScriptExecutor - succeed: read domain from
"/export/home/wlsuser/domains/wlscldom"
2008-12-24 12:06:52,648 INFO [runScript]
com.bea.plateng.domain.script.ScriptExecutor - write template to
"/export/home/wlsuser/templates/wlscltemp.jar"
2008-12-24 12:06:56,785 INFO [Thread-1] com.bea.plateng.domain.TemplateGenerator
- Template Generation Successfull!
2008-12-24 12:06:56,847 INFO [runScript]
com.bea.plateng.domain.script.ScriptExecutor - succeed: write template to
"/export/home/wlsuser/templates/wlscltemp.jar"
2008-12-24 12:06:56,852 INFO [runScript]
com.bea.plateng.domain.script.ScriptExecutor - close template
2008-12-24 12:06:56,856 INFO [runScript]
com.bea.plateng.domain.script.ScriptExecutor - succeed: close template


bash-3.00$ cd templates
bash-3.00$ ls -l
total 46
-rw-r--r-- 1 wlsuser wlproj 23188 Dec 24 12:06 wlscltemp.jar

To pack the managed servers only then we need to use the option '-managed=true'. by default it is set to false.
bash-3.00$ pack.sh -managed=true -domain="/export/home/wlsuser/domains/wlscldom"
-template="/export/home/wlsuser/templates/wlscltemp.jar" -template_name="WLS
CLUSTER DOMAIN" -log=/export/home/wlsuser/logs/wlscldompack.log -log_priority=INFO

UNPACK Process

To run this we must already run the pack command on a domain which is already existing. The domain template jar must be copied to the destination machine.

Syntax:
unpack -template=template -domain=domain [-user_name=username]
[-password=password] [-app_dir=application_directory]
[-java_home=java_home_directory] [-server_start_mode={dev|prod}]
[-log=log_file] [-log_priority=log_priority]

Example

bash-3.00$ unpack.sh -template=wlscltemp.jar -domain=domains/wlscldom
-log=wlscldomunpack.log -log_priority=INFO

<< read template from "/home/wlsuser/wlscltemp.jar" >> succeed: read template from "/home/wlsuser/wlscltemp.jar"
<< write Domain to "/home/wlsuser/domains/wlscldom" ................................................................................. .............. >> succeed: write Domain to "/home/wlsuser/domains/wlscldom"
<< close template >> succeed: close template
bash-3.00$ ls -l
total 1188090
drwxr-xr-x 7 wlsuser wlproj 1024 Dec 24 09:13 bea
drwxr-xr-x 3 wlsuser wlproj 96 Dec 24 12:20 domains

To unpack managed server also it will work in the similar manner. But need to put the “-managed=true”

Example:

pack.sh -managed=true -domain="/home/wluser/domains/WLclsnm/" -template="/home/wluser/templates/WLclsnm.jar" -template_name="WLS CLUSTER DOMAIN" -log=/home/wluser/logs/wlscldompack.log -log_priority=INFO


unpack.sh -template=WLclsnm.jar -domain=domains/WLclsnm -log=WLclsnmpack.log -log_priority=INFO 

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)

Starting a WebLogic instance in ADMIN mode

 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

Basic Steps for configuring WebLogic Domain

Domain with AdminServer Creation:
Note: This is for Intial lerner or Basics who want to do manually not by using the wlst
Domain:
A domain is the basic administration unit for WebLogic Server. It consists of one or more WebLogic Server instances, and logically related resources and services that are managed, collectively, as one unit.
 The basic domain infrastructure consists of one Administration Server and optional Managed Servers and clusters

Administration Server :
A domain always includes one WebLogic Server instance that is configured as an Administration Server. The Administration Server provides a central point for managing the domain and providing access to the WebLogic Server administration tools
Managed Servers:
All other WebLogic Server instances in a domain are called Managed Servers. Managed Servers host application components and resources, which are also deployed and managed as part of the domain.
Clusters:
A domain may also include WebLogic Server clusters, which are groups of server instances that work together to provide scalability and high availability for applications. A cluster appears as a single WebLogic Server instance.

Creation of Domain in Weblogic 9.2:

1) Logon to SSH.
2) Go to Weblogic home
Command : cd $WEBLOGICHOME.
3) Go to the folder common/bin
Command : cd common/bin
4) Execute config.sh file. This file mainly takes care below the tasks,
Command : sh config.sh -mode=console
a) set ups the weblogic home, the root directory for Weblogic installation.
b) set ups the common environment like java home, java vendor and DataBase.
5) After executing the above command BEA WebLogic Configuration Wizard opens
6) Under this wizard we have below two options,
1.To create a new weblogic domain.
2.Extend the existing domain.
7) To create a new domain enter the index number 1.
Command : 1 and press ENTER
8) After executing the above command, Options for selecting domain source will be available.
9) Select option 2, to choose custom template.
Command : 2 and press ENTER
10) After executing the above command, below options will be available.
1 - Modify "User name"
2 - Modify "User password"
3 - Modify "Confirm user password"
4 - Modify "Description"
5 - Discard Changes
11) Select option 1, to modify User Name.
Command : 1 and press ENTER

12) Enter the user name and press ENTER.
Command : system and press ENTER
13) Select option 2, to modify the Password.
Command : weblogic and press ENTER
14) Select option 3, to confirm the Password.
Command : weblogic and press ENTER
15) After configuring the User Name and Password, type ‘next’ to proceed further with Domain configuration mode.
Command : next
16) After executing the above command, options to enable the domain in Production mode and Development mode will be available. Type 1 to enable Development mode.
Command : 1 and press ENTER
17) After executing the above command, options to select the JDK will be available. As we are using JDK 1.5 we need to select option 1.
Command : 1 and press ENTER
18) After executing the above command, options to modify the pre-configured settings we available. Select 1 to modify the settings
Command : 1 and press ENTER
19) After executing the above command, options to modify the below administration server configuration will be available.
1 - Modify "Name"
2 - Modify "Listen address"
3 - Modify "Listen port"
4 - Modify "SSL enabled"
20) Select option 2 to modify the Listen address.
Command : 2 and press ENTER
21) Enter the value for Listen address.
Command : x.xxx.xx.xx and press ENTER
22) Now, select option 3 to modify Listen port.
Command : 3 and press ENTER
23) Enter the value for Listen port.
Command : 6501 and Press ENTER
24) Option for target domain will be available for this domain.
Command : /pani/project/username
25) Option Edit the domain name will be available. Choose option 1 to edit the name else type Next for the creation of the domain.
Command : Next
26) Domain will be created successfully.

Search This Blog

Loading...

Content of System Administration

ITIL V3 Foundation Certification books