+ All Categories
Home > Documents > allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication?...

allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication?...

Date post: 11-Aug-2021
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
28
1. What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster 1. In-Memory replication 2. DB based Session Replication In-Memory Replication: Here more than one Managed Server in a cluster of a Domain keeps the http session details of a particular browser connection. Primary server process the request and choose other server (randomly or based upon settings) to keep the backup of http session details (Replication). So, the secondary server will only keep the backup, and not process the request. The information of (Replication) will be sent back to the browser (cookies). In case, the primary Server goes down, the LB (Load balancer) will direct the secondary Server, based upon cookies to process the request from the point where primary Server was stopped. This is called In-Memory Replication. ______________________________ weblogic.xml ______________________________ <replicate-if-clustered>true<replicate-if-clustered> The file weblogic.xml is part of deployment document given by developer. Just by making multiple Managed Servers, Session Replication will not happen. The above parameter has top priority must set to true.
Transcript
Page 1: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

1. What is Session Replication?

There are primarily two types of Session Replication in Weblogic Cluster

1. In-Memory replication

2. DB based Session Replication

In-Memory Replication:

Here more than one Managed Server in a cluster of a Domain keeps the http session details of a particular browser connection.

Primary server process the request and choose other server (randomly or based upon settings) to keep the backup of http session details (Replication).

So, the secondary server will only keep the backup, and not process the request. The information of (Replication) will be sent back to the browser (cookies). In case, the primary Server goes down, the LB (Load balancer) will direct the secondary Server, based upon cookies to process the request from the point where primary Server was stopped. This is called In-Memory Replication.

______________________________

weblogic.xml

______________________________

<replicate-if-clustered>true<replicate-if-clustered>

The file weblogic.xml is part of deployment document given by developer. Just by making multiple Managed Servers, Session Replication will not happen. The above parameter has top priority must set to true.

DB-based Replication:

Instead of storing http session backup in other Managed Server, it can be stored in the Database. Now, the Load Balancer can direct any available Server to continue the request, if the primary Server goes down.

It is called DB based Replication.

It is gives better availability as it will work even if secondary server goes down, as any server can process the request. But it is much slower than In-Memory replication.

Generally, In-Memory Replication is used.

Page 2: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

2. WLST Commands.

WLST is the WebLogic Scripting Tool that is designed for administrating and monitoring WebLogic. It is based on the Jython Programming Language and it contains many UNIX like commands – ls(), cd(), for example. 

There is an ‘offline’ and ‘online’ mode.

While the offline mode is primarily concerned with the administration and configuration of domains; the online mode being concerned more with the actual running of the domain, deployment of applications; monitoring of MBeans; viewing of JMS and JDBC setups.

Both the offline and online modes allow for commands to be run from the WLST command line and via scripts.

The first step that is needed to allow access to the WLS environment is to run the WLST interface.

The simplest way to do this is to ensure that the environment is correct by running the setDomainEnv script within a domain or setWLSEnv from the WLS_HOME\wlserver_10.3\server\bin directory, which will setup the CLASSPATH and JAVA_HOME correctly

WL_HOME\user_projects\domains\base_domain\bin>setDomainEnv.cmdWL_HOME\user_projects\domains\base_domain>java -version java version "1.6.0_05" Java(TM) SE Runtime Environment (build 1.6.0_05-b13) BEA JRockit(R) (build R27.6.0-50_o-100423-1.6.0_05-20080626-2105-windows-ia32, compiled mode)

Next, you’ll need to access WLST. There are more complex ways of doing this, but the easiest is this

WL_HOME\user_projects\domains\base_domain>java weblogic.WLST

If the server is running you’ll then be able to access using the connect() command. For detailed syntax see the connect() command in the WLST documentation

Please enter your username [weblogic]:Please enter your password [weblogic]:Please enter your server URL [t3://localhost:7001]:wls:/offline> connect()Connecting to t3://localhost:7001 with userid weblogic...Successfully connected to Admin Server 'AdminServer' that belongs to domain 'base_domain'.

Warning: An insecure protocol was used to connect to the

Page 3: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

server. To ensure on-the-wire security, the SSL port orAdmin port should be used instead.

Notice the warning – it allows you to use t3 or t3s. t3s would the preferred method for production, but t3 is the default.

One undocumented option, that is not supported by all commands id the easeSyntax() command. Basically, this removes the need for tightly defined formatting or some commands, meaning that cd() becomes cd and ls() becomes ls. You turn it on

wls:/base_domain/serverConfig> easeSyntax()You have chosen to ease syntax for some WLST commands.However, the easy syntax should be strictly used in interactive mode. Easy syntax will not function properly in script mode and when used in loops.You can still use the regular jython syntax although you have opted for easy syntax.Use easeSyntax to turn this off.Use help(easeSyntax) for commands that support easy syntax

Please note, it’s only supported in interactive mode and won’t work for scripts.

3. Types/Ways of deployment.

We can deploy java applications using 4 different methods as specified below(http://weblogic-wonders.com/weblogic/2011/02/26/automating-application-deployment-on-weblogic-server/)

(i) Using WebLogic Administration Console(ii) Using WLST (iii) Using JXM(iv) Using Build Script

4. Lists of daily used UNIX commands.

Some Basic UNIX Commands

The UNIX operating system has for many years formed the backbone of the Internet, especially for large servers and most major university campuses. However, a free version of UNIX

called Linux has been making significant gains against Macintosh and the Microsoft Windows 95/98/NT environments, so often associated with personal computers. Developed by a number of

volunteers on the Internet such as the Linux group and the GNU project, much of the open-source software is copyrighted, but available for free. This is especially valuable for those in educational

environments where budgets are often limited.

UNIX commands can often be grouped together to make even more powerful commands with capabilities known as I/O redirection ( < for getting input from a file input and > for outputing to a file )

Page 4: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

and piping using | to feed the output of one command as input to the next. Please investigate manuals in the lab for more examples than the few offered here.The following charts offer a summary of some simple UNIX commands. These are certainly not all of the commands available in this robust operating system, but these will help you get started.

Ten ESSENTIAL UNIX Commands

These are ten commands that you really need to know in order to get started with UNIX. They are probably similar to commands you already know for another operating system. 

Command Example Description

1.     ls lsls -alF

Lists files in current directoryList in long format

2.     cd cd tempdircd ..cd ~dhyatt/web-docs

Change directory to tempdirMove back one directoryMove into dhyatt's web-docs directory

3.     mkdir mkdir graphics Make a directory called graphics

4.     rmdir rmdir emptydir Remove directory (must be empty)

5.     cp cp file1 web-docscp file1 file1.bak

Copy file into directoryMake backup of file1

6.     rm rm file1.bakrm *.tmp

Remove or delete fileRemove all file

7.     mv mv old.html new.html Move or rename files

8.     more more index.html Look at file, one page at a time

9.     lpr lpr index.html Send file to printer

10.   man man ls Online manual (help) about command

Ten VALUABLE UNIX Commands

Once you have mastered the basic UNIX commands, these will be quite valuable in managing your own account. 

Command Example Description

1.     grep <str><files>

grep "bad word" * Find which files contain a certain word

Page 5: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

2.     chmod <opt> <file>

chmod 644 *.htmlchmod 755 file.exe

Change file permissions read onlyChange file permissions to executable

3.     passwd passwd Change passwd

4.     ps <opt> ps auxps aux   |   grep dhyatt

List all running processes by #IDList process #ID's running by dhyatt

5.     kill <opt> <ID> kill -9 8453 Kill process with ID #8453

6.     gcc (g++) <source>

gcc file.c -o fileg++ fil2.cpp -o fil2

Compile a program written in CCompile a program written in C++

7.     gzip <file> gzip bigfilegunzip bigfile.gz

Compress fileUncompress file

8.     mail        (pine)

mail [email protected] < file1pine

Send file1 by email to someoneRead mail using pine

9.     telnet <host>        ssh <host>

telnet vortex.tjhsst.edussh -l dhyatt jazz.tjhsst.edu

Open a connection to vortexOpen a secure connection to jazz as user dhyatt

10.   ftp <host>ncftp <host/directory>

ftp station1.tjhsst.eduncftp metalab.unc.edu

Upload or Download files to station1Connect to archives at UNC

Ten FUN UNIX Commands

These are ten commands that you might find interesting or amusing. They are actually quite helpful at times, and should not be considered idle entertainment. 

Command Example Description

1.     who who Lists who is logged on your machine

2.     finger finger Lists who is on computers in the lab

3.     ytalk <user@place>

ytalk dhyatt@threat

Talk online with dhyatt who is on threat

Page 6: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

4.     history history Lists commands you've done recently

5.     fortune fortune Print random humerous message

6.     date date Print out current date

7.     cal <mo> <yr>

cal 9 2000 Print calendar for September 2000

8.     xeyes xeyes & Keep track of cursor (in "background")

9.     xcalc xcalc & Calculator ("background" process)

10.   mpage <opt> <file>

mpage -8 file1 |  lpr

Print 8 pages on a single sheet and send to printer (the font will be small!)

Ten HELPFUL UNIX Commands

These ten commands are very helpful, especially with graphics and word processing type applications. 

Command Example Description

1.     netscape netscape & Run Netscape browser

2.     xv xv & Run graphics file converter

3.     xfig / xpaint xfig & (xpaint &)

Run drawing program

4.     gimp gimp & Run photoshop type program

5.     ispell <fname> ispell file1 Spell check file1

6.     latex <fname> latex file.tex Run LaTeX, a scientific document tool

7.     xemacs / pico xemacs (or pico)

Different editors

8.     soffice soffice & Run StarOffice, a full word processor

9.     m-tools (mdir, mdir a: DOS commands from UNIX (dir

Page 7: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

mcopy,        mdel, mformat, etc. )

mcopy file1   a: A:)Copy file1 to A:

10.   gnuplot gnuplot Plot data graphically

Ten USEFUL UNIX Commands:

These ten commands are useful for monitoring system access, or simplifying your own environment. 

Command Example Description

1.     df df See how much free disk space

2.     du du -b subdir Estimate disk usage of directory in Bytes

3.     alias alias lls="ls -alF" Create new command "lls" for long format of ls

4.     xhost xhost + threat.tjhsst.eduxhost -

Permit window to display from x-window program from threatAllow no x-window access from other systems

5.     fold fold -s file1   |   lpr Fold or break long lines at 60 characters and send to printer

6.     tar tar -cf subdir.tar subdirtar -xvf subdir.tar

Create an archive called subdir.tar of a directoryExtract files from an archive file

7.     ghostview (gv)

gv filename.ps View a Postscript file

8.     ping   (traceroute)

ping threat.tjhsst.edutraceroute www.yahoo.com

See if machine is alivePrint data path to a machine

9.     top top Print system usage and top resource hogs

10.   logout (exit) logout or exit How to quit a UNIX shell.

Helpful Files

The following files may be useful when trying to write your PVM programs in this class.

Page 8: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

The online UNIX Dictionary of over 40,000 words: /usr/dict/words The UNIX dictionary

Some useful system files in the directory /etc or /usr/games/lib/fortune: /etc/passwd The password file /etc/HOSTNAME The name of the computer /etc/issue The logon banner

/usr/games/lib/fortunes/fortune The source for UNIX fortunes

Some Useful Commands

Word Count, or "wc" A helpful UNIX command is the "word count" program that can count how many words are in the file.

        wc -w <filename> counts the number of words in a file        wc -l <filename> counts lines in a file.Grab Regular Expression, or "grep"Another helpful command is "grep" for grabbing lines from a file that contain a specific string pattern, or regular expression. The command grep <string><files> looks through a list of files and finds lines that contain the specific word in the string argument.

        grep pvm_pack *.cpp   will look for occurrences of the string "pvm_pack" in all files ending in ".cpp".        grep "My name is"   *   will look in all files in a directory trying to find the string "My name is".

Input / Output Redirection

The UNIX operating system has a number of useful tools for allowing other programs to work with one another. One of the ways to handle screen input and output with I/O Redirection, and ways to link several programs together with "pipes".With the use of the > for sending output to a file, a user can easily covert from screen display programs to ones that save the output without major changes in rewriting code. It is also very convenien for grabbing the output from various UNIX commands, too.myprogram   >   myoutfile This takes the output of "myprogram" and sends it a file called "myoutfile".ls -alF   >   filelist This runs the command "ls", but saves the directory listing to a file rather than displaying it on the screen.In order to convert a program that originally required lots of user input into one that runs on its own, the input redirection symbol < can be used to say where to get the values.

program2   <   myinputThis runs "program2" but takes any keyboard input from the file "myinput". It is important the input values are in the proper sequence in the file "myinput" since there will not be ways to reply to prompts at the console.

Pipes

The vertical bar "|" is called the pipe symbol, and it is designed for linking commands together to make them more powerful. The way it works is that the output from one command is sent as input to the next, thus creating a new command.

Page 9: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

ls -alF   |   grep ".cpp" This will list all files in a directory, and will then grab the names of only the ones that contain the string ".cpp" in the name, or the C++ source files.

The   system()   command in C

The system() command is actually a C function that is very valuable for accessing UNIX commands from within a C program. It can also be used to run other programs you have already written. Be careful with extensive use of this command because according to the online manual pages (man), there are a few bugs such as not being able to break out of infinite loops because interrupts are not processed, and some other security issues. For many of the things we will be doing in this class, though, this command will be quite useful. system( "ls - alF");This will run the "ls" command from within a C program and display the results to the screen.

system ( "ps -aux | grep dhyatt > outfile");This will run the "ps" command, the will send that output to "grep" which will look for occurrences of "dhyatt", and finally will print the results to a file called "outfile" rather than displaying anything on the screen.

About psReports the process status.Syntaxps [-a] [-A] [-c] [-d] [-e] [-f] [-j] [-l] [-L] [-P] [-y] [ -g grplist ] [ -n namelist ] [-o format ] [ -p proclist ] [ -s sidlist ] [ -t term] [ -u uidlist ] [ -U uidlist ] [ -G gidlist ]

-a List information about all processes most frequently requested: all those except process group leaders and processes not associated with a terminal.

-A List information for all processes. Identical to -e, below.-c Print information in a format that reflects scheduler

properties as described in priocntl.The -c option affects the output of the -f and -l options, as described below.

-d List information about all processes except session leaders.

-e List information about every process now running.-f Generate a full listing.-j Print session ID and process group ID.-l Generate a long listing.-L Print information about each light weight process (lwp) in

each selected process.-P Print the number of the processor to which the process or

lwp is bound, if any, under an additional column header, PSR.

-y Under a long listing (-l), omit the obsolete F and ADDR columns and include an RSS column to report the resident

Page 10: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

set size of the process. Under the -y option, both RSS and SZ will be reported in units of kilobytes instead of pages.

-g grplist

List only process data whose group leader's ID number(s) appears in grplist. (A group leader is a process whose process ID number is identical to its process group ID number.)

-n namelist

Specify the name of an alternative system namelist file in place of the default. This option is accepted for compatibility, but is ignored.

-o format

Print information according to the format specification given in format. This is fully described in DISPLAY FORMATS. Multiple -o options can be specified; the format specification will be interpreted as the space-character-separated concatenation of all the format option-arguments.

-p proclist

List only process data whose process ID numbers are given in proclist.

-s sidlist List information on all session leaders whose IDs appear in sidlist.

-t term List only process data associated with term. Terminal identifiers are specified as a device file name, and an identifier. For example, term/a, or pts/0.

-u uidlist List only process data whose effective user ID number or login name is given in uidlist. In the listing, the numerical user ID will be printed unless you give the -f option, which prints the login name.

-U uidlist

List information for processes whose real user ID numbers or login names are given in uidlist. The uidlist must be a single argument in the form of a blank- or comma-separated list.

-G gidlist

List information for processes whose real group ID numbers are given in gidlist. The gidlist must be a single argument in the form of a blank- or comma-separated list.

ExamplespsTyping ps alone would list the current running processes. Below is an example of the output that would be generated by the ps command.PID   TTY   TIME   CMD6874  pts/9   0:00     ksh6877  pts/9   0:01     csh418    pts/9   0:00     cshps -efDisplay full information about each of the processes currently running.UID PID PPID C STIME TTY TIME CMDhope 29197 18961 0 Sep27 ? 00:00:06 sshd: hope@pts/87hope 32097 29197 0 Sep27 pts/87 00:00:00 -cshhope 7209 32097 0 12:17 pts/87 00:00:00 ps -efps -l

Page 11: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

Displays processes including those that are in a wait state, similar to the below example.F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 0 T 0 12308 29722 0 80 0 - 16136 finish pts/0 00:00:00 pico 0 R 0 12530 29722 0 80 0 - 15884 - pts/0 00:00:00 ps 4 S 0 29722 29581 0 80 0 - 16525 wait pts/0 00:00:00 bash.

20 Linux System Monitoring Tools Every SysAdmin Should Know

Need to monitor Linux server performance? Try these built-in command and a few add-on tools.

Most Linux distributions are equipped with tons of monitoring. These tools provide metrics

which can be used to get information about system activities. You can use these tools to find

the possible causes of a performance problem. The commands discussed below are some of

the most basic commands when it comes to system analysis and debugging server issues such

as:

1. Finding out bottlenecks.

2. Disk (storage) bottlenecks.

3. CPU and memory bottlenecks.

4. Network bottlenecks.

#1: top - Process Activity Command

The top program provides a dynamic real-time view of a running system i.e. actual process

activity. By default, it displays the most CPU-intensive tasks running on the server and updates

the list every five seconds.

Fig.01: Linux top command

Page 12: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

Commonly Used Hot Keys

The top command provides several useful hot keys:

Hot Key

Usage

t Displays summary information off and on.

m Displays memory information off and on.

A

Sorts the display by top consumers of various system resources.

Useful for quick identification of performance-hungry tasks on a

system.

fEnters an interactive configuration screen for top. Helpful for setting up

top for a specific task.

o Enables you to interactively select the ordering within top.

r Issues renice command.

k Issues kill command.

z Turn on or off color/mono

#2: vmstat - System Activity, Hardware and System Information

The command vmstat reports information about processes, memory, paging, block IO, traps,

and cpu activity. # vmstat 3

Sample Outputs:

procs -----------memory---------- ---swap-- -----io---- --system--

-----cpu------

r b swpd free buff cache si so bi bo in cs us

sy id wa st

0 0 0 2540988 522188 5130400 0 0 2 32 4 2 4

1 96 0 0

1 0 0 2540988 522188 5130400 0 0 0 720 1199 665 1

0 99 0 0

Page 13: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

0 0 0 2540956 522188 5130400 0 0 0 0 1151 1569 4

1 95 0 0

0 0 0 2540956 522188 5130500 0 0 0 6 1117 439 1

0 99 0 0

0 0 0 2540940 522188 5130512 0 0 0 536 1189 932 1

0 98 0 0

0 0 0 2538444 522188 5130588 0 0 0 0 1187 1417 4

1 96 0 0

0 0 0 2490060 522188 5130640 0 0 0 18 1253 1123 5

1 94 0 0

Display Memory Utilization Slabinfo

# vmstat -m

Get Information about Active / Inactive Memory Pages

# vmstat -a

#3: w - Find Out Who Is Logged on And What They Are Doing

w command displays information about the users currently on the machine, and their

processes. # w username

# w vivek

Sample Outputs:

17:58:47 up 5 days, 20:28, 2 users, load average: 0.36, 0.26, 0.24

USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT

Page 14: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

root pts/0 10.1.3.145 14:55 5.00s 0.04s 0.02s vim

/etc/resolv.conf

root pts/1 10.1.3.145 17:43 0.00s 0.03s 0.00s w

#4: uptime - Tell How Long The System Has Been Running

The uptime command can be used to see how long the server has been running. The current

time, how long the system has been running, how many users are currently logged on, and the

system load averages for the past 1, 5, and 15 minutes. # uptime

Output:

18:02:41 up 41 days, 23:42, 1 user, load average: 0.00, 0.00, 0.00

1 can be considered as optimal load value. The load can change from system to system. For a

single CPU system 1 - 3 and SMP systems 6-10 load value might be acceptable.

#5: ps - Displays The Processes

ps command will report a snapshot of the current processes. To select all processes use the -A

or -e option: # ps -A

Sample Outputs:

PID TTY TIME CMD

1 ? 00:00:02 init

2 ? 00:00:02 migration/0

3 ? 00:00:01 ksoftirqd/0

4 ? 00:00:00 watchdog/0

Page 15: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

5 ? 00:00:00 migration/1

6 ? 00:00:15 ksoftirqd/1

....

.....

4881 ? 00:53:28 java

4885 tty1 00:00:00 mingetty

4886 tty2 00:00:00 mingetty

4887 tty3 00:00:00 mingetty

4888 tty4 00:00:00 mingetty

4891 tty5 00:00:00 mingetty

4892 tty6 00:00:00 mingetty

4893 ttyS1 00:00:00 agetty

12853 ? 00:00:00 cifsoplockd

12854 ? 00:00:00 cifsdnotifyd

14231 ? 00:10:34 lighttpd

14232 ? 00:00:00 php-cgi

Page 16: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

54981 pts/0 00:00:00 vim

55465 ? 00:00:00 php-cgi

55546 ? 00:00:00 bind9-snmp-stat

55704 pts/1 00:00:00 ps

ps is just like top but provides more information.

Show Long Format Output

# ps -Al

To turn on extra full mode (it will show command line arguments passed to process): # ps

-AlF

To See Threads ( LWP and NLWP)

# ps -AlFH

To See Threads After Processes

# ps -AlLm

Print All Process On The Server

# ps ax

# ps axu

Print A Process Tree

Page 17: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

# ps -ejH

# ps axjf

# pstree

Print Security Information

# ps -eo euser,ruser,suser,fuser,f,comm,label

# ps axZ

# ps -eM

See Every Process Running As User Vivek

# ps -U vivek -u vivek u

Set Output In a User-Defined Format

# ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm

# ps axo stat,euid,ruid,tty,tpgid,sess,pgrp,ppid,pid,pcpu,comm

# ps -eopid,tt,user,fname,tmout,f,wchan

Display Only The Process IDs of Lighttpd

# ps -C lighttpd -o pid=

OR # pgrep lighttpd

OR # pgrep -u vivek php-cgi

Display The Name of PID 55977

# ps -p 55977 -o comm=

Page 18: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

Find Out The Top 10 Memory Consuming Process

# ps -auxf | sort -nr -k 4 | head -10

Find Out top 10 CPU Consuming Process

# ps -auxf | sort -nr -k 3 | head -10

#6: free - Memory Usage

The command free displays the total amount of free and used physical and swap memory in the

system, as well as the buffers used by the kernel. # free

Sample Output:

total used free shared buffers

cached

Mem: 12302896 9739664 2563232 0 523124

5154740

-/+ buffers/cache: 4061800 8241096

Swap: 1052248 0 1052248

#7: iostat - Average CPU Load, Disk Activity

The command iostat report Central Processing Unit (CPU) statistics and input/output statistics

for devices, partitions and network filesystems (NFS). # iostat

Sample Outputs:

Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 06/26/2009

avg-cpu: %user %nice %system %iowait %steal %idle

Page 19: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

3.50 0.09 0.51 0.03 0.00 95.86

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn

sda 22.04 31.88 512.03 16193351 260102868

sda1 0.00 0.00 0.00 2166 180

sda2 22.04 31.87 512.03 16189010 260102688

sda3 0.00 0.00 0.00 1615 0

#8: sar - Collect and Report System Activity

The sar command is used to collect, report, and save system activity information. To see

network counter, enter: # sar -n DEV | more

To display the network counters from the 24th: # sar -n DEV -f /var/log/sa/sa24

| more

You can also display real time usage using sar: # sar 4 5

Sample Outputs:

Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 06/26/2009

06:45:12 PM CPU %user %nice %system %iowait

%steal %idle

06:45:16 PM all 2.00 0.00 0.22 0.00

0.00 97.78

Page 20: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

06:45:20 PM all 2.07 0.00 0.38 0.03

0.00 97.52

06:45:24 PM all 0.94 0.00 0.28 0.00

0.00 98.78

06:45:28 PM all 1.56 0.00 0.22 0.00

0.00 98.22

06:45:32 PM all 3.53 0.00 0.25 0.03

0.00 96.19

Average: all 2.02 0.00 0.27 0.01

0.00 97

5. How to configure cluster in weblogic server? What is a load balance and cluster algorithms?Clustering can be of two types: (i) Vertical (ii) Horizontal

Vertical clustering would not involve 2 physical servers. Although it involves 2 or more JVM instances but within one physical machine.

Whereas horizontal clustering would involve 2 or more physical servers. The criteria for this type is that, it is recommended that the other physical servers must have the same environment structure both in terms of physical and software structure. Therefore in this type, there would be one Primary Server for Administration purposes of the cluster environment.

Creating Horizontal Cluster:

1. Install Weblogic Server on say Machine_1 with two Managed Servers MS_1 (physical IP of Machie_1) & MS_2 (Physical IP of Machine_2).

2. Create a new machine NM_1 in Machine_1 and assign MS_1 to NM_1. Keep the Node Manager type to plain. Verify that NM_1 is reachable.

Page 21: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

3. Similarly create a second machine NM_2 to correspond to Machine_2 and assign MS_2 to MN_2. Again Keep the Node Manager type to plain.

4. Install Weblogic Server on 2nd Machine_2.5. Shutdown the Node Manager and Admin Server of Machine_1 6. Pack the domain of Machine_1 and unpack it in Machine _2

./pack.sh -managed=true -domain=/wl_home/user_projects/domains/base_domain -template=/home/oracle/temp/wl.jar -template_name=base_domain

./unpack.sh -domain=/wl_home/user_projects/domains/base_domain -template=/home/oracle/temp/wl.jar

(remember that the Middleware Home directories on both physical machines should be exactly the same)

7. Or use the plain old Linux command tar and gzip to pack our weblogic domain directory file structure and move it to the 2nd machine.Shutdown the weblogic domain(Admin Server, Nodemanager & Managed Servers). Goto the middleware home directory and issue the tar command to pack the domain directory file structure and contentstar cvf user_projects.tar user_projectsWhen the tar command is done, zip the archive by gzip command.gzip user_projects.tar.The file that needs to be moved and unpacked on the other machine is called user_projects.tar.gz

8. Transfer the user_projects.tar.gz to the second machine Machine_2 in the Middleware home directories. (remember that the Middleware Home directories on both physical machines should be exactly the same)Uncompress the zip file by gunzip user_projects.tar.gzThen extract the archive by tar xvf user_project.tarThis will create the user_projects directory structure on the 2nd machine Machine_2.

9. Now restart the domain on the 1st machine Machine_1, and use the WLST the 2nd machine Machine_2 to enroll the domain structure.

10. On the wlst prompt issue the following command to connect to the WebLogic Domain running on the other machine: connect('weblogic','weblogic123','t3://localhost:7001')

11. Verify that the connection was successful and then issue the following command to enroll this machine to the WebLogic Domain: 

nmEnroll(‘/wl_home/user_projects/domains/base_domain’, ‘/wl_home ‘/wlserver_10.3/common/nodemanager’)

Verify that the machine was successfully enrolled into the Domain.12. Verify that NM_2 is reachable in 2nd machine Machine_2.13. Now goto the Administration Server console in the 1st machine Machine_1, to create

and configure the cluster:

(i) Create cluster named CL_1.

Page 22: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

(ii) Select UNICAST for the messaging mode.(iii) In the configuration of the cluster CL_1, for the CLUSTER ADDRESS, enter

the IP Addresses of both the managed servers and supply one port as the cluster listen port eg: localhost1:7003, localhost2:7003.

(iv) Add the managed servers MS_1 and MS_2 to the cluster.(v) And monitor the status of the cluster member from the Admin Console.

The Domain is the parent of a Cluster. It contains typically one Admin and one or more Managed servers. Now the Cluster is a grouping of some or all of these managed servers within the domain.

Few facts:

• A cluster contains one or more logical servers which can reside on one or many physical servers

True. But let's clarify what you mean by 'logical' servers. In the Cluster you typically have two or more Managed Servers. These servers run in their own JVMs and can be started independently and serve requests independently. Each server will have a unique IP:port address, and it can be directly accessed from the browser. But these server instances can reside over multiple physical servers.

• When deploying a J2EE application to a cluster, it is tied to one server in that cluster

No it is not tied to one server. When you deploy a J2EE app to the Cluster, it will get deployed to each server in that cluster. The JNDI is cluster-wide and each server maintains a local copy of the JNDI.

You can look up the object (say an EJB) via JNDI on the Cluster or on the individual server.

• External users of the deployed app aren't aware of clustering

True.

But in this case you should have an Apache Web Server or a Load Balancer or DNS Server which takes the request from the browser, and internally maps it to one of the servers in the cluster. If you do not have any of these, you would have to define the cluster address as a DNS name or IP address for the client.

• The log file of that app is located on the server it's deployed

True, one weblogic log per server.

• If the server hosting the app fails, it's okay because the app is in a cluster and another server will pick up the work?

Page 23: allweblogicforyou.files.wordpress.com  · Web view2014. 9. 23. · What is Session Replication? There are primarily two types of Session Replication in Weblogic Cluster. 1. In-Memory

Not by default, you have to configure it for failover and replication.

• If the server hosting the app fails, what happens to logging?

Logging stops. You'll see some shutdown or heartbeat errors in the log, or outofmemory or whatever reason for failure. You will have to restart the server - and logging continues in a new file (depending on your logging settings)

What is a Machine in Oracle Weblogic Server?

A Machine in a Oracle Weblogic server is a computer that hosts the Oracle Weblogic Server instances. Runs a supported operating system platform and it is used by Node Manager to restart a failed Managed servers.


Recommended