WebSphere v8.5 Basics
WebSphere v8.5 Basics
cover
Front cover
WebSphere Application
Server V8 Administration for
AIX
(Course code WA180 / VA180)
Student Exercises
ERC 1.2
WebSphere Education
Student Exercises
Trademarks
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International
Business Machines Corp., registered in many jurisdictions worldwide.
The following are trademarks of International Business Machines Corporation, registered in
many jurisdictions worldwide:
DB2
System p
HACMP
System x
System i
System z
V5.4.0.3
Student Exercises
TOC
Contents
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Exercises description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Verifying the image and course materials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Exercise 1. Installing IBM Installation Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Section 1: Accessing your AIX system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Section 2: Resetting the WebSphere environment . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Section 3: Logging in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Section 4: Installing IBM Installation Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Exercise review and wrap-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1-1
1-4
1-4
1-4
1-4
1-4
1-9
Contents
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
iii
Student Exercises
V5.4.0.3
Student Exercises
TOC
Contents
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
11-1
11-2
11-2
11-2
Student Exercises
Section 3: Create a deployment manager profile by using the Profile Management Tool
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-2
Section 4: Back up the Dmgr profile configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 11-17
Section 5: Federate profile1 into the cell of the deployment manager . . . . . . . . . . . 11-19
Section 6: Create a custom profile and federate it into the deployment manager cell
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11-25
Section 7: Add the IBM HTTP Server to the cell . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-31
Section 8: Add the web server to the configuration . . . . . . . . . . . . . . . . . . . . . . . . . 11-34
Section 9: Mapping modules to servers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-37
Section 10: Working with the plug-in configuration file . . . . . . . . . . . . . . . . . . . . . . . 11-40
Section 11: Test the plug-in configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-44
Exercise review and wrap-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-46
Exercise 12. Clustering and workload management . . . . . . . . . . . . . . . . . . . . . . . .12-1
Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Section 1: Resetting the WebSphere environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Section 2: Using your AIX system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Section 3: Check nodes and node agents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-2
Section 4: Creating the PlantsCluster cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-3
Section 5: Set the applications to run on the cluster . . . . . . . . . . . . . . . . . . . . . . . . . 12-11
Section 6: Create a cluster scoped JDBC resource . . . . . . . . . . . . . . . . . . . . . . . . . 12-13
Section 7: Test the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-19
Section 8: Verify session replication settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-26
Section 9: Test the application for session failover . . . . . . . . . . . . . . . . . . . . . . . . . . 12-28
Exercise review and wrap-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-31
Exercise 13. Configuring the service integration bus . . . . . . . . . . . . . . . . . . . . . . .13-1
Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
Section 1: Resetting the WebSphere environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
Section 2: Using your AIX system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
Section 3: Applications that are used in this exercise . . . . . . . . . . . . . . . . . . . . . . . . . 13-3
Section 4: The messaging environment that is created in the exercise . . . . . . . . . . . 13-6
Section 5: Setting up the service integration bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-6
Section 6: Configuring the JMS resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-23
Section 7: Installing the messaging applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-26
Section 8: Testing the applications and exploring messaging engine policies . . . . . 13-33
Section 9: Read only: Configure the scalability messaging engine policy . . . . . . . . 13-46
Exercise review and wrap-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13-49
Exercise 14. Configuring WebSphere security . . . . . . . . . . . . . . . . . . . . . . . . . . . .14-1
Exercise instructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-3
Section 1: Resetting the WebSphere environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-3
Section 2: Using your AIX system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-3
Section 3: Verify administrative security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-3
Section 4: Defining WebSphere administrative console users . . . . . . . . . . . . . . . . . . 14-4
Section 5: Authenticate to the WebSphere administrative console and test mapped users
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .14-8
Section 6: Enabling fine-grained control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14-11
vi
V5.4.0.3
Student Exercises
TOC
Contents
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
vii
Student Exercises
viii
V5.4.0.3
Student Exercises
TMK
Trademarks
The reader should recognize that the following terms, which appear in the content of this
training document, are official trademarks of IBM or other companies:
IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International
Business Machines Corp., registered in many jurisdictions worldwide.
The following are trademarks of International Business Machines Corporation, registered in
many jurisdictions worldwide:
AFS
AS/400
DataPower
developerWorks
IMS
Notes
Power
Rational
Tivoli
WPM
AIX
CICS
DB
Express
Lotus
OS/400
PowerVM
RDN
U
z/OS
alphaWorks
CloudBurst
DB2
HACMP
MVS
Passport Advantage
RACF
Redbooks
WebSphere
zSeries
Trademarks
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
ix
Student Exercises
V6.0
Student Exercises
pref
xi
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
Student Exercises
xii
V6.0
Student Exercises
pref
Exercises description
This course includes the following exercises:
Exercise 1: Installing IBM Installation Manager
Exercise 2: Installing WebSphere Application Server
Exercise 3: Installing IBM HTTP Server
Exercise 4: WebSphere Information Center installation (optional)
Exercise 5: Exploring the administrative console
Exercise 6: Assembling an application (demonstration)
Exercise 7: Installing an application
Exercise 8: Monitored directory: Drag-and-drop deployment
Exercise 9: Problem determination
Exercise 10: Using wsadmin
Exercise 11: Creating a federated cell
Exercise 12: Clustering and workload management
Exercise 13: Configuring the service integration bus
Exercise 14: Configuring WebSphere security
Exercise 15: Configuring application security
Exercise 16: Configuring SSL for WebSphere
Exercise 17: Using the performance monitoring tools
In the exercise instructions, you see each numbered step with a line
that prefixes it. You can use this line to check off each step as you
complete it to monitor your progress.
Most exercises include required sections which should always be
completed. These sections might be required before later exercises.
Some exercises also include optional sections that you can do if you
have sufficient time and want an additional challenge.
Exercises description
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
xiii
Student Exercises
xiv
V5.4.0.3
Student Exercises
AP
xv
Student Exercises
Stop
Do NOT proceed with the exercises if the ERC numbers on the course materials and
course image do not match; ask your instructor for further direction.
xvi
V6.0.2
Student Exercises
EXempty
Introduction
IBM Installation Manager overview
IBM Installation Manager is an installation management tool that
installs and maintains Installation Manager-based software packages.
It is the Eclipse-based tool that provides you the ability to install and
modify packages, search for updates, uninstall, and roll back.
Installation Manager makes it easier for you to download and install
code for a number of IBM software packages.
Starting with WebSphere Application Server V8, Installation Manager
V1.4.3.1 or later is used for installation. It replaces InstallShield
MultiPlatform (ISMP) and Update Installer that were used to install,
update, and uninstall previous versions of WebSphere Application
Server. It also replaces the functions that the Installation Factory
previously provided. Installation Manager V1.4.3.1 comes with
WebSphere Application Server V8.
Installation Manager was originally introduced to support installation of
Rational products and is currently available for all platforms. It
supports installation of WebSphere, Rational, and other products. A
single instance of Installation Manager can manage the product
lifecycle for any Installation Manager-based product from WebSphere,
Rational, Lotus, and any other brand within IBM. It provides the
following benefits:
Consistency across all platforms
Copyright IBM Corp. 2012
1-1
Student Exercises
1-2
V6.0.2
Student Exercises
EXempty
Value
root
wasadmin
web1sphere
db2inst1
was1edu
/usr/IBM-Repositories
/usr/software
/usr/IBM/WebSphere/AppServer
/usr/IBM/WebSphere/AppServer/profiles
/usr/IBM/HTTPServer
/usr/IBM/WebSphere/Plugins
/opt/IBM/db2/V9.5
1-3
Student Exercises
Exercise instructions
Section 1: Accessing your AIX system
Note
For more information about accessing your AIX lab environment, see Appendix B.
Appendix B also contains some basic information about starting terminal windows and text
editors.
Section 3: Logging in
__ 1. When you start your machine, you are prompted for a user ID and password. At this
prompt, enter:
User ID: root
Password: web1sphere
If you are already logged in, but not as root, then log off your current ID and log in as:
root
1-4
V6.0.2
Student Exercises
EXempty
non-administrator, or group. Second, you need to decide where the product files and
runtime data are going to be located.
__ 1. Locate the repository and package.
__ a. Open a terminal window by either clicking the Terminal icon on the bottom of the
screen, or expanding the Personal Applications drawer and selecting the
Terminal application.
1-5
Student Exercises
Note
Do not be concerned if your display differs slightly from the screen captures that are shown
in your exercise book. Most of the screen captures were taken from a Linux system and will
therefore have minor differences in appearance.
__ d. IBM Installation Manager opens. Since Installation Manager is not installed yet,
the Installation Manager package is selected by default. The package is ready to
install, as the status message indicates.
1-6
V6.0.2
Student Exercises
EXempty
__ e. Click Next.
__ f.
__ 2. Determine the location of the installation directory. The installation location must be
a directory that is named eclipse.
__ a. Accept /opt/IBM/InstallationManager/eclipse as the Installation
Manager Directory.
__ b. Click Next.
1-7
Student Exercises
__ b. Click Install. At the bottom of the panel, observe the progress of the installation.
End of exercise
1-8
V6.0.2
Student Exercises
EXempty
1-9
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
In this exercise, you install WebSphere Application Server Network
Deployment V8.
WebSphere Application Server relies on TCP/IP networking, so you
must have TCP/IP correctly configured, and it is important that the
host name of the machine remains unchanged.
The lab workstation should be configured appropriately. Make sure
that you know the host name of the machine because you need for this
exercise.
<variable>
<os_userid>
<was_userid>
Copyright IBM Corp. 2012
Value
root
wasadmin
Exercise 2. Installing WebSphere Application Server
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
2-1
Student Exercises
<variable>
<master_password>
<db2_userid>
<db2_password>
<IBM_repository>
<software_dir>
<was_root>
<profile_root>
<ihs_root>
<plugin_root>
<db2_root>
Value
web1sphere
db2inst1
was1edu
/usr/IBM-repository
/usr/software
/usr/IBM/WebSphere/AppServer
/usr/IBM/WebSphere/AppServer/profiles
/usr/IBM/HTTPServer
/usr/IBM/HTTPServer/Plugins
/home/db2inst1/sqllib
Requirements
2-2
V6.0.2
Student Exercises
EXempty
Exercise instructions
Section 1: Resetting the WebSphere environment
Note
If you need to reset your WebSphere environment, then see Appendix A for instructions
on how to correctly reset the environment.
2-3
Student Exercises
Information
The Installation Manager uses repositories to identify the packages or updates to install. A
repository is a location that stores data for installing, modifying, rolling back, updating, or
uninstalling packages. Each installed package has an embedded location for its default
update repository. You can add, edit, or remove repositories for use by the Installation
Manager.
By default, the Installation Manager is configured to use a service repository which is made
up of repositories at IBM.com. In this case, Internet access is required. If a machine does
not have Internet access, the Installation Manager can be configured to look for a local
repository. Updates can be downloaded and placed in a temporary directory on the
machine. The Installation Manager looks in this directory for installable updates. You must
manually configure local repositories.
2-4
V6.0.2
Student Exercises
EXempty
__ 2. The Install Packages wizard takes you through the installation process for one or
more packages. To locate the packages, you must configure the repository.
__ a. Select File > Preferences.
__ b. Select Repositories.
__ e. Click OK.
2-5
Student Exercises
__ f.
__ 3. Test the connection to the local repository. This step is more important when you
configure remote repositories and need access to the repository to complete a
product installation.
__ a. Click Test Connections.
2-6
V6.0.2
Student Exercises
EXempty
Note
Do not be concerned if your display differs slightly from the screen captures that are shown
in your exercise book. Most of the screen captures were taken from a Linux system and will
therefore have minor differences in appearance.
2-7
Student Exercises
__ b. Installation Manager lists all the packages that it finds in the configured
repositories. In this case, it searched the repository and found the following
packages. Select IBM WebSphere Application Server Network Deployment.
__ c. The Install Packages panel is updated to indicate the status for Version 8.0.0.0 to
Will be installed. Click Next.
__ d. The Licenses panel opens. You can read the license agreements for any of the
packages. Select I accept the terms in the license agreement. Click Next.
__ f.
2-8
On the Location panel, the package for WebSphere Application Server Network
Deployment V8.0 is selected along with Create a new package group. Verify
V6.0.2
Student Exercises
EXempty
__ g. Click Next.
__ h. The Features panel indicates the individual language packs for the WebSphere
Application Server runtime environment and administrative console. Keep the
default setting. Click Next.
__ i.
The Features panel lists additional features for installation. Note the default
selections. Keep the default selections (including the IBM 64-bit SDK for Java,
Version 6). Click Next.
2-9
Student Exercises
Note
Do not select the Sample application feature. This feature is added to the installation later
in this exercise.
__ j.
On the Summary panel, confirm your previous choices. Verify your information
with the following figure. You can click Back to modify any choices.
When the installation completes, the installation results are displayed at the top
of the panel. Select None in the area that indicates programs to start. Click
Finish.
V6.0.2
Student Exercises
EXempty
__ b. The Modify Packages panel is displayed. This panel lists the packages that are
installed and can be modified. Select IBM WebSphere Application Server
2-11
Student Exercises
__ c. Click Next.
__ d. On the Features panel listing individual language packs, keep the default value.
Click Next.
__ e. The Features panel lists the features for installation. Add the Sample
applications. Click Next.
V6.0.2
Student Exercises
EXempty
Information
In version 8.0, the only sample that is shipped with the product is PlantsByWebSphere
(PBW), which was updated to use Java Platform, Enterprise Edition 6 technology. The
PlantsByWebSphere sample application is available at
/usr/IBM/WebSphere/AppServer/samples after installation.
All previous samples included in version 7 that are still relevant are online along with
several new samples. You can obtain information about the samples in the WebSphere
Application Server Information Center.
__ f.
In the Summary panel, verify that the added features include the sample
applications. Click Modify.
2-13
Student Exercises
__ g. When the installation completes, the installation results are displayed at the top
of the panel. Click Finish.
V6.0.2
Student Exercises
EXempty
__ d. Click Create.
__ e. In the Environment Selection panel, select Application server. Click Next.
2-15
Student Exercises
Information
Profiles allow you to create multiple runtime environments on a system without installing
the core product files again. When using the Profile Management Tool, there are several
types of profiles that can be created:
Cell (deployment manager and a federated application server)
A cell creates two profiles: a management profile with a deployment manager
and an application server profile. The application server is federated to the cell of
the deployment manager.
Management
A management profile provides the server and services for managing multiple
application server environments. The administrative agent manages application
servers on the same machine. The Network Deployment edition also includes a
deployment manager for tightly coupled management and a job manager for
loosely coupled management of topologies that are distributed over multiple
machines. Each instance of the deployment manager defines a unique cell.
Application server
An application server environment runs your enterprise applications. An
application server is managed from its own administrative console and functions
independently from all other application servers. A new instance of a stand-alone
node with a single application server is created. Stand-alone nodes have only
one application server.
Custom profile
A custom profile contains an empty node, which does not contain an
administrative console or servers. The typical use for a custom profile is to
federate its node to a deployment manager. After federating the node, use the
deployment manager to create a server or a cluster of servers within the node.
Secure proxy (configuration-only)
A secure proxy profile is for use with a DMZ secure proxy server. You cannot
start the secure proxy server on the Network Deployment installation. This
configuration-only profile is intended only to be used to configure the profile with
the administrative console. After you configure the profile, you can export the
profile configuration and then import it into the secure proxy profile in your DMZ.
V6.0.2
Student Exercises
EXempty
__ f.
In the Profile Creation Options panel, select Advanced profile creation. This
selection allows you to specify your own values for some settings. Click Next.
__ g. In the Optional Application Deployment panel, keep the default selections. Click
Next.
__ h. In the Profile Name and Location panel, make the following modifications:
- Profile name: profile1
2-17
Student Exercises
Information
The Server runtime performance tuning settings is a new feature in version 8. The
performance monitoring infrastructure service is enabled to gather statistics so you can
further tune the server yourself. Settings include:
Standard: The standard settings are optimized for general-purpose usage with
conservative settings.
Peak: The peak settings are optimized for runtime performance in environments
where updates to applications are infrequent.
Development: The development settings are optimized for environments with
less powerful hardware and where updates to applications are frequent.
__ i.
Click Next.
__ j.
In the Node and Host Names panel, enter the following values (the default
values need to be changed):
- Node name: was8host01Node01
- Server name: server1
V6.0.2
Student Exercises
EXempty
__ k. Click Next.
__ l.
__ m. Click Next.
__ n. In the Security Certificate (Part 1) panel, accept the default selection. Click
Next.
2-19
Student Exercises
__ o. In the Security Certificate (Part 2) panel, accept the default selection. Click
Next.
__ p. In the Port Values Assignment panel, accept the default values. Click Next.
__ q. In the Web Server Definition panel, accept the default value. Do not create a web
server definition. Click Next.
__ r.
V6.0.2
Student Exercises
EXempty
__ t.
2-21
Student Exercises
__ b. The installation verification test tool runs and displays messages to indicate the
verification status. Use the scroll bar to view all messages. At the bottom of the
message list are the messages (expect some errors and warnings before the
final success messages):
V6.0.2
Student Exercises
EXempty
2-23
Student Exercises
__ f.
V6.0.2
Student Exercises
EXempty
Information
The user ID wasadmin was created during the profile creation process. It does not exist in
the operating system registry or an LDAP registry, but instead exists in a file-based registry
within the application server configuration. Now that the profile is created, security can be
reconfigured to use any user registry.
__ 3. The main page for the WebSphere Integrated Solutions Console shows up.
__ 4. Verify that the DefaultApplication is installed and is running.
__ a. Using the administrative console navigation tree, click Applications >
Application Types > WebSphere enterprise applications.
2-25
Student Exercises
V6.0.2
Student Exercises
EXempty
2-27
Student Exercises
Information
You are prompted for credentials because administrative security was enabled during the
creation of the profile. As such, all administrative functions, including backups,
administrative console access, and wsadmin scripts, require authentication.
During the rest of the labs, enter the administrative user ID and password when prompted.
The lab instructions do not always indicate this step.
Note
Do not be concerned if your display differs slightly from the screen captures that are shown
in your exercise book. Most of the screen captures were taken from a Linux system and will
therefore have minor differences in appearance.
One noticeable difference is the root directory for the application server. In the Linux screen
capture, the directories typically start with /opt. On your AIX systems, the equivalent
directories start with /usr.
V6.0.2
Student Exercises
EXempty
__ d. When the backup finishes, a message indicates the number of files that were
backed up successfully.
Information
By default, all servers on the node are stopped before the backup is made to prevent
partially synchronized information from being saved. The -nostop option can be used with
the backupConfig command to prevent the servers from being stopped before backing up
the configuration.
2-29
Student Exercises
__ a. Copy the backup file to another directory to safe keeping. Enter the following
command:
cp WebSphereConfig_<YYYY-MM-DD>.zip
/usr/software/backups/backup_profile1.zip
Information
If you need to restore the configuration directory structure at a later time, you can use the
restoreConfig command. You need to specify the name of the backup file.
The command restores the entire directory:
/usr/IBM/WebSphere/AppServer/profiles/profile1/config
__ 3. Verify that the application server is stopped. Enter the following the command:
./serverStatus.sh server1
Information
You can also run the serverStatus command with the -all option to give more details
on all application servers on the node.
V6.0.2
Student Exercises
EXempty
2-31
Student Exercises
__ b. Open and view the backupConfig.log file. This log records events that occur
when creating a backup of the configuration directory structure.
__ c. Open and view the ivtClient.log file. This logs results from the installation
verification command.
__ d. Open and view the AboutThisProfile.txt file. This file logs information about
the profile, including the <profile_root>, the profile name, the node and host
names, and a number of the ports with which the profile was configured.
V6.0.2
Student Exercises
EXempty
__ b. Open the startServer.log file and examine the contents of the file.
2-33
Student Exercises
Information
A tail utility can also be helpful when looking at log files. The tail utility makes it easier to
monitor what is being actively written to a text-based log file.
Enter: tail startServer.log
This command displays the last few lines of the file startServer.log, where
you see the startup messages from the server.
You can also use the tail -f startServer.log, which continuously updates
your panel when new messages are added to the file. This approach is more
convenient than with a text editor. Text editors show only the messages that are
written to the file at a point in time, whereas the tail -f command displays the
file contents continuously as new entries are added.
.
__ 2. Using the command rm *.log, delete all the log files in the directory
/usr/IBM/WebSphere/AppServer/profiles/profile1/logs/server1. When the
server is started, new log files are created. This step ensures that new log files are
produced.
__ 3. If it is not already started, start the WebSphere Application Server in profile1.
__ a. In a terminal window, change to
/usr/IBM/WebSphere/AppServer/profiles/profile1/bin directory and enter
the command:
./startServer.sh server1
__ b. Verify that the application server is started by entering the following command
(notice that you can specify the user name and password on the command line):
V6.0.2
Student Exercises
EXempty
Information
./serverStatus.sh server1 -username wasadmin -password web1sphereYou can also
run the serverStatus command with the -all option to provide more details on all
application servers on the node.
__ 4. After successful startup of the server, review the startServer.log file for
successful start messages.
__ a. Navigate to the directory
/usr/IBM/WebSphere/AppServer/profiles/profile1/logs/server1
__ b. Open the startServer.log file and examine the contents of the file. Look for
the message Server server1 open for e-business, which indicates the
server is ready.
__ 5. Open and view the SystemErr.log file. This log contains the standard output from
the Java virtual machine (JVM) running the application server. This file can have
numerous messages, but does not include any error messages if the server started
correctly.
__ 6. Open and view the SystemOut.log file. This log contains the standard output from
the Java virtual machine (JVM) running the application server. This file contains
more detailed messages, indicating the steps that are done during startup of the
server.
Steps that are documented in the log include security initialization, messaging
initialization, registering resources in the JNDI namespace, EJB initialization, web
module initialization, and HTTP transport initialization. The log also contains
messages from application System.out print line code.
Information
You can look again at the messages in the SystemOut.log or SystemErr.log files as
you use the server and perform more functions. It might be a good idea to keep a tail -f
on these files for the duration of the labs.
ok
2-35
Student Exercises
__ 7. Stop the WebSphere Application Server, profile1. You can provide the user name
and password on the command line or through the dialog box when prompted.
__ a. In a terminal window, change to
/usr/IBM/Websphere/AppServer/profiles/profile1/bin and enter the
command:
./stopServer.sh server1
__ c. Verify that the application server is stopped by entering the following command:
./serverStatus.sh server1
V6.0.2
Student Exercises
EXempty
End of exercise
2-37
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
A main theme in this release is the separation of installation from
configuration. IBM Installation Manager is the installation technology of
choice. The Installation Manager is a program that helps you install,
import, update, modify, and uninstall packages on your computer. The
Installation Manager also provides tools for managing licenses for the
packages that it installs, and for updating and modifying packages. If
the Installation Manager is installed on your computer, it is updated to
ensure that the computer has the latest version installed.
In this exercise, you use IBM Installation Manager to install IBM HTTP
Server and WebSphere Application Server plug-ins. The plug-ins are
configured with the Web Server Plug-ins Configuration Tool (PCT),
which represents new configuration tool support added in version 8. In
WebSphere Application Server V8, installation and configuration are
separated into two different steps so that the HTTP Server and the
Plug-ins installers do not offer the configuration steps that existed in
version 7. Instead, administrators use the Web Server Plug-ins
Configuration Tool (PCT) to configure various web server plug-ins.
Administrators can also configure IBM HTTP Server Admin server.
3-1
Student Exercises
Value
root
wasadmin
web1sphere
db2inst1
was1edu
/usr/IBM-Repositories
/usr/software
/usr/IBM/WebSphere/AppServer
/usr/IBM/WebSphere/AppServer/profiles
/usr/IBM/HTTPServer
/usr/IBM/WebSphere/Plugins
/opt/IBM/db2/V9.5
Requirements
Completion of the Installing IBM Installation Manager and Installing
WebSphere Application Server exercises.
3-2
V6.0.2
Student Exercises
EXempty
Exercise instructions
Section 1: Resetting the WebSphere environment
Note
If you need to reset your WebSphere environment, then see Appendix A for instructions
on how to correctly reset the environment.
3-3
Student Exercises
__ b. Navigate to /opt/IBM/InstallationManager/eclipse/
__ c. Enter ./IBMIM to start IBM Installation Manager.
3-4
V6.0.2
Student Exercises
EXempty
3-5
Student Exercises
3-6
V6.0.2
Student Exercises
EXempty
__ e. Click OK.
__ 2. Test the connection to the local repository. This step is more important when you
configure remote repositories and need access to the repository to complete a
product installation.
__ a. Click Test Connections.
__ c. Click OK.
3-7
Student Exercises
Note
Do not be concerned if your display differs slightly from the screen captures that are shown
in your exercise book. Most of the screen captures were taken from a Linux system and will
therefore have minor differences in appearance.
One noticeable difference is the root directory for the application server. In the Linux screen
captures, the directories typically start with /opt. On your AIX systems, the equivalent
directories start with /usr.
__ b. From the list of installation packages, select only IBM HTTP Server for
WebSphere Application Server. This action also selects Version 8.0.0.0.
3-8
V6.0.2
Student Exercises
EXempty
__ c. Click Next. This action retrieves and validates the package files from the
repository.
__ d. Select I accept the terms in the license agreement. Click Next.
__ e. On the Location panel, select Create a new package group. It is selected
already.
__ f.
__ g. Click Next.
__ h. On the next panel, accept the defaults (including IBM HTTP Server 64-bit with
Java, Version 6). Click Next.
__ i.
On the Features panel for Configuration for IBM HTTP Server for WebSphere
Application Server 8.0.0.0, enter 80 as the HTTP port.
__ j.
Click Next.
__ k. On the Summary panel, verify that IBM HTTP Server for WebSphere
Application Server 8.0.0.0 is the package for installation. Click Install.
__ l.
__ n. Click Finish.
3-9
Student Exercises
__ c. Click Next. This action retrieves and validates the package files from the
repository.
__ d. Select I accept the terms in the license agreement. Click Next.
__ e. Select Create a new package group.
__ f.
__ g. Click Next.
__ h. On the Features panel, select Web Server Plug-ins for WebSphere
Application Server 8.0.0.0 and IBM 64-bit Runtime Environment for Java,
Version 6 as the feature for installation.
__ i.
Click Next.
__ j.
V6.0.2
Student Exercises
EXempty
__ l.
Click Finish.
3-11
Student Exercises
__ c. Click Next. This action retrieves and validates the package files from the
repository.
__ d. Select I accept the terms in the license agreement. Click Next.
V6.0.2
Student Exercises
EXempty
__ f.
On the Features panel, select Web Server Plug-ins Configuration Tool. Clear
any other check boxes.
__ g. Click Next.
3-13
Student Exercises
__ h. On the Summary panel, verify that the only package that is listed under the
WebSphere Customization Toolbox 8.0.0.0 is the Web Server Plug-ins
Configuration Tool.
__ i.
Click Install.
__ j.
V6.0.2
Student Exercises
EXempty
3-15
Student Exercises
__ 2. Since the installed web server plug-in that you want to use is not in the list, you must
add it. Add the location of the web server plug-in runtime files.
__ a. In the Web Server Plug-in Runtime Locations panel, click Add.
__ b. In the Add Web Server Plug-in Location panel, enter the following values:
- In the Name field, enter: webserver1
- In the Location field, Browse to /usr/IBM/WebSphere/Plugins
V6.0.2
Student Exercises
EXempty
__ f.
__ g. In the Web Server Architecture Selection panel, select 64 bit. Click Next.
3-17
Student Exercises
__ h. In the Web Server configuration File Selection panel, enter the following
values:
- Select the existing IBM HTTP Server httpd.conf file:
/usr/IBM/HTTPServer/conf/httpd.conf
- Specify the Web server port: 80
__ i.
Click Next.
V6.0.2
Student Exercises
EXempty
__ j.
In the Setup IBM HTTP Server Administration Server panel, enter the
following values (Note: you need to expand the dialog box to see all the fields):
- Verify that the Setup IBM HTTP Server Administration Server check box is
selected.
- HTTP Administration Port: 8008
- Verify that the Create a user ID for IBM HTTP Administration Server
authentication check box is selected.
- User ID: ihsadmin
- Password: web1sphere
- Confirm Password: web1sphere
__ k. Click Next.
3-19
Student Exercises
__ l.
On the Setup IBM HTTP Server Administration Server panel, enter ihs as
the User ID and Group fields. This option allows you to create a unique user ID
and group for IBM HTTP Server administration.
__ m. Click Next.
__ n. In the Web Server Definition Name panel, verify that the unique name for the
web server is webserver1 and click Next.
V6.0.2
Student Exercises
EXempty
__ o. On the Configuration Scenario Selection panel, select the Remote option and
enter the host name: was8host01
Click Next to continue.
Note
For a remote configuration, the Web Server Plug-ins Configuration Tool configures the web
server to use the plugin-cfg.xml file that is maintained on the web server machine in the
plugins_root/config/web_server_name directory. This file requires periodic
propagation. Propagation means copying the current plugin-cfg.xml file from the
application server machine to replace the
plugins_root/config/web_server_name/plugin-cfg.xml file.
For a local configuration, the Web Server Plug-ins Configuration Tool configures the web
server to use the plugin-cfg.xml file that is within the application server profile. The
stand-alone application server regenerates the
profile_root/config/cells/cell_name/nodes/web_server_name_node/servers/
web_server_name/plugin-cfg.xml file whenever a change occurs in the application
server configuration that affects deployed applications.
3-21
Student Exercises
__ r.
V6.0.2
Student Exercises
EXempty
Section 8: Confirm and test installation of IBM HTTP Server and plug-ins
__ 1. Verify that IBM HTTP Server is started. Note the output from each command.
__ a. From a terminal window, enter: ps -ef | grep httpd
was8host01:/opt/IBM/WebSphere/Toolbox/WCT # ps -ef | grep http
root 29457 20740 0 17:39 pts/1 00:00:00 grep httpd
__ b. If no httpd processes are running from <ihs_root>, start both the HTTP Server
and the HTTP Administrative Server:
- Navigate to /usr/IBM/HTTPServer/bin
- Run: ./apachectl start
No output from apachectl command
- Run: ./adminctl start
was8host01:/opt/IBM/HTTPServer/bin # ./adminctl start
__ 2. ./adminctl start: admin http startedCheck the status of the IBM HTTP
Server with a browser.
__ a. Open a Firefox browser. There are two easy ways to start Firefox on AIX. The
first is to enter firefox in a terminal window. The second is to click the Firefox
icon in the Personal Applications drawer.
3-23
Student Exercises
V6.0.2
Student Exercises
EXempty
3-25
Student Exercises
__ b. Open the httpd.conf file. This file contains configuration data for the IBM
HTTP Server.
__ c. Scroll to the bottom of this file and notice the last two lines. They define the
module that is loaded as the WebSphere plug-in and define the path to the
plugin-cfg.xml file.
__ d. Close the file when you are finished with your review.
__ e. Notice the httpd.conf.default file. This file contains the original configuration
parameters. It can be copied, if you need to restore or use the original
configuration parameters.
__ f.
Open the admin.conf file. This file contains configuration data for the
administration server. Close the file when you are finished with your review.
__ g. Notice the admin.conf.default file. This file contains the original configuration
parameters. It can be copied, if you need to restore or use the original
administrative configuration parameters.
V6.0.2
Student Exercises
EXempty
Note
The creation of the symbolic link allows the contents of the WAS8_Supplemental directory
to be available under htdocs. That in turn, makes the contents accessible through the web
server.
3-27
Student Exercises
__ e. Enter: http://localhost/WAS8_Sup/repository.config
Click OK.
__ f.
Click Test Connections. Verify that you receive a message that indicates the
selected repositories are connected.
V6.0.2
Student Exercises
EXempty
__ b. Although the local repositories are all removed, the Installation Manager still
displays the contents of the Supplemental repository because the HTTP
repository is defined and is being used.
End of exercise
3-29
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
IBM information centers provide online and offline approaches to
searching and viewing product information. In this exercise, you use
the traditional online WebSphere Application Server Information
Center to search and view topics that pertain to WebSphere
Application Server Network Deployment. IBM manages and maintains
the information center content, so the most current product information
is available.
There is also an option to configure an offline information center. This
configuration is done by adding content plug-ins to the plugins
directory of an Eclipse-based tool, such as IBM Assembly and Deploy
Tools. Product content plug-ins are downloaded from IBM. Therefore,
it is your responsibility to periodically download the current product
plug-ins. When you start the help system, the Eclipse tool scans the
plugins directory for new plug-ins (content) to load.
4-1
Student Exercises
Exercise instructions
Section 1: Resetting the WebSphere environment
Note
If you need to reset your WebSphere environment, then see Appendix A for instructions
on how to correctly reset the environment.
4-2
V6.0.2
Student Exercises
EXempty
Note
Since the online information center is constantly updated, the contents you see might differ
from the contents that existed when this course was created.
4-3
Student Exercises
__ 2. There are three tabs in the middle of the window: Learning, Tasks, and
Community and Support. Numerous resources are consolidated on one page for
your convenience.
- Click the Learning tab. This tab provides links to various education
resources.
4-4
V6.0.2
Student Exercises
EXempty
__ 3. Click the Tasks tab. This tab lists common tasks that an administrator does (only a
partial list is shown in the figure).
4-5
Student Exercises
__ c. Click Create WebSphere profiles. The new page provides detailed information
about the particular task or topic.
4-6
V6.0.2
Student Exercises
EXempty
4-7
Student Exercises
4-8
V6.0.2
Student Exercises
EXempty
__ c. In the New Scope panel, make the following selections in the Topics section:
Information home: WebSphere Application Server
Network Deployment (All operating systems), Version 8.0
WebSphere Application Server (Distributed operating systems),
Version 8.0
Click OK.
4-9
Student Exercises
__ e. The contents of the information center list the choices you made.
V6.0.2
Student Exercises
EXempty
__ b. The Search Results panel displays the expanded results of the search.
__ c. Click the white page icon to toggle the expanded results of the search.
4-11
Student Exercises
V6.0.2
Student Exercises
EXempty
4-13
Student Exercises
__ c. This action displays a page with detailed information about the selected task.
Scroll down the page to view all the content on the page.
__ 7. Using an asterisk as the wildcard character, find information about the term
application. An asterisk (*) is used for multiple unknown or variable characters in a
term. In this case, the search returns entries such as application server,
applications, ApplicationProfile, and many other entries.
__ a. In the Search field, type: applicatio*
Click the Go icon.
V6.0.2
Student Exercises
EXempty
__ 8. Using a question mark as a wildcard character, find different information about the
term application. A question mark (?) is used for a single unknown or variable
character in a term. In this case, the returns application, but not applications or
ApplicationProfile.
__ a. In the Search field, type: applicatio?
Click the Go icon.
4-15
Student Exercises
__ 9. You can use Boolean operators (AND, OR, NOT) in searches to make them more
efficient. Using Boolean operators, locate information about virtual hosts and other
virtual items.
__ a. In the Search field, type: virtual OR hosts
Click the Go icon. Using the OR operator widens the search to contain either the
term virtual or the term host.
V6.0.2
Student Exercises
EXempty
4-17
Student Exercises
__ b. Keep the default values for the new bookmark. Click Add.
V6.0.2
Student Exercises
EXempty
__ c. Select Bookmarks from the browser toolbar. The newly created bookmark is
added to the end of the bookmark list.
4-19
Student Exercises
__ c. Click one of the links in the index listing. The content is displayed in the content
panel.
V6.0.2
Student Exercises
EXempty
You are not able to run this section in your lab environment. Watch the
demonstration instead. These steps are presented for reference only.
4-21
Student Exercises
__ 3. Copy the Edge Components Information Center plug-in to the plugins directory of
IBM Assembly and Deploy Tools for WebSphere Administration.
__ a. In Windows Explorer, navigate to
C:\softare\InformationCenterPlugin\edge
__ b. Copy the entire contents of the directory to C:\Program Files\IBM\SDP\
plugins
__ 4. Start IBM Assembly and Deploy Tools and verify that the WebSphere Application
Server Network Deployment Information Center plug-in works correctly in the help
system of IBM Assembly and Deploy Tools.
__ a. Select Start > Programs > IBM Software Delivery Platform > IBM Assembly
and Deploy Tools for WebSphere Administration 8.0 > IBM Assembly and
Deploy Tools for WebSphere Administration.
__ b. In the Workspace Launcher window, keep the default workspace. Click OK.
__ c. After IBM Assembly and Deploy Tools opens, select Help > Help Contents.
V6.0.2
Student Exercises
EXempty
__ d. In the Contents pane, the documentation for the three products is added.
__ f.
4-23
Student Exercises
__ 8. Close IBM Assembly and Deploy Tools for WebSphere Administration. Click
OK when you are prompted to exit.
Information
There might be occasions when you want to create customized content for your information
center. For example, you might have instructions or procedures for administering resources
that are specific to your company. In this case, you can either add the content to an existing
information center or create an information center that is composed of your custom
content.
When customized content is needed, the Toolkit for Custom and Reusable Solution
Information (TKCARSI) can be used to assemble and deploy a customized information
center. TKCARSI is only used to assemble and deploy the content. Content can be in the
form of plug-ins, documents, or graphics. Deployment can be local or to a remote server.
TKCARSI can be downloaded from IBM alphaWorks at:
http://www.alphaworks.ibm.com/tech/tkcarsi
Follow the instructions from alphaWorks to unpack and install the toolkit files to your local
system.
This section provides a simple example of using the Toolkit for Custom and Reusable
Solution Information to assemble and deploy customized content. The example assumes
that you unpacked the toolkit files.
__ 1. Start the Toolkit for Custom and Reusable Solution Information.
__ a. Open a command window and navigate to the directory where you unpacked
TKCARSI. The directory that is used in this example is C:\tkcarsi1.5.
__ b. Run the following script:
run.bat
V6.0.2
Student Exercises
EXempty
__ 2. Create a solution information project. Projects contain the artifacts to create and
deploy a customized information center.
__ a. Select File > New > Solution information project.
__ b. Enter WAS ND Information as the Project name.
__ c. Click Finish.
Copyright IBM Corp. 2012
4-25
Student Exercises
__ d. In the Navigation Tree tab, the new project is displayed as a table of contents
with topics listed beneath.
__ c. Close the Browser Title tab. Click Yes when asked to save the changes.
__ 4. To add content to the help system, you must add one or more plug-ins to the project.
Plug-ins are obtained directly from IBM, or an information development team
develops them separately. In this example, the information center plug-ins for
WebSphere Application Server are used. The plug-ins are added to the project
V6.0.2
Student Exercises
EXempty
through the book tab. Books can also contain other content such as documents,
graphics, and links. Add a book to the project.
__ a. From the explorer view in the upper left, select the Books tab and click the Add
Books icon.
Click OK.
4-27
Student Exercises
__ c. Click OK.
__ 5. Add book content to the highest level of the navigation tree.
__ a. Drag nav_tasks.xml to 0 WAS ND Information.
__ 6. To deploy the customized information center, you must package and export the
project.
__ a. Select Information Center > Export.
V6.0.2
Student Exercises
EXempty
__ e. Click Finish. It takes several minutes to compress and export the project.
__ 7. The newly created help system is ready. You can extract and run the newly created
help system on a local system or a remote system. In this example, the newly
created help system is extracted and then runs on a local system.
__ a. Using Windows Explorer, navigate to C:\tkcarsi1.5 and locate WAS ND
Information_package.zip.
__ b. Using the standard operating system tools, extract the compressed file to the
current directory.
__ c. Using Windows Explorer, navigate to C:\tkcarsi1.5\
WAS ND Information_package.
4-29
Student Exercises
__ d. Run help_start.bat. After a few moments, a new browser opens with the
newly created help system.
__ e. Notice that the browser title and contents are customized. In the Contents pane,
expand WAS ND Information. Topics for the content you loaded in the project
are displayed.
V6.0.2
Student Exercises
EXempty
__ f.
Expand any of the topic links. Click any link to display the content of the topic.
__ g. Exit from the Toolkit for Custom and Reusable Solutions Information.
__ h. Run the help_end.bat script.
__ i.
End of exercise
4-31
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
In this exercise, you explore the WebSphere Application Server V8
configuration. Exploration includes starting the server and browsing
through some of the configuration files. You also start and explore the
WebSphere administrative console.
The application server should already be installed and tested, and you
should be able to successfully start the server.
The application server runs as a single JVM, including all shared
services and the containers to run applications.
The WebSphere administrative console provides a graphical view of
the configuration and includes forms and wizards to make it easier to
perform configuration tasks.
Requirements
To do this exercise, you must have a working server and WebSphere
administrative console.
5-1
Student Exercises
Exercise instructions
Section 1: Resetting the WebSphere environment
Note
If you need to reset your WebSphere environment, then see Appendix A for instructions
on how to correctly reset the environment.
5-2
V6.0.2
Student Exercises
EXempty
Note
Do not be concerned if your display differs slightly from the screen captures that are shown
in your exercise book. Most of the screen captures were taken from a Linux system and will
therefore have minor differences in appearance.
One noticeable difference is the root directory for the application server. In the Linux screen
captures, the directories typically start with /opt. On your AIX systems, the equivalent
directories start with /usr.
__ c. After a successful startup of the server you see the message Server server1
open for e-business, which indicates that the server is ready.
Information
If the server does not start, look at the startServer.log in the
<profile_root>/profile1/logs/server1 directory.
5-3
Student Exercises
5-4
V6.0.2
Student Exercises
EXempty
__ b. Examine the files within the profile config directory, which can be found under
<profile_root>/profile1
5-5
Student Exercises
__ c. A few important files that are contained in the config directory are:
<cell> is the cell name
<node> is the node name
<server> is the server name
- Cell-wide resources
config/cells/<cell>/resources.xml
- Node-specific resources
config/cells/<cell>/nodes/<node>/resources.xml
- Server-specific resources such as JDBC and JMS providers
config/cells/<cell>/nodes/<node>/servers/<server>/resources.xml
- Global security settings
config/cells/<cell>/security.xml
- Virtual hosts
config/cells/<cell>/virtualhosts.xml
- Applications and endpoints for a node
config/cells/<cell>/nodes/<node>/serverindex.xml
- Configuration of a server
config/cells/<cell>/nodes/<node>/servers/<server>/server.xml
Information
You must not edit these XML files manually; instead you must use the administrative
console or wsadmin command-line tool to make configuration changes that affect these
files.
5-6
V6.0.2
Student Exercises
EXempty
5-7
Student Exercises
Information
In a federated cell, you always use the administrative console that is connected to the
deployment manager so that changes are synchronized across the cell. In a stand-alone
application server, you connect directly to the administrative console on the server.
5-8
V6.0.2
Student Exercises
EXempty
__ 2. Enter wasadmin for the User ID and web1sphere for the Password. Click Log in.
Information
If security is active, you must log in using a valid user ID and password. If administrative
security was disabled, the user ID you enter here would not matter, as it is used to track
configuration changes.
A workspace is saved for each user, which includes unsaved configuration changes and
navigation preferences.
5-9
Student Exercises
Banner: This area is the top of the administrative console. It shows a welcome
message for your user ID. It shows links for logging out of the administrative
console and accessing product information.
Navigation tree: This area is the left frame of the administrative console. It
shows the types of information you can configure. There are 13 areas:
Guided activities
Servers
Applications
Services
Resources
Security
Environment
System administration
Users and groups
Monitoring and tuning
Troubleshooting
Service integration
UDDI
There is also a Welcome link, which takes you back to the main work area home
page.
Work area: This area is the right frame of the administrative console. It shows
the pages to create or change configuration information.
The work area of home shows the installed product version.
Note
Firefox allows you to increase the font size if your display is too small. To increase the font
size, use control + (plus) or the menu option View > Text Size > Increase. To decrease
the font size, use control - (minus) or View > Text Size > Decrease.
V6.0.2
Student Exercises
EXempty
5-11
Student Exercises
__ 3. Using My tasks allows you to create and edit a list of tasks to view in the navigation
tree. The My tasks selection is especially useful to customize the navigation to
show only the tasks that you use most often.
__ a. Select My tasks from the menu in View.
__ b. There are no tasks currently selected. Click Add tasks to add a task to the view.
__ c. The work area shows the tasks that you can select to customize the My tasks
view in the navigation tree.
__ d. Check the boxes for Servers, Applications, and Resources. Click Apply.
V6.0.2
Student Exercises
EXempty
__ e. After applying your selections, your customized task list is seen in the navigation
tree.
__ f.
Continue to explore and customize the My tasks view and add additional tasks.
__ g. When completed, click Deselect All to remove all tasks. Click Apply.
__ h. Select All tasks from the View menu.
5-13
Student Exercises
- Connecting to a database
- Routing requests through a web server to an application server
Information
In the federated environment, the guided activities include:
- Connecting to a database
- Routing requests through a web server to an application server
- Configuring a cluster and configuring highly available applications
V6.0.2
Student Exercises
EXempty
5-15
Student Exercises
Information
In the federated environment, you can also manage:
Generic servers
Proxy servers
Version 5 JMS servers
Clusters
Cluster topology
Generic server clusters
Core groups
Information
For some other collection pages, an additional option, Scope, is presented. An example of
scope is seen later.
V6.0.2
Student Exercises
EXempty
The filter feature allows you to use wildcards to match only the objects you want to
work with if there are many objects of the same type. You can select a table column
and specify the text to match.
Information
This option rarely needs to be used unless there are many items.
5-17
Student Exercises
__ 4. Click server1.
The configuration of server1 is seen. This page is known as a details page. There
are two pages, each with a tab at the top:
- Runtime
Runtime lists the current information that the running server uses.
- Configuration
Configuration lists the saved settings that are used when the server is next
started.
V6.0.2
Student Exercises
EXempty
Some basic configuration settings are shown under General Properties, including
the Classloader policy and the Class loading mode.
For a description of any of the settings, click More information about this page in
the Help box. The Help section is on the far right of the screen. On some screens, it
is necessary to scroll to the right to see the Help section.
5-19
Student Exercises
__ 9. At the top of the page, there is a breadcrumb trail showing the pages that you
visited.
__ 10. Click server1 from the breadcrumb trail to return to the server1 configuration page.
V6.0.2
Student Exercises
EXempty
__ 11. Under Communications, expand Ports. The TCP/IP ports that server1 uses are
listed.
5-21
Student Exercises
__ 12. Click the Details link to get additional information about these ports.
V6.0.2
Student Exercises
EXempty
__ 19. se the commands ps -ef | grep java, and verify that the process ID shown
matches the PID for the java.exe process in the Processes list.
5-23
Student Exercises
__ 3. Click DefaultApplication
V6.0.2
Student Exercises
EXempty
This page shows the general properties of the application with links to a number of
additional properties pages such as Details, Web Module, and Enterprise
JavaBeans Properties. It also shows a References page.
__ 4. Under Modules, click Manage Modules.
You see one web module, Default Web Application; one EJB module, Increment
EJB module; and the servers with which they are associated.
__ 5. Click the Default Web Application module.
A detail page shows the general properties that are associated with the deployment
of the web module.
__ 6. Click Manage Modules in the breadcrumb trail and select the Increment EJB
module.
A detail page shows the general properties that are associated with the deployment
of the EJB module.
Virtual Hosts
Update global web server plug-in configuration
WebSphere Variables
Shared Libraries
Replication Domains
Naming
5-25
Student Exercises
You can define additional virtual hosts or modify default_host to support additional
host-port combinations.
__ 5. Click Virtual Hosts in the breadcrumb trail to return to the Virtual Hosts page.
__ 6. Click admin_host and then click Host Aliases.
__ 7. Examine the admin_host virtual host and write down the port numbers that are
associated with this virtual host: _________________________
Note
The browser accesses the administrative console on one of the ports that are associated
with the admin_host virtual host.
__ 8. In the administrative console navigation tree, under the Environment section, click
WebSphere variables.
The work area of a WebSphere variables collection page is seen. This page
includes the scope feature because variables can be defined for a cell, node, or
server. A menu of all available scopes is provided to narrow the list of variables that
are based on scope.
__ 9. From the scope menu, select scope Cell=<cellname>. How many variables are
defined for the cell? _______
__ 10. From the scope menu, select scope Node=<nodename>. How many variables are
defined for the node? ________
If there are more than the maximum rows (20 by default), a Next button is shown to
allow you to see the additional entries.
Notice that many variable values include references to other variables, for example,
${USER_INSTALL_ROOT}.
5-26 WebSphere Application Server V8 Administration
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V6.0.2
Student Exercises
EXempty
Schedulers
Object pool managers
JMS
JDBC
Resource adapters
Asynchronous beans
Cache instances
Mail
URL
Resource environment
These settings can be defined at the cell, node, or server level so there is a scope
selection option available.
A collection page lists queue connection factories (if there are any defined). A queue
connection factory is used to create connections to the associated JMS provider of
JMS queue destinations, for point-to-point messaging.
A collection page lists topic connection factories (if there are any defined). A topic
connection factory is used to create connections to the associated JMS provider of
JMS topic destinations, for publish/subscribe messaging.
5-27
Student Exercises
V6.0.2
Student Exercises
EXempty
Information
The administrative console session expiration script that you use in this exercise is found in
the information center by searching for changing the console session expiration.
5-29
Student Exercises
V6.0.2
Student Exercises
EXempty
Note
The first time wsadmin is run, the environment is set up. There are several messages
about processing new jar. These messages are expected the first time that wsadmin is
run.
Information
In the commands above, the username and password are specified on the command line.
Administrative scripts, such as wsadmin, support specifying the user name and password
on the command line, in the properties file, or through prompting (GUI or command line).
5-31
Student Exercises
Note
The wsadmin tool can be used to run scripts. You learn more about wsadmin later in the
course.
End of exercise
V6.0.2
Student Exercises
EXempty
5-33
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
In this exercise, you assume the role of the application assembler. The
developers responsible for bean development provided you with the
.jar files that contain the code for the Enterprise JavaBeans. The
developers responsible for the presentation design gave you the .war
Copyright IBM Corp. 2012
6-1
Student Exercises
files that contain the HTML pages, JSPs, and servlets. It is now your
task to take these pieces and assemble them into an EAR file that can
be installed in the WebSphere Application Server.
The application developers provided the files for this application. The
application is made up of:
One Java utility.jar file. The application uses the code in this
file.
One web module .war file that contains the servlets, JavaServer
Faces (JSF) files, Enterprise JavaBeans (EJB) files, and
presentation (HTML and graphics) files, along with a deployment
descriptor.
In some cases, you might also be given a resource adapter archive
(RAR) module. For this exercise, however, there are no resource
adapter archive modules.
Requirements
To complete this exercise, you need the IBM Assembly and Deploy
Tools for WebSphere Administration. This tool is used to complete the
6-2
V6.0.2
Student Exercises
EXempty
6-3
Student Exercises
Exercise instructions
Section 1: Lab demonstration information
This exercise uses the IBM Assembly and Deploy Tools for WebSphere
Administration, which is not available on AIX. It is therefore not possible to go through
these steps on your lab workstation. Instead, a demonstration is available at the following
URL:
https://www.ibm.com/developerworks/mydeveloperworks/wikis/home?lang=en#/wiki/
WebSphere%20Education%20Wiki/page/Course%20Demonstrations
Use your local browser to run the Assemble demonstration. You can follow along with the
instructions.
You are not able to do this section in your lab environment. Watch the demonstration
instead. These steps are presented for reference only.
Section 3: Start the IBM Assembly and Deploy Tools for WebSphere
Administration
__ 1. Click Start > Programs > IBM Software Delivery Platform > IBM Assembly and
Deploy Tools for WebSphere Administration 8.0 > IBM Assembly and Deploy
Tools for WebSphere Administration to start IBM Assembly and Deploy Tools.
IBM Assembly and Deploy Tools starts by asking you which directory to use for its
workspace. This workspace is used during the life of the project. Each project can
have its own separate workspace.
6-4
V6.0.2
Student Exercises
EXempty
__ 3. You are in the Java EE perspective to begin assembling the application. This
perspective is the default, and it is the title of the workbench.
__ 4. The Enterprise Explorer view shows all the modules that are currently loaded in
the workspace (none currently). As you add modules, they show in the
corresponding folders.
The empty area on the upper middle part of the window is where the different editors
open and show the contents of the selected items on the other views. This area is
called the editor pane.
Below the editor pane is a multipurpose pane that contains several views. One of
the views in the multipurpose pane is the Problems view, which is in the foreground
of the multipurpose pane. It contains any outstanding errors that need to be
resolved. This space is shared with several stacked views. You can select a view by
its tab at the top of the pane. These additional views are required during this
exercise.
6-5
Student Exercises
Information
This new workspace has no servers defined. An installed server needs to be defined in the
workspace so its runtime libraries are added to new projects created in the workspace. In
addition, the selected Target runtime environment defines where applications are
deployed to, when asking assembly and deploy to run an application on a server.
__ c. Click New Runtime to the right of Target Runtime to define a new server.
6-6
V6.0.2
Student Exercises
EXempty
6-7
Student Exercises
__ f.
__ g. Click Finish.
6-8
V6.0.2
Student Exercises
EXempty
__ h. Make sure that the Project name is still set to PlantsByWebSphere. Click Next.
6-9
Student Exercises
__ i.
__ j.
Information
You can safely ignore the error on the PlantsByWebSphere project. What does this error
say?
V6.0.2
Student Exercises
EXempty
6-11
Student Exercises
__ 2. From the Import dialog, select Java EE Utility Jar and click Next.
V6.0.2
Student Exercises
EXempty
__ 3. The EAR project is PlantsByWebSphere, and Copy utility JARs into an existing
EAR from an external location must be checked. Click Next.
6-13
Student Exercises
V6.0.2
Student Exercises
EXempty
Information
Double-clicking a module (the second entry) on the Enterprise Explorer view opens its
deployment descriptor (if it exists) in a specialized editor. Deployment descriptor editors
have tabs along the bottom of the pane to give you access to the various sections of the
file. Using these editors makes working with deployment descriptors much easier.
If you change anything on a deployment descriptor, or any other file, you see an asterisk on
the tab where its name is shown at the top of the editor pane. The asterisk indicates that
the file has changes and needs to be saved. Do not save any changes that you make, and
close the EJB deployment descriptor in the editor.
6-15
Student Exercises
V6.0.2
Student Exercises
EXempty
6-17
Student Exercises
V6.0.2
Student Exercises
EXempty
__ 1. Right-click in the empty Servers view; then select New > Server from the menu.
6-19
Student Exercises
__ 2. In the Define a New Server dialog, accept the default options. Click Next.
V6.0.2
Student Exercises
EXempty
__ 3. Type the password web1sphere in the WebSphere Server Settings dialog. Click
Finish.
6-21
Student Exercises
Information
Creating WebSphere Application Server V8.0 in the Servers view allows you to test your
application on an existing instance of the WebSphere runtime environment directly from
IBM Assembly and Deploy Tools. You can easily install enterprise applications from the
menu by right-clicking WebSphere Application Server v8.0 and selecting Add and
Remove Projects from the menu.
You are not going to run through a test at this stage. There is some additional configuration
of the environment that needs to be done. You are going to test the Plants application in a
later exercise.
V6.0.2
Student Exercises
EXempty
In this section, you define a JDBC provider and data source for the PlantsByWebSphere
application. Both of these resources are defined at the application scope and visible only to
the application.
__ 1. Open the Server Deployment view.
__ a. Right-click PlantsByWebSphere; then select Java EE > Open WebSphere
Application Server Deployment.
6-23
Student Exercises
__ 2. Review the existing Derby JDBC provider. Derby is the database that the enhanced
EAR file uses.
__ a. At the top of the WebSphere Application Server Deployment view, notice the
Derby JDBC Provider (XA) in the JDBC provider list. You can look at this
configuration by clicking Edit.
__ 3. Create the data source. The data source is where you can define the specifics about
the back-end resource that is used. In this case, it provides the details for accessing
the PLANTS database (for example, data source name, JNDI name, J2C
authentication alias, database name, database host name).
__ a. Scroll to the top of the editor. Click the Derby JDBC Provider (XA) entry. Click
Add next to the Data source defined list.
V6.0.2
Student Exercises
EXempty
__ b. In the Create JDBC Provider window, select Derby JDBC Provider (XA) as the
JDBC provider type.
__ c. Click Next.
__ d. On the next page, enter the properties of the data source. Enter the following
information in the fields as provided. Leave default values for all other fields.
Table 1: Data Source data
Field name
Value
Name
Plants
JNDI name
jdbc/PlantsByWebSphereDataSource
Description
Plants data source
Use this data source in
container-managed
The box is checked.
persistence (CMP).
6-25
Student Exercises
__ e. Click Next.
__ f.
For a data source, there are multiple properties that must be defined to access a
database. The fields can be set by clicking the field name and then entering the
value at the bottom of the wizard screen. For the derby database, the only field
V6.0.2
Student Exercises
EXempty
that needs to be set is the databaseName. Set the databaseName field to:
PLANTS
__ g. Click Finish.
__ 4. Save your changes. From the main menu, select File > Save (or press Ctrl-S).
Close the WebSphere Application Server Deployment tab.
6-27
Student Exercises
Information
These resource settings are saved within the EAR file in files under the
META-INF\ibmconfig folder. These files are not part of the Java EE 6 specification;
instead, WebSphere Application Server V8 uses these files for attributes that the
specification does not provide. This type of enterprise archive is called an enhanced EAR
file.
Look at the data that is contained in the resources.xml file. Typically this information is
defined in the server and is required before the enterprise application is run. In the
enhanced EAR file, this configuration data is stored with the application. These
enhancements are useful for development and testing, but developers do not use them
beyond testing. The enhanced EAR runs contrary to the separation of roles in Java EE.
Close the resources.xml file and do not save any changes.
V6.0.2
Student Exercises
EXempty
6-29
Student Exercises
__ c. In the Destination field, change the name of the EAR file to:
EnhancedPlantsByWebSphere.ear
Clear the check box for Optimize for a specific server runtime.
Information
It is not always obvious when an EAR includes application scoped resources. To make the
fact clearer, this exercise includes the word enhanced as part of the EAR file name. This
convention makes it clear to anyone who might be deploying the EAR file in the future that
this EAR file includes enhancements.
Deploying an enhanced EAR file without realizing that application scoped resources are
included can cause confusion.
End of exercise
V6.0.2
Student Exercises
EXempty
6-31
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
In this exercise, you install the PlantsByWebSphere enterprise archive
(EAR) file that was assembled with the assembly and deploy tool. The
EAR file contains all the application modules, and also contains the
definition of other resources that the application requires.
This application is tested by accessing it from a web browser.
Requirements
To do this exercise, the WebSphere Application Server must be
installed, including a working application server with an administrative
console. In addition, you need a web browser and DB2 installed, and
the PlantsByWebSphere database that is created and populated.
You also need the EnhancedPlantsByWebSphere.ear file.
7-1
Student Exercises
Exercise instructions
Section 1: Resetting the WebSphere environment
Note
If you need to reset your WebSphere environment, then see Appendix A for instructions
on how to correctly reset the environment.
7-2
V6.0.2
Student Exercises
EXempty
Information
The server can be started without the use of the profile name if you issue the
./startServer.sh server1 command from the <profile_root>/<profile_name>/bin
directory.
7-3
Student Exercises
__ d. Click New.
__ e. In the General Properties area, enter the following values:
Table 2: J2C details
Field
Value
Alias
PlantsApp
User ID
db2inst1
Password
was1edu
Description
For PlantsByWebSphere App
7-4
V6.0.2
Student Exercises
EXempty
__ f.
Click OK.
Notice that the alias was created, but the name is not exactly as you defined.
The wizard adds the node name in front of the alias name you entered.
__ g. Click the Save link near the top of the page to save your changes.
__ 2. Edit the hosts file to map dbhost to the IP address where the database server is
running. The database is running locally, so the loopback address 127.0.0.1 can
be used.
7-5
Student Exercises
Information
In this case, a host name alias of dbhost is being used. This alias allows the database to
be moved without changing the configuration. For example, if other users want to test an
application on a different host, but with the same database, they define dbhost on their
host machine to point to a different location.
__ a. From a terminal window, use the following command to open the /etc/hosts
file in a text editor:
dtpad /etc/hosts
__ b. Ensure that both was8host01 and dbhost are mapped to the 127.0.0.1
address:
Section 5: Create a JDBC provider and data sources for the application
If any resources that the application uses are not defined in the EAR file, you must define
them by using the administrative console. In this section, you create the data sources that
the PlantsByWebSphere application requires. These data sources define how the
application accesses the PLANTS database.
Information
In general, it is considered an excellent practice to ignore, or remove, application scoped
resources from enhanced EAR files when installing applications in a production
environment.
7-6
V6.0.2
Student Exercises
EXempty
In this step of the exercise, you create the data source that the PlantsByWebSphere
application needs. You also create the JDBC provider under which the data source exists.
__ 1. Create the data source.
__ a. From the administrative console, expand Resources > JDBC > Data Sources.
__ b. Select the Node=was8host01Node01 scope and click New. This step defines
the scope at which the data source will visible.
__ c. Enter Plants for the data source name. This name is just a label and can be
anything that you like. Enter jdbc/PlantsByWebSphereDataSource for the JNDI
name. This name is used to look up the data source details. It must be the same
7-7
Student Exercises
name that the PlantsByWebSphere application uses. Each JNDI name must be
unique within the environment. Click Next.
7-8
V6.0.2
Student Exercises
EXempty
Note
If there are any existing JDBC providers, you see the following screen at Step 2. Select
Create new JDBC provider, and click Next. Otherwise, you go directly to Step 2.1, Create
new JDBC provider, in the wizard.
7-9
Student Exercises
__ d. Select the values on the table in the Create new JDBC provider page. These
parameters define the characteristics of the driver that is used to communicate
with the database.
Value
DB2
DB2 Universal JDBC Driver Provider
XA data source
On the next page, you define where in the file system the JDBC provider finds
the JDBC drivers.
V6.0.2
Student Exercises
EXempty
Enter this value in both directory location fields (for your lab environment, the
expected location is /opt/IBM/db2/V9.5/java).
Information
The wizard creates the paths that point to the JDBC drivers and puts values into the
WebSphere environment variables named: DB2UNIVERSAL_JDBC_DRIVER_PATH and
DB2UNIVERSAL_JDBC_DRIVER_NATIVEPATH
If these variables are set before this step, their values prefill the entry fields. Anything that
is entered here overwrites the environment variables.
__ g. Click Next.
7-11
Student Exercises
__ h. Now you are back in the data source definition part of the wizard and ready to
define the database properties. Enter the following parameters on the page:
Table 4: Data source details
Field
Value
Driver type
4
Database name
PLANTS
Server name
dbhost
Port number
50000
Use this data source
in container
This option is checked.
managed
persistence.
__ i.
Click Next.
__ j.
V6.0.2
Student Exercises
EXempty
Information
By specifying the PlantsApp authentication alias, when the system accesses the database,
the data source uses the user name and password that were previously specified.
Separating the user name and password out from the data source definition is important.
This indirection allows for the password to be changed in a single place instead of on every
resource that might use the same authentication.
__ k. On the next page, verify all the values that are entered, and click Finish to create
the data source and JDBC provider.
7-13
Student Exercises
__ l.
__ b. Make sure that the connection was successful. Look for the successful
messages at the top of the work area (ignore any warnings).
Information
This test verifies that the application server is able to connect to the data source that was
defined. A success means that the application server is able to connect to host dbhost on
port50000. It can also connect to the database PLANTS with the user name and password
that are supplied in the J2C authentication alias. If any of those pieces are incorrectly
defined, the test fails.
V6.0.2
Student Exercises
EXempty
7-15
Student Exercises
Information
If you are using a browser on a remote location, it is also possible to select Remote file
system and browse through the file system where the application server is running.
__ e. Select Fast Path - Prompt only when additional information is required, and
click Next.
Information
The Fast Path method limits the number of options that are shown, which simplifies the
installation process.
V6.0.2
Student Exercises
EXempty
__ f.
On the next page, you can select any additional installation options. Make certain
that Process embedded configuration is not selected.
Information
If an EAR file is enhanced, the Process embedded configuration check box is selected
by default. To ignore the application-scoped resources, the Process embedded
configuration option must not be selected.
7-17
Student Exercises
Note
If the applications not running, look at the SystemOut.log file in the
<profile_root>/profile1/logs/server1 directory.
Warning
If this enhanced EAR file is installed with the Process embedded configuration checked,
then various properties are set at the application scope level. Caution must be used when
working with application scoped resources because they are not as clearly visible as
resources set at higher level scopes.
Application scoped resources are tied to a specific application. Enhanced EAR
files include application resources.
Settings that are made at the application scope level take precedence over the
same settings that are set at a higher level scope, such as the cell or node levels.
Application scoped resources are not available from scope selection menus.
V6.0.2
Student Exercises
EXempty
7-19
Student Exercises
__ b. Click Login. The PlantsByWebSphere login page is shown. Click the link that is
titled, register for your own account here.
V6.0.2
Student Exercises
EXempty
7-21
Student Exercises
__ d. Click Help on the top or bottom menu bar. The PlantsByWebSphere help page is
seen.
V6.0.2
Student Exercises
EXempty
__ e. Click the link View Server Info This page provides information about the
environment of the PlantsByWebSphere application. This information is useful
when running an application in a clustered mode.
__ f.
Type Testing into the Session data field and click Update. The columns for
Session Data and Session Created are updated. Clicking Refresh (or
refreshing the page with the browser) reloads the page, and the date and time in
the lower left is updated. These steps demonstrate that the page is reloaded, but
the session data remains the same.
Note
Be sure that you understand the information that is shown on the Server Info page and
that you understand how to update the session data. This page is useful when testing
multiple servers in a clustered configuration. Note: The Server Info page is not part of the
PlantsByWebSphere application that ships with the WebSphere Application server product.
The Server Info page is created specifically for use in this course material.
7-23
Student Exercises
Information
If the PlantsByWebSphere application works correctly, and it was able to retrieve the flower
inventory, that tells you a lot.
It means that the PlantsByWebSphere EAR was installed correctly. The browser was able
to communicate with the right port (9080) on the application server. The application server
was able to find and use the right data source and JDBC driver to communicate with the
DB2 database. The application server was able to communicate with DB2 on the correct
host (dbhost), with the correct user name and password as defined in the J2C
authentication alias (PlantsApp).
If any of these items is configured incorrectly, the application does not work.
__ 2. There is no need to log out of the application, but do close the web browser window.
__ 3. Log out of the administrative console and close the web browser.
End of exercise
V6.0.2
Student Exercises
EXempty
7-25
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
This exercise explores the new monitored directory feature, which is
also sometimes called the drag-and-drop function. This feature allows
a developer or administrator to drag an EAR file into a monitored
directory and WebSphere automatically deploys the application. To
provide more control, the monitored directory also supports the use of
property file-based configurations. This feature means that if you drop
a property file into the monitored directory, WebSphere not only can
deploy an application, but can also configure the application in any
way that is needed.
8-1
Student Exercises
Exercise instructions
Section 1: Resetting the WebSphere environment
Note
If you need to reset your WebSphere environment, then see Appendix A for instructions
on how to correctly reset the environment.
8-2
V6.0.2
Student Exercises
EXempty
Note
Do not be concerned if your display differs slightly from the screen captures that are shown
in your exercise book. Most of the screen captures were taken from a Linux system and will
therefore have minor differences in appearance.
One noticeable difference is the root directory for the application server. In the Linux screen
capture, the directories typically start with /opt. On your AIX systems, the equivalent
directory path starts with /usr.
__ a. In a terminal window, change to the root directory for profile1 and get a directory
listing with an ls command:
cd /usr/IBM/WebSphere/AppServer/profiles/profile1
ls
8-3
Student Exercises
__ c. Check the box for Monitor directory to automatically deploy applications and
accept the defaults for the other fields.
__ d. Click Apply.
__ e. Save the changes.
__ 4. Look at the log file.
__ a. In a terminal window, change to the log directory for profile1
(<profile_root>/profile1/logs/server1).
8-4
V6.0.2
Student Exercises
EXempty
__ b. Use a text editor (such as dtpad) to open the SystemOut.log file and search for
the string (uppercase): CWLDD
Note
The monitored directory works not only with stand-alone application servers, but also in a
federated environment. Some of the log file screen captures actually show the messages
from a federated environment. The messages in your stand-alone environment provide the
same information.
8-5
Student Exercises
__ f.
Notice that there are now entries that indicate that the service is started. Also,
notice that the description string immediately preceding the CWLDD is
DragDropDeplo.
8-6
V6.0.2
Student Exercises
EXempty
Information
In a federated environment, the directory contents are slightly different since clusters are
also supported.
Information
The server1 directory is used to deploy applications to server1. If there were multiple
server1 instances within the cell, it is also possible to create a directory structure of the
format nodes/<node-name>/server1. This directory allows you to specify to which server1
an application is deployed.
8-7
Student Exercises
8-8
V6.0.2
Student Exercises
EXempty
__ c. Reopen the SystemOut.log file for server1. Notice that there are new entries
there.
Note
The messages that are shown here are only some of the entries. The others are examined
later.
__ d. Using the administrative console, return to the list of deployed applications and
look at the updated list of enterprise applications.
8-9
Student Exercises
V6.0.2
Student Exercises
EXempty
__ d. Return to the administrative console and verify that the application no longer
shows up in the list of applications.
8-11
Student Exercises
This approach works well, but only in some cases. If there is a requirement for anything but
the default settings for an application deployment, this approach does not do everything
that is needed. The next section helps address these additional requirements by using
properties file-based configurations to do the installations. This approach allows altering
the configurations during the drag-and-drop deployments.
It is important to note that when using properties file based configurations, the
drag-and-drop feature is limited to application deployments. Any additional properties that
are defined in the configuration files, aside from application deployments, are ignored.
Note
This directory is used to drag properties files into it, and it allows applications to be installed
with specific configurations (not just installing with the defaults).
7
__ 2. Export the properties for an existing application. This step demonstrates how you
might investigate what options can be set for an application or what options are
already set for an application.
__ a. In a terminal window, change to the bin directory of profile1.
__ b. Start wsadmin with the following command:
./wsadmin.sh -lang jython -username wasadmin -password web1sphere
V6.0.2
Student Exercises
EXempty
__ c. Enter the following command to export the properties for the DefaultApplication
(use the file /usr/software/prop_files/ DefaultApplication_props.py for
copying and pasting if you prefer).
AdminTask.extractConfigProperties('[-propertiesFileName
DefaultApplication.props -configData Deployment=DefaultApplication
-options [[SimpleOutputFormat true]]]')
Note
The SimpleOutputFormat feature is new to version 8 and makes the output more readable.
It also avoids listing properties that are intended to be hidden.
__ a. Using the administrative console, look at the list of applications that are currently
deployed in the cell (Applications > Application Types > WebSphere
enterprise applications):
8-13
Student Exercises
__ c. Reopen the SystemOut.log file and notice the new log entries.Return to the
console window and look at the list of applications now deployed (refresh the
window if the console is already showing the list of applications).
V6.0.2
Student Exercises
EXempty
8-15
Student Exercises
__ d. Notice that there is a report file for the installation, the update, and the uninstall
operations. Look at the contents of each file, and notice that the entries clearly
show what happened during that operation.
__ g. Reopen the SystemOut.log file for server1 and notice the various error
messages (including that the EAR file does not exist), but no report was
generated in the dragdrop directory under wstemp.
V6.0.2
Student Exercises
EXempty
Note
The drag-and-drop thread does a prevalidation check of the props file, including verifying
that the EAR file exists. If that prevalidation fails, the process does not get far enough to
generate a report.
Reopen the SystemOut.log file and notice that the new entries show various
messages, which indicate that the installation failed. But also notice that the
dragdrop directory contains a report.
End of exercise
8-17
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
The first step in problem determination is to collect diagnostic data.
This exercise focuses on how to gather runtime and application data
with the tools that WebSphere provides such as logging, tracing, and
JVM memory dumps. Analyzing the diagnostic data can best be done
by using specific tools. Many such tools are available from the IBM
Support Assistant. Though the IBM Support Assistant tools are not
used in the exercise, there is a brief overview in the last section of
some important tools for analyzing JVM memory dump data. This
exercise also uses an example application that is called BadApp that
can demonstrate common problems that an administrator
troubleshoots.
9-1
Student Exercises
Requirements
To do this exercise, you must have a working WebSphere Application
Server server1, administrative console, and a running
PlantsByWebSphere application that is installed on profile1.
9-2
V6.0.2
Student Exercises
EXempty
Exercise instructions
Preface
This exercise focuses on how to gather diagnostic data for problem
determination with tools that are part of the WebSphere Application Server V8
product. The last part of the exercise provides an overview of specific tools that
can be used to help analyze the diagnostic data. All of the tools that are
presented here are available in the IBM Support Assistant Workbench.
9-3
Student Exercises
__ 2. You can change the location, name, and other settings of log files from the
administrative console.
__ a. Use a web browser to start the administrative console.
__ b. Log in. Enter wasadmin for the user ID and web1sphere for the password.
__ c. In the navigation tree, select Troubleshooting > Logs and trace. In the pane on
the right, click server1.
Information
You can also reach the configuration area for Logging and Tracing by selecting Servers >
Server Types > WebSphere application servers > server1. Click Logging and Tracing
under the Troubleshooting section.
__ 3. Change the number of historical files and set the maximum size of the log file for
System.out. The number of historical files grows from zero to the value of the
maximum number of historical files field. The next rollover deletes the oldest
historical file.
__ a. Select JVM Logs.
9-4
V6.0.2
Student Exercises
EXempty
__ b. You can view and modify settings from the Logging and tracing panel for
System.out and System.err logs.
Information
Use this page to view and modify the settings for the Java virtual machine (JVM)
System.out and System.err logs for a managed process. The JVM logs are created by
redirecting the System.out and System.err streams of the JVM to independent log files.
The System.out log is used to monitor the health of the running application server. The
System.err log contains exception stack trace information that is used for problem
analysis. One set of JVM logs exists for each application server and all of its applications.
JVM logs are also created for the deployment manager and each node manager. Changes
on the Configuration panel apply when the server is restarted. Changes on the Runtime
panel apply immediately.
9-5
Student Exercises
__ c. Under General Properties for System.out, set the Maximum Size to 3 MB and
the Maximum Number of Historical Log Files to 2.
__ d. Click OK.
__ e. Save the changes to the master configuration.
__ 4. View the SystemOut.log and SystemErr.log files for server1 from the
administrative console.
__ a. Select Troubleshooting > Logs and trace > server1 > JVM Logs and select
the Runtime tab.
Note
Do not be concerned if your display differs slightly from the screen captures that are shown
in your exercise book. Most of the screen captures were taken from a Linux system and will
therefore have minor differences in appearance.
One noticeable difference is the root directory for the application server. In the Linux screen
captures, the directories typically start with /opt. On your AIX systems, the equivalent
directories start with /usr.
9-6
V6.0.2
Student Exercises
EXempty
__ b. Click View to the right of the File Name field for System.out.
__ c. The default is to retrieve 250 lines in one step. You can specify the range of lines
that are retrieved at the top of the Logging and Tracing window. Retrieve lines
250400 by typing 250-400 and clicking Refresh.
__ d. Notice that several lines from the log file are shown. Scroll down to view the log
records.
Information
You can also go to the <profile_root>/profile1/logs/server1 folder to view the logs
with a text editor. Using an editor is preferable since you can use the search features of
your text editor.
__ 5. Configure the IBM service logs from the administrative console. Unlike the JVM
logs, the IBM service logs cannot be viewed within the administrative console. You
Copyright IBM Corp. 2012
9-7
Student Exercises
must use a tool such as the Log Analyzer, which is available in the IBM Support
Assistant.
__ a. Select Troubleshooting > Logs and trace > server1 > IBM Service Logs.
Information
The IBM service log contains both the application server messages that are written to the
System.out stream and special messages that contain extended service information that
you can use to analyze problems. One service log exists for all Java virtual machines
(JVMs) on a node, including all application servers and their node agent, if present. A
separate activity log is created for a deployment manager in its own logs directory. The IBM
Service log is maintained in a binary format. Use the Log Analyzer or Showlog tool to view
the IBM service log.
To find the value for $(LOG_ROOT), you can look to Environment > WebSphere
Variables. The name of the service log is activity.log, but the name can be changed
along with its location in the file system. Maximum file size can be set, and you can enable
9-8
V6.0.2
Student Exercises
EXempty
or disable a correlation ID. You can use the correlation ID to correlate activity to a particular
client request. You can also use it to correlate activities on multiple application servers, if
applicable.
__ c. Click OK.
__ d. Save changes.
9-9
Student Exercises
__ 4. Restart server1. It is necessary to restart a server for the HPEL mode to become
effective.
__ a. Go to the <profile_root>/profile1/bin folder and run the command:
./stopServer.sh server1 -username wasadmin -password web1sphere
__ b. After server1 stops, run the command:
./startServer.sh server1
__ 5. Configure HPEL for server1.
__ a. Go to the administrative console and log on if you are prompted.
__ b. Go to the Logging and tracing panel for server1 by clicking Troubleshooting >
Logs and trace > server1.
__ c. In the general properties section, you can see the current (default) configuration
for the three HPEL repositories. Each has a directory location, and cleanup
options for age and size of log files. Notice that the HPEL text log has a status of
Enabled. In the next step, you disable the text log.
__ 6. Disable the HPEL text log.
__ a. In the General Properties section, click the link Configure HPEL text log.
V6.0.2
Student Exercises
EXempty
__ c. Click OK.
__ d. Click Save to save the configuration.
__ e. It is necessary to restart the server for this change to take effect. However, wait
until you make some other configuration changes before you restart server1.
9-11
Student Exercises
__ b. Notice the different options for configuring HPEL logging. Also, notice that log
buffering is enabled. Since buffering improves performance, it is a good practice
to keep it enabled.
__ 8. Modify the HPEL log configuration.
__ a. Change Maximum Log Size from 50 to 20 MB.
__ b. Click OK.
__ c. Click Save to save the configuration.
V6.0.2
Student Exercises
EXempty
__ b. Notice that you have options to trace to a log directory or memory buffer. The
default is to trace to a log directory.
9-13
Student Exercises
__ c. Click OK.
__ d. Click Save to save the configuration.
__ e. Restart server1 so that the new configuration is in effect.
__ 11. Verify new HPEL configurations.
__ a. Go to the administrative console and log on if necessary.
__ b. Click Troubleshooting > Logs and trace > server1.
__ c. Verify that all the configuration changes that you made are now in effect.
V6.0.2
Student Exercises
EXempty
9-15
Student Exercises
Note
Since you enabled HPEL for server1, you do not see many instances of the server log
repository. An instance is created for each new start of the server and designated with a
time stamp. In this example, which uses the default configuration, the instances for each
day are stored in a folder that is designated with the date. Any instance can be viewed by
selecting it, and the log records are shown in the Log Viewer.
__ b. Try clicking one or more Message ID links to see more details about a message.
__ 4. Filter records that are shown in message levels.
__ a. Expand Content and Filtering Details and select WARNING as the Minimum
level in the View Contents section.
V6.0.2
Student Exercises
EXempty
__ b. Click Apply.
__ c. View the records in the Log Viewer. You notice that the records that are shown
have a minimum level of WARNING. Browse through the messages to see
whether there are any at a higher level such as SEVERE. Alternatively, select
SEVERE as the Minimum level in the View Contents section, and click Apply.
__ d. Clear the Minimum and Maximum level windows. Click Apply to see all the
records again.
__ 5. Show all records that are associated with a specific thread.
__ a. Browse through the records and look for any message of interest at level
WARNING, AUDIT, or SEVERE. Record the Thread ID for that record
______________.
__ b. Highlight any record with the same Thread ID and click Show Only Selected
Threads.
__ c. Browse through the resulting records, and you can see that only the messages
from the selected Thread ID are shown. Also, notice that those records are
shown in quasi-chronological order (the order in which the server emitted them).
__ d. After viewing the records for the selected thread, click Show All Threads.
Section 6: Enable tracing for an application server and view trace data
from the Log Viewer
In this section, you configure tracing on the session management components of server1.
Use the PlantsByWebSphere application to generate trace data, and view the trace data in
the Log Viewer.
__ 1. Configure the diagnostic trace for the session management components of server1.
__ a. In the administrative console, click Troubleshooting > Logs and trace >
server1.
9-17
Student Exercises
__ c. Select the Runtime tab, and enter the following trace strings. These strings are
for the components and trace levels that the IBM Support MustGather
documentation suggests for session management problems.
com.ibm.ws.session.*=all:
com.ibm.ws.webcontainer.srt.*=all:
WAS.j2c=all:
RRA=all:
WAS.database=all
__ d. Remember to add a colon (:) after the existing trace string *=info:
__ e. Click Apply.
__ 2. Access the PlantsByWebSphere application and generate some trace data.
__ a. Start a new browser and enter the web address:
http://localhost:9080/PlantsByWebSphere
V6.0.2
Student Exercises
EXempty
__ c. Select any tree that you like, and click Add to cart.
__ d. This activity is enough to generate some interesting trace data. Close the
browser.
__ 3. Use the Log Viewer in the administrative console to examine the trace data.
__ a. Click Troubleshooting > Logs and trace > server1 > View HPEL logs and
trace.
__ b. Expand the Contents and Filtering Details tree.
Information
In the View Contents section you can select System out, System err, or Logs and trace.
Selecting System out shows records that were sent to the System Out stream
with an API like System.out.println(...)
Selecting System err shows records that were sent to the System Error stream
from an API like System.err.println(...)
Selecting Logs and trace specifies that log and trace records are included in the
log view. Log and trace entries can be further specified to include a minimum or
maximum level.
Copyright IBM Corp. 2012
9-19
Student Exercises
__ c. In the View Contents section, select FINEST as the Minimum level and FINE as
the Maximum level.
__ d. Click Apply.
V6.0.2
Student Exercises
EXempty
__ f.
Click Next Page and Previous Page to go through the trace data. The level of
all records is either FINE, FINER, or FINEST.
__ 4. Use the features of the Log Viewer to explore the trace data. Here are a few
suggestions that you might try.
__ a. Set both Minimum level and Maximum level to FINEST. This setting shows you
only the records at the FINEST level, if there are any.
__ b. Select (highlight) any Thread ID of interest and click Show Only Selected
Threads. Observe the number of different loggers that stream messages in that
thread.
__ c. Try filtering on message content. Look for key words among the message
details, such as getConnection or JSESSIONID. Use wildcards. Remember to
click Apply and Refresh View.
9-21
Student Exercises
help troubleshoot these problems. First, you install an example application that is written to
illustrate several JVM-related problems.
__ 1. Install the badapp application.
__ a. In a command prompt window, go to <profile_root>/profile1/bin.
__ b. Enter the following command all on one line:
./wsadmin.sh -f /usr/software/Troubleshooting/install_badapp_linux.py
-username wasadmin -password web1sphere
__ c. Wait until you see the following message in the command window.
ADMA5013I: Application BadAppEARProject installed successfully.
__ 2. Verify that the application is installed and start it from the administrative console.
__ a. Go to the administrative console and click Applications > Application Types >
WebSphere enterprise applications.
V6.0.2
Student Exercises
EXempty
__ e. Click OK.
__ f.
__ c. Check the box for Enable Performance and Diagnostic Advisor Framework.
9-23
Student Exercises
__ f.
Scroll down on the configuration tab to the entry for Memory Leak Rule.
__ g. Verify that the status is started (solid green arrow). When this rule is checked,
tuning advice is written to the JVM log files for a server when a possible memory
leak is detected.
__ h. Click Save to save the configuration.
__ i.
Restart server1.
__ j.
V6.0.2
Student Exercises
EXempty
__ c. The browser seems to hang for several minutes. During this time, examine the
Log Viewer messages in the command window. You see messages similar to the
following.
__ d. After about 5 minutes, you see the following error message in the web browser.
Return page for BadApp
Request status:OutOfMemoryException was thrown (was this error
expected?), see WebSphere Application Server logs
9-25
Student Exercises
Information
An OutOfMemoryException is thrown. If the application was not purposely written to show
the error message, you would see this symptom only if you examined the JVM logs of the
server.
__ e. Stop server1.
Important
It is likely that this OutOfMemory condition completely hung the application server, so that it
is unresponsive to a stopServer command. If so, for your server, locate the server1.pid
file in <profile_root>/profile1/logs/server1 and record the PID here __________.
To terminate the process forcefully, use the following command:
kill -9 <PID>
__ f.
Start server1.
V6.0.2
Student Exercises
EXempty
__ e. Click Apply.
__ f.
You now see the same messages that were shown in the command window.
Select (highlight) any of these messages, and click Show Only Selected
Threads.
__ g. You now have several pages of log records from the selected thread. Page
through these records by clicking Next Page on the Log Viewer. After you reach
the last BadApp message, you will see the stack trace that resulted from the
OutOfMemoryError.
9-27
Student Exercises
__ h. In the View Contents section, enter WARNING for both Minimum and Maximum
levels.
__ i.
__ j.
Page through the warning messages to look for a message from the
Performance Advisor about memory leaks. It is possible that you might see a
message with the code TUNE90001W, depending on how unresponsive your
server was after the OutOfMemory exception.
__ k. If you do see this message, click the TUNE90001W link to see details.
__ 7. Examine other JVM-related diagnostic memory dumps. Typically a server is
configured to generate a Java core file and a heap memory dump on OutOfMemory
exceptions. The default location for these files is the profile root directory.
__ a. Using a file system explorer, go to <profile_root>/profile1. You can see at
least one Java core and heap dump file.
Information
Java core file
The Java core file, also known a thread dump file, is a text file and can be viewed with a
text editor. These files can be manually analyzed an experienced administrator, but it is
often better to use a tool such as the IBM Thread and Monitor Dump Analyzer. Using
Thread and Monitor Dump Analyzer, you can import several Java cores that are generated
over a period during which the server is hung. Thread and Monitor Dump Analyzer can
then do a comparative analysis of the threads over that period.
V6.0.2
Student Exercises
EXempty
9-29
Student Exercises
__ c. Clear the box for Enable Performance and Diagnostic Advisor Framework.
__ d. Click OK.
__ e. Click Save to save the configuration.
__ 3. Uninstall the BadApp application.
__ a. Go to the administrative console.
__ b. Click Applications > Application Types > WebSphere enterprise
applications.
__ c. Select BadAppEarProject and click Uninstall.
__ d. Click OK.
__ e. Click Save to save the configuration.
__ f.
Restart server1.
Information
For more details and education resources about IBM Support Assistant Problem
Determination Tools, visit the following websites:
IBM Support Assistant website
http://www.ibm.com/software/support/isa/
V6.0.2
Student Exercises
EXempty
The IBM Monitoring and Diagnostic Tools for Java, Memory Analyzer:
http://www.ibm.com/developerworks/java/jdk/tools/memoryanalyzer/
The IBM Monitoring and Diagnostic Tools for Java, Garbage Collection and
Memory Visualizer (GCMV):
http://www.ibm.com/developerworks/java/jdk/tools/gcmv/
9-31
Student Exercises
After importing and analyzing a javacore, the tool provides a brief report, which shows the
javacore file name, the cause of the thread memory dump, and the process ID of the server
instance. One or more warnings might be seen, indicating that there are deadlocked
threads, that the heap is exhausted. The warning in this screen capture shows that the
Java heap is exhausted.
V6.0.2
Student Exercises
EXempty
identifies what threads it is waiting on (if its state is Waiting), or what threads are possibly
waiting on it. There is also a table that summarizes the number of threads in each state.
9-33
Student Exercises
V6.0.2
Student Exercises
EXempty
One or more leak suspects are identified. The description of the single suspect in this
analysis shows the class name and Java object, class loaders, and amount of heap
occupied (80.48%).
The shallow heap is the amount of memory that one object requires. A retained set is one
or more objects plus any objects that are referenced, directly or indirectly, only from those
original objects. The retained set is the set of objects that garbage collection would remove
when an object, or multiple objects, is garbage collected. The retained heap is the total
heap size of all the objects in the retained set. This value is the amount of memory that all
the objects that are kept alive by the objects at the root of the retained set require.
A tree of accumulated objects can be expanded and examined object by object. Each
object name is a link that can be clicked to reveal a menu of options for further analysis.
9-35
Student Exercises
Verbose GC data
The IBM Monitoring and Diagnostic Tools for Java Garbage Collection and Memory
Visualizer is a verbose GC data visualizer. The GC and Memory Visualizer parses and
plots various log types, including verbose GC logs, -Xtgc output, and native memory logs
(output from ps, svmon, and perfmon).
It provides:
A graphical display of a wide range of verbose GC data values
Tuning recommendations and detection of problems such as memory leaks
Report, raw log, tabulated data, and graph views
Saving of data to HTML reports, .jpeg images, or .csv files (for export to
spreadsheets)
Viewing and comparing multiple logs
The top line plots the Heap size and the bottom line plots the Used heap (after collection).
The vertical line at approximately 16 minutes represents a restart of the JVM, so the data
that is plotted here is for two instances of the application server. Both plots show a sudden
expansion of the heap size to near the maximum heap size of 250 MB, signaling
OutOfMemory exceptions.
V6.0.2
Student Exercises
EXempty
The tool provides a detailed report of object utilization and recommendations for tuning
garbage collection. It is possible that there are warnings about heap exhaustion, as shown
in this example.
9-37
Student Exercises
Summary of GC data
The summary of the GC data shows the GC mode, gencon in this example, and detailed
statistics about the garbage collection that are helpful for tuning the performance of a JVM.
In general, tuning requires minimizing pause times and maximizing time between
collections. The largest memory request data might indicate a memory leak or the use of
overly large objects in the application.
End of exercise
V6.0.2
Student Exercises
EXempty
9-39
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
The WebSphere Application Server wsadmin tool can be used to run
scripts for making configuration changes in the application server.
You can use the wsadmin tool to manage a WebSphere Application
Server installation. This tool uses the Bean Scripting Framework
(BSF), which supports various scripting languages to configure and
control your WebSphere Application Server installation. The wsadmin
tool supports the Jython and Jacl scripting languages. The Jython
syntax for the wsadmin tool is the strategic direction for WebSphere
Application Server administrative automation.
The wsadmin shell makes Java objects available through
language-specific interfaces. Scripts use these objects for application
management, configuration, operational control, and for
communication with MBeans running in the WebSphere server
processes.
Scripting is a nongraphical alternative that you can use to configure
and manage the WebSphere Application Server.
10-1
Student Exercises
Requirements
To dot his exercise, you must have a working WebSphere Application
Server installed in your working environment and the IBM Assembly
and Deploy Tools available on the same or a different workstation from
the server.
V6.0.2
Student Exercises
EXempty
Exercise instructions
The wsadmin tool supports two scripting languages, Jython and Jacl. The IBM Assembly
and Deploy Tools supports only Jython. This exercise covers scripting with Jython scripts.
10-3
Student Exercises
This change is global to this profile. It is also possible to define a property file for individual
users or through an environment variable.
This section of the lab explores how to use wsadmin to run Jython commands. Activities
include starting wsadmin, getting help, and running various commands.
There are solution files in the /usr/software/wsadmin folder. You can continue with the
exercise and enter the commands by hand, or you can run the appropriate script.
V6.0.2
Student Exercises
EXempty
__ 3. It is possible to run a single wsadmin command and exit the wsadmin shell. This
technique is not efficient because a JVM needs to be created every time wsadmin is
run. Enter following command:
./wsadmin.sh -lang jython -c "AdminControl.getPort()"
You are prompted to log in. Enter user ID wasadmin and password web1sphere
10-5
Student Exercises
Note
The first time wsadmin runs, the environment is set up. There are several messages about
processing new jar.
The port that wsadmin is using to connect to the application server is shown.
Important
Now that you are asking wsadmin to actually connect to a running server and retrieve some
information (the port number), you are challenged for a user name and password. The
administrative security must recognize these credentials. Enter wasadmin and
web1sphere to authenticate and continue. Ensure that there are no spaces after each
entry, or authentication will fail.
See the next section for alternatives on how to deal with security while using wsadmin.
V6.0.2
Student Exercises
EXempty
Next, you enter the authentication information for wsadmin in the soap.client.props file
and also encode the file to mask the password, which is entered initially in clear text.
__ 1. Add the user ID and password to the properties file.
__ a. Edit the soap.client.props file in the
<profile_root>/profile1/properties folder.
__ b. Find the entries:
com.ibm.SOAP.loginUserid=
com.ibm.SOAP.loginPassword=
__ c. To the right of the equals sign, enter wasadmin and web1sphere in the
corresponding fields.
Warning
This practice is a potential security problem.
First, this properties file contains the password. It can be encoded. Second, any
administrator who runs wsadmin has access to WebSphere as wasadmin without
authentication.
10-7
Student Exercises
Example
V6.0.2
Student Exercises
EXempty
10-9
Student Exercises
#
# This script lists all defined JDBC providers
#
def showJdbcProviders():
providerEntries = AdminConfig.list("JDBCProvider")
# split long line of entries into individual entries in
list
providerEntryList = providerEntries.split(lf)
# print contents of list for provider in
providerEntryList:
print providerEntryList
AdminConfig.reset()
cell = AdminControl.getCell()
node = AdminControl.getNode()
lf = java.lang.System.getProperty("line.separator")
slash = java.lang.System.getProperty("file.separator")
print "System information: Cell=" + cell
print "System information: Node=" + node
showJdbcProviders()
V6.0.2
Student Exercises
EXempty
Help
AdminControl
AdminConfig
AdminApp
AdminTask
Almost all server configuration can be done through these objects. Use wsadmin to
show the help that is provided for each of the administrative objects.
10-11
Student Exercises
Information
The Help object is used to provide general help for the objects AdminApp, AdminConfig,
AdminControl, AdminTask, and Help. It is also the interface to obtain information about
MBeans (operations, attributes, and particular interface information about MBeans).
__ b. As you can see, the text is not formatted and is hard to read. Now try the
following command:
V6.0.2
Student Exercises
EXempty
print Help.help()
Using the command print in front of nearly every other command produces
formatted text, which is much easier to read.
__ c. Now try to get help for the other administrative objects:
AdminConfig.help()
AdminControl.help()
AdminApp.help()
AdminTask.help()
__ 3. You can also request specific help on a particular command, or method, of an
administrative object. To see the command groups available for the AdminTask
object, enter the command:
10-13
Student Exercises
print AdminTask.help("-commandGroups")
V6.0.2
Student Exercises
EXempty
__ 4. Suppose that you are interested in the group of commands for configuring a cluster.
To show the commands available to configure a cluster, enter the command:
print AdminTask.help("ClusterConfigCommands")
10-15
Student Exercises
__ 5. For more information about the CreateCluster command, enter the command:
print AdminTask.help("createCluster")
__ 6. Use the AdminApp object to list applications and application module information.
Information
The AdminApp object is used to work with application objects that include functions such
as installing, uninstalling, listing, and editing.
Example
wsadmin>print AdminApp.list()
DefaultApplication
ivtApp
query
wsadmin>
V6.0.2
Student Exercises
EXempty
Information
The list of installed applications in your environment can be different from the example
shown.
10-17
Student Exercises
Information
The AdminConfig object manipulates the static configuration data for a WebSphere
Application Server installation for all objects except applications. There are commands to
list, create, remove, display, and modify configuration data.
__ a. Verify the name of the data sources. At the wsadmin command prompt, enter:
print AdminConfig.list("DataSource")
The names of the data sources are shown.
__ b. At the wsadmin command prompt, enter:
datasrc=AdminConfig.getid("/DataSource:Default Datasource/")
datasrc is a variable name.
getid is an AdminConfig command that retrieves the configuration ID of
the data source object.
/DataSource:Default Datasource/ is the hierarchical containment path
of the configuration object, including the actual name of the object.
V6.0.2
Student Exercises
EXempty
__ d. To see the properties for the selected data source that is held by the datasrc
variable, enter:
print AdminConfig.show(datasrc)
10-19
Student Exercises
__ f.
Show the attributes of the data source and make sure that the change took
place:
print AdminConfig.show(datasrc)
V6.0.2
Student Exercises
EXempty
1+1
=2
Example
wsadmin>nodes=AdminTask.listNodes()
wsadmin>print AdminTask.listServerTypes(nodes)
APPLICATION_SERVER
GENERIC_SERVER
WEB_SERVER
wsadmin>print AdminTask.listServers()
server1(cells/was8host01Node01Cell/nodes/was8host01Node01/servers/s
erver1|server.xml)
__ 10. Use various commands to get information for the configuration and server.
__ a. At the wsadmin command prompt, enter the following commands:
cell=AdminConfig.list("Cell")
print cell
cell is a variable name.
list is an AdminConfig command that shows the cell.
cellname=AdminConfig.showAttribute(cell,"name")
print cellname
cellname is a variable name.
showAttribute is an AdminConfig command that shows all of the
attributes of the cell.
nodes=AdminConfig.list("Node",cell)
print nodes
nodes is a variable name.
list is an AdminConfig command that shows all of the nodes in
the cell.
nodename=AdminConfig.showAttribute(nodes,"name")
print nodename
nodename is a variable name.
showAttribute is an AdminConfig command that shows all of the
attributes of the nodes in the cell.
10-21
Student Exercises
print AdminConfig.showall(AdminConfig.list("Node"))
node is a variable name.
showall is an AdminConfig command that shows all of the
attributes of the specified configuration object.
server=AdminConfig.list("Server")
print server
server is a variable name.
list is an AdminConfig command that shows the servers in the
cell.
AdminTask.showServerInfo(server)
showServerInfo is an AdminTask command that shows the
information about the server.
V6.0.2
Student Exercises
EXempty
1+1
=2
Example
wsadmin>cell=AdminConfig.list("Cell")
wsadmin>print cell
was8host01Node01Cell(cells/was8host01Node01Cell|cell.xml#Cell_1)
wsadmin>cellname=AdminConfig.showAttribute(cell,"name")
wsadmin>print cellname
was8host01Node01Cell
wsadmin>nodes=AdminConfig.list("Node",cell)
wsadmin>print nodes
was8host01Node01(cells/was8host01Node01Cell/nodes/was8host01Node01|
node.xml#Node_1)
wsadmin>nodename=AdminConfig.showAttribute(nodes,"name")
wsadmin>print nodename
was8host01Node01
wsadmin>print AdminConfig.showall(AdminConfig.list("Node"))
[discoveryProtocol TCP]
[hostName was8host01]
[maxFilePermissionForApps
.*\.dll=755#.*\.so=755#.*\.a=755#.*\.sl=755]
[name was8host01Node01]
[properties []]
wsadmin>server=AdminConfig.list("Server")
wsadmin>print server
server1(cells/was8host01Node01Cell/nodes/was8host01Node01/servers/s
erver1|server.xml#Server_1183122130078)
wsadmin>AdminTask.showServerInfo(server)
'[ [cell was8host01Node01Cell] [serverType APPLICATION_SERVER]
[com.ibm.websphere.baseProductVersion 8.0.0.0] [node
was8host01Node01] [server server1] ]'
10-23
Student Exercises
V6.0.2
Student Exercises
EXempty
__ f.
Save the configuration to the repository. This command updates the repository
with the information about the uninstalled ivtApp application.
AdminConfig.save()
1+1
=2
Example
wsadmin>appManager=AdminControl.queryNames("type=ApplicationManager
,cell="+cellname+",node="+nodename+",process=server1,*")
wsadmin>print appManager
WebSphere:name=ApplicationManager,process=server1,platform=proxy,no
de=was8host01Node01,version=8.0.0.0,type=ApplicationManager,mbeanId
entifier=ApplicationManager,cell=was8host01Node01Cell,spec=1.0
wsadmin>app=AdminControl.queryNames("type=Application,cell="+cellna
me+",node="+nodename+",process=server1,J2EEName=ivtApp,*")
wsadmin>print app
WebSphere:name=ivtApp,process=server1,platform=dynamicproxy,node=wa
s8host01Node01,J2EEName=ivtApp,Server=server1,version=8.0.0.0,type=
Application,mbeanIdentifier=cells/was8host01Node01Cell/applications
10-25
Student Exercises
/ivtApp.ear/deployments/ivtApp/deployment.xml#ApplicationDeployment
_1183122155437,cell=was8host01Node01Cell,spec=1.0
wsadmin>appName=AdminControl.getAttribute(app,"name")
wsadmin>print appName
ivtApp
wsadmin>AdminControl.invoke(appManager,"stopApplication",appName)
''
wsadmin>AdminApp.uninstall(appName)
ADMA5017I: Uninstallation of ivtApp started.
ADMA5104I: The server index entry for
WebSphere:cell=was8host01Node01Cell,node=was8host01Node01 is
updated successfully.
Information
This sequence of commands is a typical example of what you would put in a
general-purpose Jython script. As you try the individual commands and debug them, you
can put all the commands in a file that is called uninstall.py and use it every time that
you need to uninstall an application. You modify the commands slightly to accept the name
of the application through a command-line parameter to the script.
V6.0.2
Student Exercises
EXempty
__ 3. Reinstall the ivtApp application and verify that it is running. The ivtApp.ear file can
be found in the <was_root>/installableApps directory.
__ a. Copy the ivtApp.ear file from the <was_root>/installableApps directory to
the <profile_root>/profile1/installableApps directory.
__ b. Enter the following command to install and start the ivtApp application:
AdminApp.install("../installableApps/ivtApp.ear",["-appname
ivtApp"])
This command installs the ivtApp.ear application and names it ivtApp. The
-appname parameter is an installation option.
Information
Make sure that there is a space between -appname and ivtApp when you enter the
command. Look for the message to indicate that the application ivtApp installed
successfully.
You might see a message about Java EE security. If an EAR file contains a was.policy
file, its contents are shown when you install the application. This feature tells the
administrator that the policy file exists. It is a reminder to check this policy file. It is
important to check that the privileges provided in the policy file do not violate organizational
security policies.
10-27
Student Exercises
Information
You can also obtain the application status with the following wsadmin command:
print AdminControl.completeObjectName("type=Application,name=ivtApp,*")
If the ivtApp application is running, then an MBean is created and prints text; otherwise, the
command returns nothing.
V6.0.2
Student Exercises
EXempty
__ 2. Open each of the subfolders and discover the names of the libraries:
Table 5: Scripting libraries
Directory location
application/V70
resources/J2C/V70
resources/JDBC/V70
resources/JMS/V70
resources/Provider/V70
security/V70
servers/V70
system/V70
utilities/V70
perfTuning/V70
osgi
Script library
AdminApplication
AdminBLA
AdminJ2C
AdminJDBC
AdminJMS
AdminResources
AdminAuthorizations
AdminClusterManagement
AdminServerManagement
AdminNodeGroupManagement
AdminNodeManagement
AdminLibHelp
AdminUtilities
ApplyPerfTuning
osgiApplicationConsole
Note
The libraries use the administrative objects that you looked at in the previous part of this
exercise. All of these libraries are loaded when wsadmin starts and are readily available
from the wsadmin command prompt, or to be used from your own scripts. Even though
source code is provided, it is not meant for the user to modify this code. Users of the
libraries call code in the libraries from their own scripts. You can copy parts of the library
code to other files and modify the copied code to improve it or better suit your needs.
__ 3. You can open the libraries in a text editor and look at the code. This code is
documented, and exceptions and other errors are handled smoothly by providing
meaningful error messages to the calling scripts. Use a text editor to open the
AdminJDBC script library:
<was_root>/scriptLibraries/resources/JDBC/V70/AdminJDBC.py
10-29
Student Exercises
In each library, after the usual copyright and disclaimer statement, there is a list of
procedure examples. The AdminJDBC library has 13 example functions:
Ex1: createJDBCProvider
Create a JDBC provider in your environment.
The script returns the configuration ID of the new JDBC provider.
Ex2: createJDBCProviderUsingTemplate
Use a template to create a JDBC provider.
Ex3: listJDBCProviderTemplates
Show a list of configuration IDs for the JDBC provider templates.
Ex4: createDataSource
Create a data source in your configuration.
The script returns the configuration ID of the new data source.
Ex5: createDataSourceUsingTemplate
Use a template to create a data source in your configuration.
The script returns the configuration ID of the new data source.
Ex6: listDataSourceTemplates
Show a list of configuration IDs for the data source templates.
Ex7: listJDBCProviders
Show a list of configuration IDs for the JDBC providers.
Ex8: listDataSources
Show a list of configuration IDs for the data sources.
Ex9: help
Show AdminJDBC script library online help.
Ex10: createJDBCProviderAtScope
Create a JDBC provider at scope.
Ex11: createJDBCProviderUsingTemplateAtScope
Use the template at scope to create a JDBC provider.
Ex12: createDataSourceAtScope
Create a data source at scope.
Ex13: createDataSourceUsingTemplateAtScope
Use the template at scope to create a data source.
V6.0.2
Student Exercises
EXempty
Examine the example functions that the library provides. Close the file when you are
done examining it.
__ 4. A similar listing of functions available in a library can be obtained with the help()
method. At the wsadmin prompt, enter:
print AdminJDBC.help()
__ 5. As with the administrative objects, you can get help on a specific method. Enter:
print AdminJDBC.help("listJDBCProviders")
10-31
Student Exercises
__ 6. Not only can you use these commands in your own scripts, but you can run the
commands directly. Enter:
print AdminJDBC.listJDBCProviders()
As with any new library system, it takes a while to become familiar and comfortable
with the functions available. By combining these library functions with your own
scripting logic in your Jython scripts, you can write scripts to configure your
application servers.
Section 10:Using IBM Assembly and Deploy Tools to code, test, and
debug Jython scripts (demonstration only)
PROCEED TO SECTION 14:
This section uses the IBM Assembly and Deploy Tools for WebSphere Administration,
which is not available on AIX. It is therefore not possible to go through these steps on your
lab workstation. Instead, a demonstration is available at the following URL:
https://www.ibm.com/developerworks/mydeveloperworks/wikis/home?lang=en#/wiki/
WebSphere%20Education%20Wiki/page/Course%20Demonstrations
Use your local browser to run the wsadmin demonstration. You can follow along with the
following instructions.
You are not able to run this section in your lab environment. Watch the
demonstration instead. These steps are presented for reference only.
REFERENCE ONLY:
Writing and debugging scripts can be made much easier when using an effective integrated
development environment (IDE). The IBM Assembly and Deploy Tools is enhanced with
features designed to provide a rich environment for development and testing of Jython
scripts.
In this section of the lab, you write a simple script to set the value of one of many
WebSphere environment variables. In this example, you set the variable that defines the
path to the DB2 Universal JDBC driver.
__ 1. Start IBM Assembly and Deploy Tools by clicking Start > Programs > IBM
Software Delivery Platform > IBM Assembly and Deploy Tools for WebSphere
Administration 8.0 > IBM Assembly and Deploy Tools for WebSphere
Administration.
V6.0.2
Student Exercises
EXempty
__ 2. The Workspace Launcher window opens. The workspace field identifies the
directory that your workspace uses. Scripts and other application files are saved in
the workspace. It is good for you to open the same workspace as the
PlantsByWebSphere application assembly exercise used.
Make sure that the workspace is: C:\software\Assemble\PlantsByWebSphere
If the folder does not exist, create it. Click OK.
Information
You can use any workspace. Some organizations have a workspace that is dedicated to
holding scripts.
__ 3. After the tool opens, switch to the Java EE perspective if it is not open.
Note
To get to the Java EE perspective, click Window > Open Perspective > Other. Select
Java EE (default) and click OK.
10-33
Student Exercises
__ c. If this section is empty, proceed by using a right-click in the empty Servers view
to show the menu.
V6.0.2
Student Exercises
EXempty
__ f.
Click Next.
__ g. Click Next.
__ h. On the next pane, make sure that the fields are populated with the following
values:
- Name: WebSphere Application Server v8.0
- Installation directory: <was_root>
__ i.
Click Next.
10-35
Student Exercises
__ j.
__ k. Click Finish.
V6.0.2
Student Exercises
EXempty
10-37
Student Exercises
V6.0.2
Student Exercises
EXempty
10-39
Student Exercises
__ d. The file opens in the Jython source editor on the upper right view of the Java EE
perspective.
You also see the file in the workspace structure under the Scripts folder. If the file
is not visible, select the Scripts folder and right-click to open the menu. Click
Refresh. The file is seen in the list. Now you are ready to write the script.
You are not able to run this section in your lab environment. Watch the
demonstration instead. These steps are presented for reference only.
REFERENCE ONLY:
The application server uses many of its own environment variables to consolidate
information, such as paths, in one place. After the environment variable is set, it is used in
many places instead of entering the information that is contained in the variable many
times. This technique reduces maintenance because if the information held in the variable
ever changes, it needs to be changed in only one place. All the users of that information get
it by referencing the environment variable and not the location directly.
10-40 WebSphere Application Server V8 Administration
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V6.0.2
Student Exercises
EXempty
One variable is used when accessing DB2 database drivers. The server needs to know
where to find the drivers so that it can add this information to its class path.
This script sets the DB2UNIVERSAL_JDBC_DRIVER_PATH environment variable, but it can be
used to change any variable.
__ 1. On the Jython editor view, enter the following code, which makes up the main of
the script.
Ask the AdminControl object for the node name with the getNode() method. When
typing this line of code in the editor, stop typing after entering:
nodeName = Admin
10-41
Student Exercises
Information
If you are not familiar with the term main, it is a method, or entry point, in a program that
starts the process. Procedural languages are started from first line of code encountered. In
C, C++, and Java there is a method actually called main which is run after the program is
loaded. In Jython, the first line run is not necessarily the first line of the program or a
method called main. Python starts at the first unindented line that is not designated as a
subroutine with the def keyword. Other languages use other conventions.
__ 2. Press Ctrl+Space; this key combination calls command completion. From the list,
double-click to select AdminControl.
V6.0.2
Student Exercises
EXempty
__ 3. Type a period and press Ctrl+Space. This time all the methods for the AdminControl
object are shown on the list.
Continue typing and see how the list narrows as you enter characters. Type get
and you see just the getter methods. Type an N, and select getNode from the list.
10-43
Student Exercises
Important
Be careful when entering the code to maintain the indentation shown. Indentation (leading
white space) determines blocks of code in Jython. You can use spaces or tabs to achieve
the level of indentation that you want.
Enter lines, which are shown split, in one single line with the editor.
If you do not want to type all the code, you can copy it from:
\usr\software\wsadmin\setWASEnvVariable.py
Line 3:
nodeId = AdminConfig.getid("/Node:"+nodeName+"/")
Line 4:
varSubstitutions =
AdminConfig.list("VariableSubstitutionEntry",nodeId)
.split(lf)
Line 5:
Line 6:
curVarName =
AdminConfig.showAttribute(varSubst,
"symbolicName")
if curVarName == envVarName:
Line 7:
Line 8:
AdminConfig.modify(varSubst,[["value",
newVarValue]])
Line 9:
break
Even though the code seems complex, with a little explanation it becomes clearer as
to how it sets the environment variable:
The subroutine is called from the main code, passing it two parameters: the
name of the variable to change and the new value of the variable.
V6.0.2
Student Exercises
EXempty
The first line prints an information message that indicates the variable name and
the new value for the environment variable. It also prints the name of the node
where the variable is changed.
The next line gets the node ID and uses the node name as a parameter to the
AdminConfig.getid() method.
The next line does two operations. First, it gets a list of all variable substitution
entries. These entries are not returned in a true list that can be manipulated, but
instead are returned in a long string that contains all the entries, with a line feed
character between each entry. The returned string must be converted into a true
list object. This action splits the string with the line feed character as the
delimiter. The line feed character is obtained at run time since it changes
between operating systems. This action was done in the main of the script.
Now that you have a list, you can iterate through the list with a for loop. In the
loop, each value in the list is assigned to the varSubst variable.
The first line inside the loop uses the showAttribute() method of
AdminConfig to retrieve the actual name of the environment variable, which is
printed on the next line.
Changing the value is accomplished by using the modify() method of
AdminConfig.
If the variable was found and changed, the loop breaks on the keyword break.
If the variable was not found, in this iteration the loop continues until all the
environment variable names are looked up.
__ 6. Save the file by pressing Ctrl+S.
Information
To get the line numbers that are shown on the left of the window from the menu, click
Window > Preferences > General > Editors > Text Editors. Check the box in front of
Show line numbers and click Apply. Click OK.
10-45
Student Exercises
__ d. Click Apply.
__ e. Feel free to explore the other tabs of the pane to see what is available. For
example, you can pass a command-line parameter under the Arguments tab.
__ f.
Click Run. After this initial setup, you can click Run from the toolbar. The tool
remembers these values.
The tool attempts to run the script in wsadmin. Any errors or output is on the
V6.0.2
Student Exercises
Console view on the lower right pane of perspective. The Console view is
opened automatically as required.
EXempty
__ g. Make sure the script runs without any errors. Initially there are numerous
packaging messages that are seen in red. They can be ignored.
Note
There are times when the console seems to disappear, and a different console is shown.
This action happens because there are multiple consoles that are viewable. To see the list
and select the console for the script, select the Display Selected Console menu, and
choose setWASEnvVariable.py.
You see:
WASX7209I: Connected to process "server1" on node was8host01Node01 using
SOAP connector; The type of process is: UnManagedProcess
Setting variable DB2UNIVERAL_JDBC_DRIVER_PATH on node was8host01Node01,
to C:\Program Files\IBM\SQLLIB\java
[value ${LOG_ROOT}/server7]
Saving configuration
10-47
Student Exercises
You are not able to run this section in your lab environment. Watch the
demonstration instead. These steps are presented for reference only.
REFERENCE ONLY:
Sometimes logic errors prevent your script from producing the expected results. In those
cases, it is useful to run the script with the Jython source debugger. Using the debugger,
you are able to set breakpoints, examine variable values, cycle through the code
step-by-step and, in most cases, figure out where the problem is.
Sometimes it is useful to run a script through the debugger to figure out how it works. This
practice is useful when you are given a script that someone else wrote and you need to
maintain it.
A good way to start is to place a breakpoint at the first executable line of the script. The
marker bar is the dark vertical bar located along the left side margin of the Jython editor
view.
__ 1. From the Jython editor, set a breakpoint on the line that contains the code:
nodeName = AdminControl.getNode()
V6.0.2
Student Exercises
EXempty
Locate the line in the script. Place the mouse pointer so that it is on top of the marker
bar and aligned with the line of code where you want to apply the breakpoint.
Right-click, and select Toggle Breakpoint (you can also double-click).
Information
To turn on line numbers, right-click in the vertical bar to the left of the code and select Show
Line Numbers from the menu.
10-49
Student Exercises
The Source view shows the script. From the menu on this view, you have access
to a useful function: Run to Line. You can place the cursor anywhere on the
source and click Run to Line, and the debugger runs code to that line. It
effectively is a temporary breakpoint.
The Outline view shows the methods and loops in the script, allowing you to
quickly find and jump to areas of interest.
The Console view shows errors and other messages from the script and server.
Feel free to experiment in the different views and discover the details of what is
available.
__ 4. Press the F6 key, or click the corresponding button on the Debug view toolbar to
step over the statement where the debugger is stopped. This advances execution
one statement at a time.
__ 5. Watch the Variables view and look for the newly assigned variable and its value.
__ 6. Step three more lines, watching the Variables view.
Note how the type and value of the selected variable are shown, in detail, at the
bottom of the view.
__ 7. The next line is the call to the subroutine:
changeEnvValue(varName, newVarValue)
__ 8. This time press F5, or click the corresponding button on the Debug view toolbar to
step into the subroutine.
__ 9. Continue to press F6 to run through the subroutine and its loop. Observe when a
matching variable is found from the list of environment variables, how the value is
changed and how the loop ends when the break statement is run.
__ 10. After the subroutine ends, control is returned to the main part of the script where a
message is printed and the configuration is saved.
__ 11. Advance one more step, and the thread terminates. If you must run through the
program again, you can relaunch from a terminated thread. From the Debug view,
select the terminated thread and right-click to open the menu. Select Relaunch.
You now have the basic skills for writing, testing, and debugging Jython scripts. There is
much more to it than this short exercise. Probably the most complex task ahead is to
10-50 WebSphere Application Server V8 Administration
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V6.0.2
Student Exercises
EXempty
become familiar with what the administrative objects can do. There are many examples
and excellent topics in the information center and on the WebSphere Developer website.
For a good resource to learn about the methods available in the information center, see the
pages named:
Using the AdminConfig object for scripted administration
Commands for the AdminConfig object
These pages exist for all other administrative objects; substitute their names for
AdminConfig and search the information center.
You are not able to run this section in your lab environment. Watch the
demonstration instead. These steps are presented for reference only.
REFERENCE ONLY:
Sometimes it is challenging to figure out what wsadmin commands are needed to use. One
useful tool is the console itself. The administrative console, in some cases, can show the
command that it uses to effect certain configuration changes. You can then copy these
commands and use them in your scripts.
Information
Not all configuration commands are shown in this version. With each new release, the
number of administrative console actions that show these commands increases.
10-51
Student Exercises
To further simplify this process, if the IBM Assembly and Deploy Tools is running, it can
communicate directly with the administrative console, receive the wsadmin commands,
and make them available for inserting into your scripts.
In this exercise, you set up the administrative console and IBM Assembly and Deploy Tools
to communicate with each other.
__ 1. Make sure that the server is running and go to the administrative console.
__ 2. From the main menu on the left, expand System administration and select
Console Preferences.
__ 3. On the Console preferences window, select both:
Enable command assistance notifications
Log command assistance commands
__ 4. Click Apply.
__ 5. IBM Assembly and Deploy Tools is probably still open from the previous section. If it
is not, open it using the same workspace that you previously used.
__ a. Make sure that you are on the Java EE perspective.
__ b. From the main menu, select Window > Show view > Other.
V6.0.2
Student Exercises
EXempty
__ d. Click OK.
__ e. In the WebSphere Administration Command view, click the Select Server to
Monitor drop-down arrow and click WebSphere Application Server v8.0 at
localhost.
Information
If the server name is not available on the list, switch to the Servers view and make sure
that the server is running.
10-53
Student Exercises
__ 7. On the far right, under Help, click View administrative scripting command for
last action.
This action opens a new browser window where the last few administrative
commands can be seen and also where you can control the behavior of command
assistance.
__ 8. Expand Preferences. If not already selected, check both command assistance
preferences:
Enable command assistance notifications
Log command assistance commands
Click Apply.
__ 9. Return to the IBM Assembly and Deploy Tools window and check for the results.
__ a. In the IBM Assembly and Deploy Tools window, look at the bottom view and
select the WebSphere Administration Command tab.
V6.0.2
Student Exercises
EXempty
__ b. Notice that there is now an entry that shows the AdminApp.list() command.
__ 10. From the administrative console, complete the following sequence of commands. As
you do each command, switch between the Administrative Scripting Commands
browser page and the IBM Assembly and Deploy Tools WebSphere Administration
Command view to see which commands show up in the windows:
__ 11. View the IBM Assembly and Deploy Tools WebSphere Administration Command
view.
Select a command in the list and right-click to open the menu. There are three
options available:
10-55
Student Exercises
- Insert
Insert that command at the cursor position of a Jython script open in the
Jython editor.
- wsadmin Command Help
Get help on the command.
- Remove
Remove the command from the list.
When requesting help, a web browser view opens in IBM Assembly and Deploy
Tools and shows the information center page for that command or administrative
object.
__ 12. Feel free to experiment with the console, inserting commands into a Jython script.
__ 13. Exit IBM Assembly and Deploy Tools.
V6.0.2
Student Exercises
EXempty
From the server list, click server1 to open the configuration work area. Under
Communications, click Ports. Look for the entry: SIB_MQ_ENDPOINT_ADDRESS
Note the port number _____________.
__ g. Compare the port values from the properties file with the ports listed on the
administrative console. You are going to change the port value for
SIB_MQ_ENDPOINT_ADDRESS. Click server1 from the breadcrumb trail and return
to the configuration tab for server1. Leave the administrative console open.
__ 2. Modify the endpoint.props file.
__ a. Locate the port and value pair for SIB_MQ_ENDPOINT_ADDRESS. Change the port
value, currently 5558, to 15558
__ b. Save the updated file, but do not close it.
__ c. Validate the updated properties file.
__ d. From the wsadmin command line, enter:
AdminTask.validateConfigProperties("-propertiesFileName
endpoint.props")
__ e. If the file validation is successful, true is shown.
__ 3. Apply the updated properties file to the configuration.
__ a. From the wsadmin command line, enter:
AdminTask.applyConfigProperties("-propertiesFileName
endpoint.props")
__ b. If the configuration is updated successfully, two quotation marks are shown.
__ 4. Save the changes.
__ a. From the wsadmin command line, enter:
AdminConfig.save()
__ 5. From the administrative console, click Ports. Notice that the port value for
SIB_MQ_ENDPOINT_ADDRESS is now 15558, reflecting the change that you made in
the properties file.
10-57
Student Exercises
__ g. Exit wsadmin.
V6.0.2
Student Exercises
EXempty
Note
The interface does the same function multiple times. Each box uses a different type of
graphical widget to set the console timeout value. Feel free to explore the different options.
__ b. If you are interested, open the script file with an editor and investigate how the
graphical interface is coded.
__ c. Press Enter in the command window to end the script.
End of exercise
10-59
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
This exercise goes through the process of creating and federating a
cell. The initial steps include creating two more profiles, the first of
which is a deployment manager profile. After the deployment manager
profile is created, profile1 is federated into the cell. Then, a custom
profile is created and federated at the same time.
This exercise demonstrates the process of creating a cell and
prepares the lab environment for other important steps, including
creating a node to manage a remote web server, and clustering an
application server.
Requirements
To do this exercise, you must have the application server named server1 started.
DefaultApplication and PlantsByWebSphere Application must be installed and running on
server1.
11-1
Student Exercises
Exercise instructions
During this exercise, you change your stand-alone application server environment to a cell
environment that contains two federated nodes and an unmanaged node for a web server.
It is important as you progress through the exercise that you have a good understanding of
what you are creating.
As you begin the exercise, you have one stand-alone application server, named server1,
contained in a node, named was8host01Node01.
When you complete the exercise, you have a cell, named was8host01Cell01, containing
the following nodes:
Deployment manager node, named was8host01CellManager01
A federated node, named was8host01Node01, containing a node agent and an
application server, named server1
A federated node, named was8host01Node01, containing only a node agent
An unmanaged node, named ihsnode, containing an IBM HTTP Server
administrative process and a web server, named webserver1
V6.0.2
Student Exercises
EXempty
The Profile Management Tool is part of the WebSphere Customization Toolbox, and is a
GUI tool for creating WebSphere profiles. Using the profile wizard, you can create an
application server profile, deployment manager profile, custom profile, or cell profile (which
creates both a deployment manager and managed node). First, create a deployment
manager profile.
__ 1. Start the Profile Management Tool. This wizard is the same one you used earlier to
create profile1.
__ a. The command to run the Profile Management Tool is:
/usr/IBM/WebSphere/AppServer/bin/ProfileManagement/pmt.sh
Information
It is also possible to create profiles from the command line by using the manageprofiles
-create script that is in the <was_root>/bin directory.
./manageprofiles.sh -create -profileName profile2
-profilePath "<profile_root>/profile2"
-templatePath "<was_root>/profileTemplates/default"
-nodeName was8host01Node02 -cellName was8host01Cell02
-hostName was71host01
11-3
Student Exercises
__ a. From the Environment Selection panel, select Management and click Next.
V6.0.2
Student Exercises
EXempty
__ b. From the Server Type Selection panel, select Deployment manager. Click Next.
11-5
Student Exercises
__ e. From the Profile Name and Location panel, provide the following name and
location information:
- Profile name: Dmgr
- Profile directory: /usr/IBM/WebSphere/AppServer/profiles/Dmgr
- Do not select the Make this profile the default option.
V6.0.2
Student Exercises
EXempty
__ f.
Click Next.
Information
The default profile is the first profile created. It is also possible to change which profile is
designated as the default with the Profile Management Tool or the manageprofiles
command.
When running commands from the <was_root>/bin directory, commands are run against
the runtime environment that the default profile defines. It is also possible to specify a
particular profile by using the -profileName argument.
__ g. The Node, Host, and Cell Names panel allows you to set the node name, cell
name, and host name. Enter was8host01CellManager01 for the Node name,
11-7
Student Exercises
was8host01 for the Host name, and was8hostCell01 for the Cell name. Click
Next.
V6.0.2
Student Exercises
EXempty
__ i.
Click Next.
__ j.
From the Security Certificate (part 1) panel, accept the default selections:
- Create a default personal certificate
- Create a root signing certificate
11-9
Student Exercises
__ k. Click Next.
Note
The Issued to distinguished name and the Issued by distinguished name on the
Security Certificate (Part 2) panel have a common name (CN) that can take different forms,
depending on your environment:
IP address (such as 192.168.192.128)
Fully qualified domain name (FQDN) (such as was8host01.localdomain or
was8host01.ibm.com)
V6.0.2
Student Exercises
EXempty
__ l.
11-11
Student Exercises
__ m. The Port Values Assignment panel allows you to set any ports for the
deployment manager to prevent conflicts with other profiles. Accept the default
port values (which can be different from the example shown).
Information
Note the administrative console port for the deployment manager. This port is used later in
this exercise.
Ordinarily, the administrative console port would use port 9060. However, since a
stand-alone application server is installed, the Profile Management Tool avoids reuse of
any ports. It uses port 9061 instead.
V6.0.2
Student Exercises
EXempty
__ n. Click Next.
Note
Depending on which UNIX operating system is being used, there might be a window
offering to run the deployment manager as a service. In that case, do not allow the process
to run as a service. Click Next.
11-13
Student Exercises
__ o. The Profile Creation Summary panel shows all of the choices you made on
previous panels. Verify the summary information with what you entered
previously. Click Create.
V6.0.2
Student Exercises
EXempty
__ p. The profile creation completes and the Dmgr profile is created. Notice that the
Launch the First steps console check box is selected. Click Finish and the
First steps console launches.
11-15
Student Exercises
__ 3. The First steps console is associated with the deployment manager profile, Dmgr,
that was created. Each profile has its own First steps console. Click Installation
verification from the console.
V6.0.2
Student Exercises
EXempty
__ a. The installation verification test tool runs and shows messages to indicate
verification status. Use the scroll bar to scroll to the bottom to see all the
messages. The following messages are shown if the installation verification was
successful:
IVTL00701: The Installation Verification Tool verification
succeeded.
IVTL00801: The installation verification is complete.
Information
It is possible that there might be several warnings shown. These messages can be ignored.
11-17
Student Exercises
__ b. Verify the status of the deployment manager process by entering the following
command:
./serverStatus.sh -all
Specify the user ID wasadmin and password web1sphere in the dialog box
when you are prompted.
V6.0.2
Student Exercises
EXempty
11-19
Student Exercises
by the deployment manager profile. The federation process adds a node agent to the
application server node.
__ 1. Ensure that both the deployment manager and server1 are running.
__ 2. Open the administrative console for the deployment manager.
The port in this case is not the default port, but instead is port 9061. This difference
is because the system already has profile1, which is using port 9060, for its
administrative console port. The profile creation process therefore chose the next
available port (9061) for the Deployment Manager administrative console.
__ a. Open a web browser and specify the following address:
http://localhost:9061/ibm/console
__ b. If prompted, accept any certificates that are offered and dismiss any warnings.
__ c. Log in to the administrative console as user wasadmin with a password of
web1sphere
__ 3. Federate a node into the cell.
This process takes the existing application server within profile1 and federates it to
the deployment manager. This action means that it no longer is a stand-alone
application server, but instead is part of the newly created cell.
Information
In this lab environment, synchronizing clocks is not an issue since the cell is running on a
single computer. But, when federating distributed computers, it is necessary to make sure
that the clocks on all nodes are within 5 minutes of each other.
.
V6.0.2
Student Exercises
EXempty
11-21
Student Exercises
__ c. The Managed node option is selected as default. Keep this setting. A managed
node contains a WebSphere Application Server and a node agent. The
application server runs as part of the network deployment environment. Click
Next.
__ d. Specify your host name was8host01 for the host. Specify security user names
and passwords for both profile1 and the deployment manager. The user name
and password are wasadmin and web1sphere
V6.0.2
Student Exercises
EXempty
__ e. Select the options to Include applications and Include buses. Keep all
remaining defaults.
__ f.
Click OK.
Information
The port number is the JMX connector port of the node you want to federate to the cell.
11-23
Student Exercises
V6.0.2
Student Exercises
EXempty
11-25
Student Exercises
V6.0.2
Student Exercises
EXempty
11-27
Student Exercises
__ e. Enter was8host01Node02 for the Node name (notice that it has Node02 at the
end) and was8host01 for the Host name. Click Next.
Information
For these labs, use the short name for your host. Although it is acceptable to use another
form of the host name, it is important to be consistent. Since the short name was used in
the initial WebSphere installation lab, the short name is used here as well.
V6.0.2
Student Exercises
EXempty
__ f.
__ g. Click Next.
Information
By not selecting Federate this node later, the wizard process federates the node now.
11-29
Student Exercises
__ h. Accept the defaults on the Security Certificate (Part 1) panel. Click Next.
__ i.
Accept the defaults on the Security Certificate (Part 2) panel. Click Next.
__ j.
Accept the default on the Port Values Assignment panel. Click Next.
__ m. On the Profile Creation Complete panel, clear the Launch the First steps
console option. Do not use the First steps console for profile2. Click Finish to
exit the wizard.
__ n. Close the Profile Management Tool.
V6.0.2
Student Exercises
EXempty
Information
Using a custom profile does not create a server instance. This feature is useful when
adding nodes to a cell. The intention of federating a new node into a cell is normally to
either add cluster members to the node or create servers named something other than
server1.
.
11-31
Student Exercises
Information about the web server is communicated to the deployment manager through the
IBM HTTP Server administrative process.
Create a node and add the web server to the node. When adding a node, you can create
either a managed node or an unmanaged node. A managed node contains a WebSphere
Application Server and a node agent. An unmanaged node does not have a node agent
and is used for defining remote web servers in the topology.
__ 1. Create a new unmanaged node for the web server.
The web server definition uses this new node definition to define the host on which it
lives.
__ a. In the navigation tree, expand System administration and click Nodes.
__ b. Click Add Node.
__ c. In the Add Node window, select Unmanaged node and click Next.
V6.0.2
Student Exercises
EXempty
__ e. Click OK.
__ f.
11-33
Student Exercises
Click Next.
V6.0.2
Student Exercises
EXempty
__ d. On Step 2, specify the web server template. Ensure that IBM HTTP Server is
selected and click Next.
__ e. On Step 3, specify the properties for the new web server. Enter the following
information in the fields as provided.
Table 6: Web server configuration details
Field Name
Value
Port
80
Web server Installation location
/usr/IBM/HTTPServer
Plug-in installation location
/usr/IBM/WebSphere/Plugins
Application mapping
All
Port
8008
User name
ihsadmin
Password
web1sphere
Confirm password
web1sphere
Warning
The plug-in installation location defaults to an incorrect value.
The default value is /usr/IBM/HTTPServer/Plugins, but the correct value is:
/usr/IBM/WebSphere/Plugins
11-35
Student Exercises
Important
Make sure that you modify the default value for the plug-in installation location to the
correct location.
__ f.
V6.0.2
Student Exercises
EXempty
__ 3. Stop and start the web server by using the administrative console.
__ a. Select webserver1 and click Stop. The web server status is now stopped.
Note
It is possible to check whether the web server processes are running with the following
command:
ps -ef | grep -i httpd
If the web server or IBM HTTP Server administrative process is not running, they can be
started with the following commands:
/usr/IBM/HTTPServer/bin/apachectl start
/usr/IBM/HTTPServer/bin/adminctl start
__ b. Start the web server before continuing. Select the web server and click Start.
__ c. To verify that the server started, open a web browser and connect to the IBM
HTTP Server welcome page. Specify the following address:
http://localhost
11-37
Student Exercises
done for you during the last step of defining the web server properties when All was
selected for the Application mapping to the web server. That step mapped all installed
applications to the new web server.
This section of the lab verifies that the applications are correctly mapped to the new web
server.
__ 1. Using the deployment manager administrative console, verify the mapping of the
DefaultApplication modules to the web server.
__ a. From the navigation tree, expand Applications and Application Types.
__ b. Click WebSphere enterprise applications.
__ c. From the list of applications, click DefaultApplication.
__ d. Under Modules, click Manage Modules.
V6.0.2
Student Exercises
EXempty
__ e. Notice that the Default Web Application module maps to both the application
server server1 and the webserver01. This page can also be used to modify the
mappings manually if they do not exist.
__ f.
11-39
Student Exercises
V6.0.2
Student Exercises
EXempty
Information
This step is not necessary because the default behavior is to automatically generate a new
plug-in configuration file whenever an update is made. However, this step confirms that the
setup is working correctly.
11-41
Student Exercises
__ d. The next window shows the plug-in configuration file. Verify that the element
<UriGroup Name="default_host_server1_was8host01Node01_Cluster_URIs">
includes the element
<Uri AffinityCookie="JSESSIONID" AffinityURLIdentifier="jsessionid"
Name="/snoop/*/>
This element ensures that the plug-in recognizes URLs containing /snoop and that
they get forwarded to the application server.
V6.0.2
Student Exercises
EXempty
__ a. From the navigation tree, expand Servers and Server Types. Click Web
servers. You can also go directly to the window by clicking Web servers from
the breadcrumb trail.
__ b. Select the web server and click Propagate Plug-in.
11-43
Student Exercises
V6.0.2
Student Exercises
EXempty
End of exercise
11-45
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
Up to this point you worked with WebSphere Application Server
Version 8 in a single server environment. In this lab, after federating,
you work with a cell and use the deployment manager. You create a
cluster so that the workload can be managed between two servers,
one on each node you already have.
You also set up a memory-to-memory replication domain so that HTTP
sessions can be shared in case of failure of one of the servers.
Requirements
The lab requires that you successfully complete the previous lab on
federation.
12-1
Student Exercises
Exercise instructions
Preface
To do this exercise, you must complete the Federating a cell exercise as it sets up the
environment of the nodes, node agents, and servers that are clustered in this exercise.
V6.0.2
Student Exercises
EXempty
Information
If the node agents need to be started, use the startNode script from a command window
to start them. Make sure that you are in the correct bin folder for the profile you are trying
to start.
12-3
Student Exercises
__ e. Under Select basis for first cluster member, click Create the member by
converting an existing application server, and from the list, select the existing
V6.0.2
Student Exercises
EXempty
server1 server. Note how the Member name and Select node fields are now
filled with the information from the existing server. Click Next.
__ 2. Add a server that is named server2 to the cluster. This server is created in node
was8host01Node02. Additional cluster members can be created either during or
after the cluster creation process.
__ a. Enter server2 for the Member name. This name becomes the name of a new
server that is created.
__ b. Select was8host01Node02 from the list for the node name. This node was
created in the previous lab by using a custom profile.
12-5
Student Exercises
__ c. Make sure that Generate unique HTTP ports is selected. Click Add Member.
Information
Notice that the first server of the cluster is already listed at the bottom of the page. As new
servers are added to the cluster, they are also listed here.
V6.0.2
Student Exercises
EXempty
__ d. Notice that the new server now shows at the bottom of the page. Additional
cluster members can be created now or after cluster creation.
Before saving the changes, if not already done, set the console preferences to
synchronize configuration changes with the nodes when saving. Click the
Preferences link.
12-7
Student Exercises
__ h. Click Apply, and then click Save to save and synchronize with the nodes.
Information
From now on, any saves are automatically synchronized with the nodes during a save.
Preferences settings are persistent and are retained throughout browser invocations.
__ i.
V6.0.2
Student Exercises
EXempty
The ports for server2 are listed. The WC_defaulthost for server2 is 9081. You
need to add this port number to the host aliases list for the default_host.
12-9
Student Exercises
__ d. If 9081 is not already defined, add it by clicking New. Leave the default * for the
host name and specify 9081 for Port. Click OK and Save the changes.
V6.0.2
Student Exercises
EXempty
__ 5. Start PlantsCluster.
Starting the cluster has the same result as starting all the application servers which
are cluster members.
__ a. Select PlantsCluster and click Start to start the servers on the cluster.
Information
Ripplestart is used when you want to restart a cluster without having all members go down
at the same time. This function restarts the individual cluster members one at a time,
ensuring that the other members are available to handle requests.
12-11
Student Exercises
__ c. Select all the modules of the application. Then, in the Clusters and servers list,
select both the PlantsCluster cluster and the webserver1 web server (use the
Ctrl key to select multiple servers).
Make sure that the modules are mapped to both the PlantsCluster and the web
server.
V6.0.2
Student Exercises
EXempty
__ 1. Remove the existing node scoped DB2 Universal JDBC Driver Provider (XA)
provider.
__ a. Using the administrative console, expand Resources > JDBC > JDBC
Providers.
__ b. Select the existing providers that are defined earlier at the
Node=was8host01Node01 scope, and click Delete.
Information
Cluster scope takes precedence over node scope, so node scoped resources do not have
to be deleted. However, deleting them does avoid ambiguity.
Deleting the JDBC provider also deletes any data sources that are defined under it.
12-13
Student Exercises
__ e. Since you do not yet have a cluster-scoped JDBC provider, select Create new
JDBC provider. Click Next.
V6.0.2
Student Exercises
EXempty
Note
The Create a data source wizard temporarily goes to the Create new JDBC provider
wizard.
__ f.
Select DB2 for the Database type, DB2 Universal JDBC Driver Provider for the
Provider type, and XA data source for the Implementation type. Click Next.
__ g. On the next step, enter the database class path information in both boxes. The
path is:
/opt/IBM/db2/V9.5/java
12-15
Student Exercises
__ h. Click Next.
__ i.
V6.0.2
Student Exercises
Click Next.
EXempty
__ j.
__ k. Click Finish.
Copyright IBM Corp. 2012
12-17
Student Exercises
__ l.
Note
For the test to succeed, DB2 and the node agents must be running.
This exercise also assumes that the dbhost definition is added to your hosts file. This
procedure was part of a previous exercise. If not, add dbhost as an alias for your host.
__ d. Check the messages that are generated to make sure that both node agents
were able to connect (ignore any warnings).
V6.0.2
Student Exercises
EXempty
12-19
Student Exercises
The exercise initially demonstrates this problem, but then later configures a solution that
allows the cluster members to share their session information. This means that even if a
cluster member fails, users are still able to access their session through another cluster
member.
__ 1. Restart your environment. Although technically this action is not necessary, for the
sake of this exercise it is best to start in a good state.
__ a. Using the console, stop all the application servers (Servers > Server Types >
WebSphere application servers).
__ b. Using the console, stop all the node agents (System administration > Node
agents).
__ c. Using the console, stop the deployment manager (System administration >
Deployment manager).
__ d. Start your cell by using the startManager and startNode scripts in the bin
directories. Or, use the following script which starts the deployment manager and
both node agents:
/usr/software/scripts/start_cell_aix.sh
__ e. Use the administrative console to Start the PlantsCluster.
__ f.
V6.0.2
Student Exercises
EXempty
__ c. Click any of the available flowers, and then click Add to cart.
12-21
Student Exercises
__ d. This action takes you to the Shopping Cart. Notice the flower that you selected
is listed.
__ e. Click the Trees tab in the upper left, select a tree entry, and add it to your cart.
Notice that both your flower and your tree are in your shopping cart.
Information
How does this work? Based on the content of the JSESSIONID cookie, the web server
plug-in knows which server is hosting your information. Given that affinity, the plug-in
makes sure to route all of your requests to the same server (or cluster member).
This feature allows the server to store what is in your shopping cart and make it available
as you continue to shop.
V6.0.2
Student Exercises
EXempty
__ 4. View the server runtime information. This information is useful to understand the
failover testing that is done later in this exercise.
__ a. To view the runtime server information, click Help in the navigation bar at the top
of the screen.
__ b. On the Help page, click the View Server Info link near the bottom of the page.
12-23
Student Exercises
__ c. On the server information page, notice that the Process field shows the server
name and that the Session Data and Session Created fields are null.
__ 5. Continue shopping.
__ a. Click the HOME link in the top navigation bar of the View Server Info page.
V6.0.2
Student Exercises
EXempty
__ c. Notice that the shopping cart continues to include your previously added items.
__ d. Return to the View Server Info page (Help > View Server Info) and notice that
server name in the Process field remains the same. This information does not
change because of the affinity with that server.
__ d. Make sure that the server is stopped before returning to the PlantsByWebSphere
window.
12-25
Student Exercises
__ e. Click the Status refresh icon until the Status shows a complete stop.
__ f.
Information
Why is the shopping cart information lost?
The PlantsByWebSphere application is not coded to store the shopping cart in the session
information. This means that a server failure causes the loss of the shopping cart contents.
If the failover of your session information is important, it is necessary to design your
application with session failover in mind. There are a number of different possible designs,
but that discussion is outside of the scope of this course.
One possible approach is to store the contents of the shopping cart in the HTTP session
object. This approach is demonstrated in the next part of this exercise.
V6.0.2
Student Exercises
EXempty
In this next section, you confirm that these required settings are enabled. Had you not
selected this option, you would be required to do this action manually.
__ 1. Check the memory-to-memory session replication settings for the cluster members.
__ a. Select Servers > Server Types > WebSphere application servers.
__ b. Click the hyperlink for either one of the servers.
__ c. Under Container Settings, click Session management.
12-27
Student Exercises
__ f.
Notice that the Replication domain is set to PlantsCluster and the Replication
mode is set to Both client and server.
Information
If your application required failover for stateful session beans, further configuration would
be needed to set up that memory-to-memory replication.
V6.0.2
Student Exercises
EXempty
__ c. Take note of the time that is shown in the Session Created field:
_____________
__ d. Click HOME and add several items to your shopping cart.
__ e. Return to the View Server Info page (through the Help page) and notice that the
session data and time created are not changed.
__ 4. Simulate a server failure.
__ a. Return to the administrative console window or tab, and Stop the server to which
you have affinity.
__ b. Wait for the server to stop completely.
__ 5. Verify the session data failover.
__ a. Return to the browser tab or window that you used for accessing the
PlantsByWebSphere application.
__ b. Click Home and then click Shopping Cart. Notice that the shopping cart is
empty. This condition is expected.
12-29
Student Exercises
__ c. Return to the View Server Info page. Notice that the server name changed to
the other cluster member. Also, notice that the Session Data and Session
Created fields stayed the same.
Information
What does this exercise demonstrate?
Since you already understand that the shopping cart for PlantsByWebSphere does not fail
over, the fact that the shopping cart is empty after a failure is not a surprise. However, this
last section demonstrates the use of an HTTP session object within the code, and the fact
that the cluster members can fail that data over between the cluster members.
The other thing to note is that your browser now has affinity to the new server.
End of exercise
V6.0.2
Student Exercises
EXempty
12-31
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
There are many changes to the way WebSphere default messaging is
configured in WebSphere Application Server V8. There are new
wizards to assist you in configuring how the messaging engines
behave depending on the messaging engine policies. It is now
possible to configure for high availability, providing automatic failover
mechanisms. You might also configure for scalability where
messaging engines can split the volume of messages and share the
processing load. There is also a preconfigured policy for a combination
of high availability and scalability.
Operating a secured messaging bus is also simplified by improving the
way users and groups are assigned the different roles necessary to
send, receive, and connect to a messaging bus.
In this exercise, you configure both JMS and service integration bus
resources to support two applications. The first application creates
simulated transactions that represent buying and selling stocks. On a
Copyright IBM Corp. 2012
13-1
Student Exercises
web page in the application, you can select the number of transactions
of each type (buy or sell). Each transaction places messages on a
JMS queue.
The second application uses an MDB to listen to the same queue and
receives the messages that the simulator sends. The transactions are
displayed on a table. Every 30 seconds the oldest transaction is
removed from the table.
Requirements
To run this exercise, you must first complete Exercise 12: Clustering
and workload management. Additionally, this exercise assumes that
HPEL is enabled for the application servers. HPEL is enabled in
Exercise 9: Problem determination.
V6.0.2
Student Exercises
EXempty
Exercise instructions
Section 1: Resetting the WebSphere environment
Note
If you need to reset your WebSphere environment, then see Appendix A for instructions
on how to correctly reset the environment.
Function
This application simulates the function of
buying and selling stocks. You can select
how many shares to buy or sell. For each
operation, a message is placed on a JMS
queue. Each message has a transaction
number that includes the name of the server
that produced it and a sequence number.
You can view the action of placing the
message on the queue in the SystemOut log
file.
13-3
Student Exercises
Function
A message-driven bean EJB (MDB) drives
this application. This bean listens on the
same queue on which the simulator places
messages. As the MDB receives messages,
the messages are listed in a table on a web
Trade Processor Application
page and displayed to the user. Every 30
TPApplication.ear
seconds the oldest message is assumed to
be processed and is removed from the table.
As messages are received and discarded,
trace entries are written to the SystemOut
log file.
Below you see the user interface for both applications:
V6.0.2
Student Exercises
EXempty
From the Monitor web page, you can create Buy messages and Sell messages and
send them to a server for processing.
From the same Monitor web page, you can see which server received the messages for
processing. The Transaction column shows what server sent the message and the order in
which the message was received.
Later in this exercise you install and configure these applications. You also configure the
JMS and SIBus resources to make messaging work. Then, you try different messaging
engine policies to see how you can change the behavior of the applications when running
in a cluster to take advantage of scalability and high availability.
13-5
Student Exercises
V6.0.2
Student Exercises
EXempty
13-7
Student Exercises
__ g. On Step 1 of the wizard, enter msgBus for the name of the bus. Also, make sure
that Bus security is checked. Click Next.
__ h. In the next page of the wizard, you configure bus security. This task is a
multiple-step process. Step 1.1 is the introduction. Read the information and
then click Next.
V6.0.2
Student Exercises
EXempty
__ i.
The next step in setting up bus security is to configure whether you need to use
SSL for the transport. Since you are in a secured, isolated network, you do not
require SSL. Clear the check box for Require clients use SSL protected
transports. Click Next.
13-9
Student Exercises
__ j.
Next, you choose which security domain to use for authenticating bus users. For
this exercise, select Inherit the cell level security domain. Click Next.
On the final page, click Finish to complete the creation of the new bus. Wait a
few minutes for the creation of the new bus.
Note
To run with bus security enabled, global security must be enabled. The wizard
automatically enables global security if you request the creation of a secure bus. Notice
that this configuration did not require an SSL transport. Starting with WebSphere
Application Server Version 7, an authentication alias is not required for inter-engine
communications (if all messaging engines are running on version 7 or higher).
V6.0.2
Student Exercises
EXempty
Important
Make sure that you are using the Firefox browser.
The Internet Explorer browser requires Adobe SVG to support the messaging engine policy
assistance wizard. You can download Adobe SVG from
http://www.adobe.com/svg/viewer/install/ and install it on Internet Explorer.
The Firefox browser has SVG support that is built in, so use Firefox for this lab exercise.
__ 2. Assign the PlantsCluster as a bus member and configure the high availability
messaging engine policy.
__ a. On the Buses page, click msgBus.
__ b. On the next page, under Topology click Bus members.
__ c. On the Bus members page, click Add.
13-11
Student Exercises
__ d. Select the Cluster radio button. The only defined cluster, PlantsCluster, is
preselected.
__ e. Click Next.
Information
In previous versions of WebSphere Application Server, setting up the core group policies
that determine how messaging engines behave in a clustered environment was a complex
task. Starting in version 7, you can enable messaging engine policy assistance and use
wizards in the administrative console to assist you in selecting and maintaining messaging
engine policies. In this exercise you configure and test two policies, first high availability
and then scalability.
V6.0.2
Student Exercises
EXempty
Notice that the diagram shows the suggested configuration of the bus member,
PlantsCluster, for the high availability messaging engine policy.
__ b. Click Next at the bottom of the messaging engine policy assistance settings
window.
13-13
Student Exercises
__ c. Select File store. This file store is used to make sure that any messages can be
persisted. Click Next.
__ e. In the previous step you select the type of message store, File store. Now you
need to specify where to locate the log files. Click the
PlantsCluster.000-msgBus link.
V6.0.2
Student Exercises
EXempty
__ f.
Enter ME_logs for the Log directory path and ME_store for the Permanent
store directory path.
These settings cause new directories named ME_logs and ME_store to be created
under <profile_root> for each of the cluster members.
__ g. Click Next.
__ h. Verify that you now see Yes in the column: Is the message store configured?
13-15
Student Exercises
__ i.
__ j.
__ k. Read the Summary page and click Finish. The bus member is now fully
configured and available.
__ l.
__ m. Verify that the messaging engine policy is enabled for high availability.
V6.0.2
Student Exercises
EXempty
13-17
Student Exercises
__ f.
__ g. Read the confirmation page and note that this process creates the queue points.
Click Finish.
__ h. Save the changes to the master configuration.
__ i.
Information
When running a service integration bus with security enabled, you must configure which
users and groups are authorized for the different roles that the bus requires. In the
following steps, you assign users to security roles. However, before the actual bus security
authorization can be configured, you need two other settings:
Create a J2C alias that the resources use to authenticate with the server.
Create a user in the user registry that matches the J2C alias so authentication
can succeed.
V6.0.2
Student Exercises
EXempty
13-19
Student Exercises
__ f.
__ 6. Create a user in the current user registry that matches the attributes of the J2C
alias.
If the SIBus attempts to use the new J2C authentication alias to authenticate, that
user needs to exist in the user registry.
__ a. On the administrative console, click Users and Groups > Manage Users.
__ b. Click Create.
__ c. Enter busUser for the User ID. The First name and Last name can be anything;
use SIBus and User. Enter web1sphere for the passwords.
V6.0.2
Student Exercises
EXempty
__ c. Under Authorization Policy on the right, click Users and groups in the bus
connector role. To connect to the bus, valid credentials must be presented.
__ d. Click New.
13-21
Student Exercises
__ e. On the first page of the wizard, select Users and click Next to search for all
defined users.
__ f.
A list of defined users in the current user registry is displayed. From the list,
select busUser and click Next.
V6.0.2
Student Exercises
EXempty
Remember that applications have no knowledge of the service integration bus itself. The
applications use JMS to place and retrieve messages that use, in this case, a JMS queue.
__ 1. Create a connection factory called Trade Connection Factory.
The connection factory defines how the JMS messages reach the bus.
__ a. In the administrative console, go to Resources > JMS > Connection factories.
13-23
Student Exercises
__ c. Click New.
__ d. Select Default messaging provider. Click OK.
__ e. Change only the following values; accept the defaults for all the rest.
Table 8: Fields and values for the connection factory
Field
Value
Name
JNDI name
jms/tradeCF
Bus name
msgBus
Mapping-configuration alias
DefaultPrincipalMapping
Container-managed
authentication alias
was8host01CellManager01/SIB User
__ f.
V6.0.2
Student Exercises
EXempty
This object is a JMS queue that is being created. The configuration gives it a JNDI
name, defines it to exist on the msgBus, and maps it to the internal bus queue
destination that was created earlier in this exercise.
__ a. On the administrative console, click Resources > JMS > Queues.
__ b. From the Scope menu, select Cluster=PlantsCluster.
__ c. Click New.
__ d. Select Default messaging provider. Click OK.
__ e. Change only the following values; accept the defaults for all the rest.
Table 9: Fields and values for the queue
__ f.
Field
Value
Name
JNDI name
jms/tradeprocq
Bus name
msgBus
Queue name
TradeQueueDestination
13-25
Student Exercises
__ e. Change only the following values; accept the defaults for all the rest.
Table 10: Fields and values for the activation specification
__ f.
Field
Value
Name
JNDI name
jms/tradeAS
Destination type
Queue
jms/tradeprocq
Bus name
msgBus
Authentication alias
was8host01CellManager01/SIB User
V6.0.2
Student Exercises
EXempty
13-27
Student Exercises
__ f.
__ g. Click Next.
__ h. Select Detailed - Show all installation options and parameters and click
Next.
__ i.
__ j.
__ l.
Click Apply.
V6.0.2
Student Exercises
EXempty
Note
Notice that the steps to map modules to servers is not necessary because WebSphere
maps the modules automatically. However, it is worth verifying that the mapping is correct.
13-29
Student Exercises
__ s. The page expands to show the different options for authentication. Select Use
default method and from the menu select was8host01CellManager01/SIB
User. Click Apply.
__ t.
Select the MSgSenderWeb module again and click Browse in the Target
Resource JNDI Name column of the table to see all defined JNDI names for
connection factories.
V6.0.2
Student Exercises
EXempty
__ u. There is only one connection factory configured. Select it and click Apply.
__ v. Verify that the JNDI name and the authentication method are set correctly.
__ w. Click the link for Step 13: Summary. Read the summary and click Finish.
__ x. Wait for the application to install successfully, and click Save to save it to the
master configuration.
__ y. The wizard returns to the first page, where you can install the next application.
__ 2. Install the Trade processor application.
This application consumes the messages, so it needs to know how to find the
activation specification (already coded into the application).
__ a. Select Local file system.
__ b. Click Browse to the right of the Full path entry field.
__ c. Navigate to the folder /usr/software/Messaging
13-31
Student Exercises
__ e. Click Next.
__ f.
Select Fast Path - Prompt only when additional information is required and
click Next.
__ j.
V6.0.2
Student Exercises
EXempty
__ a. From the administrative console, click Applications > Application Types >
WebSphere enterprise applications.
The application status that you see depends on whether the node agents and
application servers are started. You start all the required servers in the next part
of the exercise.
Note
Most likely you see more applications that are installed on your lab workstation; it depends
on what you installed in previous lab exercises.
13-33
Student Exercises
__ f.
V6.0.2
Student Exercises
EXempty
Note
Ripplestart stops servers (if they are running) and then starts all servers in a cluster, waiting
for each of the servers to start before moving on to the next server. Ripplestart alleviates
the load on the processor because only one server is ever starting at a time.
__ c. Wait for the Status indicator to turn to a solid green arrow (it can take several
minutes) signifying that all servers in the cluster are started. (You might need to
click the refresh icon several times.)
__ d. Verify that both servers are started by clicking Servers > Server Types >
WebSphere application servers.
__ e. If either of the servers is not yet started, select the server and click Start.
__ 3. Ensure that both the applications you installed earlier are running.
__ a. In the administrative console, click Applications > Application Types >
WebSphere enterprise applications.
__ b. Verify that both applications are in a started state.
Note
If either of the applications is not running, and does not start upon selecting it and clicking
Start, check the SystemOut logs to determine what is preventing the application from
Copyright IBM Corp. 2012
13-35
Student Exercises
starting. Check the steps that you went through when you installed the applications. The
problem is most likely related to the resolution of resource references or authentication
aliases not being applied to the resource references. If after checking these settings you
still have a problem, contact your instructor.
V6.0.2
Student Exercises
EXempty
Information
There are two applications that are installed, a message producer and a message
consumer. The message simulator application is the message producer; the trade
processor application is the consumer of messages. Since the applications are installed in
a cluster, each server in the cluster runs both applications.
When using the high availability messaging engine policy, only one messaging engine
is started in the cluster. A WebSphere component that is called the high availability
manager decides which server in the cluster gets to run the messaging engine (usually the
first server that is started in the cluster). If the server that runs the messaging engine fails,
the high availability manager chooses another cluster member and starts the messaging
engine there. In this configuration, the messaging engine can fail over to another cluster
member, thus providing high availability.
Producers in any cluster member can generate and place messages on a queue. However,
only the consumer that is on the same server as the running messaging engine gets to
consume and process the messages. In the next few steps, you prove these points.
__ 4. Start the Monitor HTML page. The web page is provided as part of the Trade
processor application to more easily demonstrate the interactions between the
application servers and messaging engines.
__ a. Open a new browser and enter the web address:
http://localhost:9080/Trade/processor/Monitor.html
13-37
Student Exercises
__ b. Since you run the Monitor repeatedly throughout the rest of this exercise, you
might want to bookmark the web address in your browser.
V6.0.2
Student Exercises
EXempty
__ a. From the upper left frame of the Monitor web page (Sending messages from
server: server1), leave the default values (one message) for Buy and Sell
messages, and click Send messages.
Examine the log files for whatever server processed the messages in the last few
steps. If you did not enable HPEL for that server, open its SystemOut.log file
13-39
Student Exercises
with a text editor. If HPEL is enabled, use the Log Viewer and go to the last page
of the logs. Look for messages similar to the following.
Note
The application that receives the messages is the one running on the server where the
messaging engine is active. You can verify this behavior by looking at the logs for both
cluster members and looking for the message that indicates the messaging engine is in the
Started state:
Messaging engine PlantsCluster.000-msgBus is in state Started.
The other server in the cluster has a message which indicates that the message engine is
in the Joined state:
Messaging engine PlantsCluster.000-msgBus is in state Joined.
V6.0.2
Student Exercises
EXempty
__ c. This message indicates that the messaging engine is started on the server that is
still running.
__ d. From the administrative console, start the server that you stopped in Step (a).
__ e. Wait for the server to start; then open a browser and enter the Monitor web
address: http://localhost:9080/Trade/processor/Monitor.html
__ 7. Now check which server is processing the messages as you did before.
__ a. From the upper left frame of the Monitor web page (Sending messages from
server: server1), leave the default values for Buy and Sell messages and click
Send messages.
__ b. Observe which server processed the messages, server1 or server2.
__ c. Record the server name here ________________________. In the high
availability policy, only one server in the cluster is running the messaging engine.
__ d. From the lower left frame of the Monitor web page (sending messages from
server: server2), leave the default values (one message) for Buy and Sell
messages and click Send messages.
__ e. Record the server name here ________________________. The same server is
processing messages that are sent from both server1 and server2.
__ f.
You can observe that even though the messaging engine failed over to the other
server, when the original server is running again, the messaging engine
continues to run on the server it failed over to. The high availability policy has
failover but not fail back.
13-41
Student Exercises
__ 8. Configure the activation specification to start all MDBs in the cluster. There is an
option to configure an activation specification to activate message-driven beans
(MDBs) in all the servers, not just the server with the running messaging engine.
The result of this configuring option is that all consumers in all cluster members
receive messages.
__ a. From the administrative console, click Resources > JMS > Activation
specifications.
__ b. Click the link for the Trade Processor Activation Spec.
__ c. Near the bottom of the page, in the Advanced section, select Always activate
MDBs in all servers, and click OK.
V6.0.2
Student Exercises
EXempty
__ b. Make sure that both Trade processor applications have no pending transactions.
You can quickly clear the table of pending transactions if necessary by selecting
Reset from the Refresh menu.
__ c. Leave the default values of 1 Buy and 1 Sell messages and click Send
messages in the upper left frame.
__ d. Which processor application displayed the messages? You can see similar
behavior in your own browser. Server 1 processed one message, the Buy
message; and Server2 processed the other message, Sell. As a result of the
Copyright IBM Corp. 2012
13-43
Student Exercises
configuration of the activation specification that you just completed, there is now
an active MDB on each server that can consume messages.
__ e. Now from the lower left frame, send three Buy messages and two Sell
messages.
V6.0.2
Student Exercises
EXempty
__ f.
__ g. Try sending some more messages from the producers in both servers and see
which consumer picks up the messages.
__ h. Close the browser in which the Monitor is running.
Information
Possible performance issues
One of the problems with this activation specification configuration is that the single active
messaging engine is now sending messages to queue points in multiple servers. In a local
network with a small volume of messages, there might not be any performance issues. But
in a widely distributed environment, with heavy volume of messages, it can cause
performance problems because of network traffic.
To provide better scalability, you can change the messaging engine policy to Scalability
which requires a messaging engine in each cluster member.
13-45
Student Exercises
Two different messaging engines run on their preferred server unless that server fails; then
its messaging engine fails over to the other server.
Use the messaging engine policy assistance wizard to configure the Scalability policy.
V6.0.2
Student Exercises
EXempty
The wizard guides you through adding the second messaging engine and correcting the
policy for scalability. When the configuration is completed, the wizard displays the new
Scalability policy.
13-47
Student Exercises
or might not, prefer a local queue point. This choice depends on the requirements of your
application. This option is part of the JMS queue configuration.
End of exercise
V6.0.2
Student Exercises
EXempty
13-49
Student Exercises
V6.0.2
Student Exercises
EXempty
14-1
Student Exercises
Introduction
This lab configures access to the administrative console by defining a
number of roles and mapping those roles to existing users. To test the
configuration, you attempt various functions from the different users
and verify that the security configurations correctly limit access to
various functions.
The last part of this lab defines fine-grained access from different parts
of the WebSphere environment.
Requirements
This exercise requires a workstation with WebSphere Application
Server V8 installed and the successful completion of the previous
exercises.
V6.0.2
Student Exercises
EXempty
Exercise instructions
Section 1: Resetting the WebSphere environment
Note
If you need to reset your WebSphere environment, then see Appendix A for instructions
on how to correctly reset the environment.
14-3
Student Exercises
Information
If administrative security is not enabled, you need to check the box, save your changes,
and make sure that all nodes are synchronized. Then, restart all of the WebSphere
processes (deployment manager, node agents, and application servers).
__ c. The wasadmin user was created during the profile creation, and the busUser
user was created in a previous exercise. To create more users for this lab, click
Create.
V6.0.2
Student Exercises
EXempty
Information
Other users might also exist, depending on which exercises are already completed.
__ e. Click Create Like to create more users. Repeat this process for the following
additional user IDs:
wascfg
wasmon
wasoper
Again, enter anything for the First name and Last name, but use web1sphere for
the passwords.
__ f.
These user IDs are being created inside of the WebSphere file-based user repository, not
in the local operating system user registry or in LDAP.
__ 2. Map these new user IDs to their appropriate administrative console roles.
__ a. Under Users and Groups in the administrative console, select Administrative
user roles.
Copyright IBM Corp. 2012
14-5
Student Exercises
__ b. Click Add.
Information
Notice that the wasadmin entry listed is mapped to Primary administrative user name.
This mapping means that it is the security user that is defined during the profile creation. As
such, it has implicit mappings to all security roles.
__ c. Click Search to view the list of available users. Select wasadm from the
Available column near the bottom of the screen and click the right arrow to
move it to the Mapped to role column. Next, select the Administrator role near
V6.0.2
Student Exercises
EXempty
the top of the screen. Click OK to create the mapping between the wasadm user
and the Administrator role.
Information
Depending on what components are installed, there can be more roles within the list.
Depending on which labs are completed, your list of users might be different from the
screen capture that is shown.
__ d. Repeat these last two steps for wasoper, wascfg, and wasmon (mapping each
user to the appropriate role).
14-7
Student Exercises
__ 4. Extra credit (optional): Go back and add a console user that is called wassecmgr
and map it to the Admin Security Manager role.
This user can now be used to map security roles for console users. The only user
that has this ability so far would be wasadmin because it is the primary user (and
therefore has this ability implicitly).
V6.0.2
Student Exercises
EXempty
Information
By default, the user that is used to define the authentication mechanism has implicit access
as an administrator role.
14-9
Student Exercises
__ b. Log back in to the administrative console as wasoper, and notice what functions
are available on the Enterprise applications.
__ c. Notice that not all the same functions are available. Now, only Start, Stop, and
Rollout Update are available.
__ 4. Log in as wascfg and wasmon and notice what functions are available.
__ 5. Close all web browsers. Closing the browsers ensures that there are no existing
session cookies when starting the next section of the exercise.
14-10 WebSphere Application Server V8 Administration
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V6.0.2
Student Exercises
EXempty
__ b. In the administrative console, expand Users and Groups in the left navigation
menu and select Manage Users.
__ c. Leave the defaults and click Search. The list of current WebSphere
administrative users is displayed. Click Create.
__ d. Enter the user ID: PlantsAppAdmin
Enter anything for the First name and Last name. Enter web1sphere for the
Password and Confirm password. Next, click Create.
__ e. Repeat this process to create the DefaultAppAdmin user.
__ 2. Map the two new users to the global monitor role. Any console user or group that is
used for fine-grained access requires a minimum role mapping of monitor. This
requirement means that they can view any objects, but can have more rights on
specific objects that administrative authorization groups define.
14-11
Student Exercises
V6.0.2
Student Exercises
EXempty
14-13
Student Exercises
__ d. Under Resources, expand all the entries and the subentries. Take note of all of
the different levels that can be defined in an administrative authorization group.
Expand Applications; select the box next to PlantsByWebSphere.
__ e. Click Apply.
__ f.
V6.0.2
Student Exercises
EXempty
Information
In some cases, the Additional Properties are not rendered, and a browser refresh does
not seem to solve the problem. In such cases, try:
Save the changes, go back through Security > Administrative Authorization
Groups, and click PlantsAppGroup.
Close the console browser and start a new console window in a new browser.
14-15
Student Exercises
__ h. Select the Administrator role and then click Search to show all known users.
Select PlantsAppAdmin and then click the right arrow to move the user from
the Available column to the Mapped to role column.
__ i.
Click OK.
__ j.
Save the changes and make sure that the nodes are synchronized.
V6.0.2
Student Exercises
EXempty
__ l.
Save the changes. Wait for the nodes to synchronize and click OK. The final list
looks like:
Information
There are now two new administrative users, which are called PlantsAppAdmin and
DefaultAppAdmin. Both have Monitor access to the cell. This means that using the
console, they can view the contents of the cell, but they cannot modify anything.
Additionally, there are two new Administrative Authorization Groups that are called
PlantsAppGroup and DefaultAppGroup, scoped at the PlantsByWebSphere and
DefaultApplication applications. These groups define what other administrative rights can
be available for those two applications.
Finally, the PlantsAppAdmin user is mapped to PlantsAppGroup, and the
DefaultAppAdmin user is mapped to DefaultAppGroup.
The result is that these two new users have Monitor access to everything in cell.
Additionally, they also have Administrative rights, but only to their specific applications.
14-17
Student Exercises
__ 2. When logged in, browse through various parts of the console. Notice that the
PlantsAppAdmin user has only monitor rights to most areas. But, also notice that
V6.0.2
Student Exercises
EXempty
14-19
Student Exercises
that this user has administrative access to the DefaultApplication, but not to anything
else.
V6.0.2
Student Exercises
EXempty
14-21
Student Exercises
__ 2. Define the security domain details by associating a scope with specific security
attributes.
__ a. There are two main sections on this screen. The first is the Assigned Scopes.
Expand the Cell and then the Clusters.
Information
Security domains allow you to assign security configurations to defined portions of a cell.
By assigning the scope, you are defining which portion of the cell is affected.
__ b. Select PlantsCluster.
__ c. Explore the other available scopes.
__ d. Move down to the Security Attributes section of the screen and explore the
various security attributes that are available to associate with the previously
selected scope.
V6.0.2
Student Exercises
EXempty
__ f.
Expand the Java 2 Security section. Notice that it is possible to enable Java 2
Security for only the selected scope.
14-23
Student Exercises
__ g. Expand the User Realm section. Notice that it is possible to define an alternative
user registry for only selected scopes.
__ 3. Cancel the security domain settings. The intention of this section was to show what
some of the possibilities are for security domains and not to actually create one.
Cancel the changes if you did not yet save.
__ a. Click Cancel if available.
__ b. At the top of the next screen, you have the opportunity to Save the changes.
Instead, click Review.
__ c. To ensure that no changes are saved, click Discard and click Yes to confirm.
__ d. Finally, click OK to complete the process of dismissing the changes.
__ 4. Log out of any administrative console windows and close all browsers.
End of exercise
V6.0.2
Student Exercises
EXempty
14-25
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
This lab deals with using the administrative console and the IBM
Assembly and Deploy Tools to configure application security for the
PlantsByWebSphere application.
Requirements
This exercise requires a workstation with WebSphere Application
Server V8 installed and completion of the previous exercises.
15-1
Student Exercises
Exercise instructions
Section 1: Resetting the WebSphere environment
Note
If you need to reset your WebSphere environment, then see Appendix A for instructions
on how to correctly reset the environment.
V6.0.2
Student Exercises
EXempty
__ c. Check the box next to Enable application security and click Apply.
Information
WebSphere administration security is already enabled during profile creation. All that is
being done is the enabling of application security. As such, there is no need to define user
registries or authentication mechanisms.
15-3
Student Exercises
Information
In older versions of WebSphere, all processes within the cell required a restart. Because
global security is already enabled at profile creation time, the inclusion of application
security only required the restarting of the application servers.
V6.0.2
Student Exercises
EXempty
__ e. Click Close.
__ 2. Test the application before mapping the roles to users and groups.
__ a. Close all of your current browser windows.
__ b. With all the servers up and running, use a new browser to access the admin
servlet by going to the following address:
http://localhost:9080/PlantsByWebSphere/admin.html
You can also access this servlet by going to the PlantsByWebSphere home
page and clicking the Help link. From there, you can click Admin Home.
15-5
Student Exercises
Important
Existing browsers might already have authentication information for connection to the
administrative console, which can interfere with attempts to log in to the
PlantsByWebSphere application.
To solve this problem, either close all current browser windows or clear the current browser
information. To clear any authentication in a Firefox window, try selecting Tools > Clear
Recent History, and click Clear Now.
Other solutions include the use of a second browser type or configuring Firefox profiles.
__ d. Notice that you are not authorized to access this page (with some browsers, you
might be prompted repeatedly and not get an error). You are not authorized
V6.0.2
Student Exercises
EXempty
because the user PlantsUser does not have access to the PlantsByWebSphere
application.
Information
Note: only the administration part of the application is enabled for security. The rest of the
application can be accessed just as before application security was enabled.
__ 3. Create a registry group and user which can be mapped to the PlantsByWebSphere
application.
Information
It would be easiest to map the application security role to a list of users. However, it is a
much better practice to use a group instead.
__ a. Log back in to a new administrative console window and expand Users and
Groups. Click Manage Groups.
__ b. Click Search. This search displays the list of current WebSphere administrative
groups. You can see that there are not any groups yet.
15-7
Student Exercises
__ c. Click Create. Enter PlantsGroup for the Group name and anything for the
Description. Click Create.
__ d. Click Close.
__ e. Click PlantsGroup.
V6.0.2
Student Exercises
EXempty
__ f.
__ i.
15-9
Student Exercises
__ j.
You created a user called PlantsUser. This user is added to the newly created
PlantsGroup.
Next, you map the PlantsGroup to the PlantsByWebSphere application, thus granting any
members of the PlantsGroup access to the restricted parts of the Plants application.
__ 4. Map users and groups to Java EE security roles that are defined within the
enterprise application.
The SampleAdmin role exists inside of PlantsByWebSphere, along with mappings to
various methods. The task now is to allow the runtime environment to be aware of
which users or groups are part of that SampAdmin role in your particular
environment.
__ a. Click Applications > Application Types > WebSphere enterprise
applications.
__ b. Click the PlantsByWebSphere application link.
V6.0.2
Student Exercises
EXempty
Information
There are four types of users: Everyone, All authenticated, Mapped users, and Mapped
groups. The first two do not apply to this exercise as you do not want Everyone to access
the administration module; and since there was no previous opportunity to authenticate,
that rules out All authenticated.
The mapped entries refer to users and groups in the current user registry.
__ e. Make sure that the Search String is * and click Search. The Available list fills
up with the group defined within the WebSphere user registry.
Copyright IBM Corp. 2012
15-11
Student Exercises
__ f.
Select PlantsGroup and click the right arrow to move the entry to the Selected
list.
__ g. Click OK.
V6.0.2
Student Exercises
EXempty
__ h. Click OK again. (Note: The changes do not get set until the second OK.)
__ i.
__ 6. Close all web browser windows. Open a new web browser to access the admin
servlet.
__ a. Close the existing browsers.
__ b. Open a new browser (or clear all state information for the existing browser).
Information
It is also possible to clear any authentication in the browser. To clear authentication in a
Firefox window, select Tools > Clear Recent History and click Clear Now.
__ c. Access the PlantsByWebSphere admin servlet page through the Help > Admin
Home link or though the following URL:
http://localhost:9080/PlantsByWebSphere/admin.html
__ 7. Log in using PlantsUser and web1sphere
15-13
Student Exercises
Warning
By default, the application server has a 10-minute authentication cache timeout. Therefore,
if information is still cached, it might not time out for up to 10 minutes.
If this possibility is a problem, you can either wait until the timeout happens or restart the
application server.
To view you security authentication timeout settings, go to Security > Global security >
Authentication cache settings (which is under Authentication mechanisms).
V6.0.2
Student Exercises
EXempty
__ 10. Click the Home link to return to the main part of the PlantsByWebSphere
application.
__ 11. Disable application security.
__ a. Return to the global security screen in the administrative console and clear the
box next to Enable application security.
__ b. Click Apply, and Save the changes.
__ c. Synchronize the nodes.
__ d. Restart the application servers.
__ c. Click OK.
15-15
Student Exercises
__ 4. The first interesting questions on your mind probably are: Why does browsing to the
Admin Actions page (/adminactions.html) cause an authentication challenge, and
how does the application know what challenge type to use?
__ a. If there are warnings and errors, do not worry, as you are exploring only the
contents of the EAR.
__ b. In the Enterprise Explorer, expand PlantsByWebSphereWeb > WebContent >
WEB-INF. Double-click web.xml, which represents the deployment descriptor.
The Web Application Deployment Descriptor Editor for this module opens on the
editor pane on the upper right corner of the window.
V6.0.2
Student Exercises
EXempty
You might see errors that are detected at the top of the page. These errors can be
ignored.
15-17
Student Exercises
Note
The Authentication Method is set to BASIC. This setting means that when authentication is
needed for a page, the browser is sent a message to challenge the user with a basic
authentication dialog box. Perhaps a better alternative is to use a FORM-based challenge.
This alternative allows the developer to specify a specific form-based login page that is
used to challenge the user.
V6.0.2
Student Exercises
EXempty
__ b. Click the Web Resource Collection (under Security Constraint) in the web
application structure of the editor.
In the Details section of the Web Resource Collection, you see a set of HTTP
access methods and URL patterns, which can be assigned to an Authorized role.
In this case, you see that one of the URL patterns is /adminactions.html.
Information
What are you seeing here?
The /adminactions.html URL pattern is associated with both a web module
(PlantsByWebSphereWeb) and a security role (SampAdmin). You also see that a basic
login type is associated with the web module. But how does the login type translate to the
application security?
The answer to that question is all in the WebSphere runtime environment. When a user
attempts to access a protected URL (in this case, /adminactions.html), the runtime
environment interrupts the process to verify that the user has the required authority to
proceed. In this case, users (PlantsUser) must be authenticated (a basic authentication
Copyright IBM Corp. 2012
15-19
Student Exercises
challenge is issued if a user is not already authenticated) and their user ID needs to be
mapped to the security role (SampAdmin). In this case, the user PlantsUser is part of the
PlantsGroup, which in turn is mapped to the SampAdmin role.
If initial authentication is unsuccessful, users do not gain access to the URL and are
instead returned a message which indicates that they were unable to authenticate.
If the authentication is successful, but the users are not mapped to the security role (either
directly or through a group), the users again do not gain access to the URL. Instead, the
users are returned a message which indicates that they are not authorized to access the
URL.
__ 6. Close IBM Assembly and Deploy Tools when you finish exploring.
End of exercise
V6.0.2
Student Exercises
EXempty
15-21
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
WebSphere Application Server V8 configures and manages many of
the SSL configurations that are required to secure communication
within a cell. It is important to understand how this infrastructure works
so that it can be maintained correctly. This exercise creates a profile
and examines the certificates and keystores that are created for that
new profile or node. The exercise then looks at the interfaces that deal
with expiring certificates. It also examines the log files and security
reports that are helpful in tracking when certificates are about to
expire.
Another important step in managing a WebSphere environment is
propagating keystores out to the web server plug-in. This lab goes
through the steps to view the plug-in generated keystore, followed by
propagating them out to the web server.
As an optional part of the lab, the last section configures the IBM
HTTP Server for inbound SSL. iKeyman is used to generate a new
keystore and self-signed certificate. IBM HTTP Server is then
configured to use the newly created certificate to support HTTPS
communications.
Copyright IBM Corp. 2012
16-1
Student Exercises
Requirements
This lab requires a computer that is properly set up with WebSphere
Application Server V8 installed, IBM HTTP Server installed, and the
necessary startup and program files.
V6.0.2
Student Exercises
EXempty
Exercise instructions
Section 1: Resetting the WebSphere environment
Note
If you need to reset your WebSphere environment, then see Appendix A for instructions
on how to correctly reset the environment.
16-3
Student Exercises
__ c. When the deployment manager is stopped, issue the following command to back
up the entire profile:
./manageprofiles.sh -backupProfile -profileName Dmgr -backupFile
/usr/software/backups/pre-SSL.zip
V6.0.2
Student Exercises
EXempty
__ e. For the profile name and location, enter: SSL and <profile_root>/SSL
Click Next.
__ f.
On the Node name and Host name screen, verify that the values are
was8host01Node03 and was8host01. Click Next.
16-5
Student Exercises
__ g. On the Federation window, enter was8host01 for the deployment manager host
name. The default SOAP port (8879) is shown. Enter wasadmin for the security
user name and web1sphere for the password. Be sure that the Federate this
node later option is not selected. The node is automatically federated to the cell
during creation. Click Next.
__ h. On the next screen, accept the defaults for creating the default personal
certificate and a new root signing certificate. Click Next.
V6.0.2
Student Exercises
EXempty
__ i.
The next screen specifies the node certificate information. Accept the defaults
and click Next. Make sure to read the information block, as it explains the
importance of these entries and how they relate to SSL.
16-7
Student Exercises
Information
Unlike in older versions of WebSphere Application Server, each node (or profile) no longer
gets a single self-signed certificate. Instead, as of WebSphere Application Server V7, two
certificates are created. The first one is the node personal certificate that is used by
default for secured communication with the node and any application servers on that node.
This personal certificate has a default life span of one year. This certificate is not a
self-signed certificate. Instead, the second certificate that is specified on this screen signs
it. The second certificate is the root certificate. This relationship is called a chained
certificate.
Unlike the node personal certificate, the root certificate has a default life span of 15 years.
This longer life span helps when the personal certificate is renewed as it gets close to its
expiration date. The same root certificate (which has a 15-year life span instead of just one
year) signs all of the personal certificates (old and new). Therefore, any processes that
need to communicate securely with the node agent or application servers already have
access to a valid copy of the node root signer certificate. This condition is true regardless of
whether the personal certificates are updated.
This model helps solve some of the certificate propagation problems since updating
personal certificates no longer requires any certificate propagation to occur.
As background, signer certificate propagation within a cell is accomplished through
standard node synchronization. All of the node signer certificates are included in the cell
default truststore file, which is synchronized throughout the cell. Propagation to the web
server plug-in, however, is more tricky.
In order for the plug-in to be able to communicate securely with the application servers, the
plug-in needs access to the appropriate signer certificates. The root signer certificates are
made available to the plug-in through their generated key rings. Since the root certificates
are now being used as the signers, updating expiring personal certificates is no longer a
problem.
Note: the keystore password default is: WebAS
__ j.
The profile creation is now complete. Clear the check box for Launch the First
steps console and click Finish.
V6.0.2
Student Exercises
EXempty
__ b. Go to System administration > Nodes and verify that this new node
(was8host01Node03) now exists.
__ c. Stop the node agent for node was8host01Node03. Since the node agent does
not need to be running for this exercise, select the node and click Stop (this
action helps free up some of the system resources).
16-9
Student Exercises
__ b. On the right side, under Related Items, click Key stores and certificates.
V6.0.2
Student Exercises
EXempty
__ c. This screen shows a list of the keystores and trust files for the cell. Click the
keystore link for the node that was created (was8host01Node03) earlier in this
exercise.
16-11
Student Exercises
__ d. The next screen shows the basic information for the node keystore. On the right,
under Additional Properties, click Personal certificates.
__ e. This screen shows the keystore entries for the node that was created. Notice
there are two chained certificates. The first, whose alias is default, is the
personal certificate for the new node. Notice that it is set to expire in one year.
The second is the root certificate for the new node, which expires in 15 years.
Note the Serial Number for the root certificate (Serial #:__________________ )
and Expiration date (Date: ________________ ).
V6.0.2
Student Exercises
EXempty
__ f.
Tracking the serial numbers can be helpful. In other parts of the administrative
console, the representation of the certificates can change. To tell which
certificate is which, knowing the serial number can be helpful. Click the alias
default for further information. Also, take note of the Fingerprint. Usually
knowing just the last couple of bits is sufficient: __________________ (5C:40)
16-13
Student Exercises
__ d. Notice a root signer certificate in the cell default truststore. Specifically, this
certificate is the cell root signer certificate (not the personal certificate), and is the
signer for all of the node certificates in the cell. Notice that it has a 15-year life
span.
V6.0.2
Student Exercises
EXempty
__ f.
Notice that the Serial number matches the serial number from the previous step
where you noted the information for the root certificate. This match verifies the
fact that the signer certificate for the root certificate is indeed added to the cell
default truststore. And since the cell default truststore is synchronized to all
nodes within a cell, all nodes and all application servers have access to the cell
root signer certificate.
The plug-in also needs the cell root signer certificate so that it can communicate
securely with the application servers. That subject is covered later in this
exercise.
Take note of the Serial Number and Fingerprint for the root certificate
_________________ (2324). Usually knowing just the last couple of bits is
sufficient: __________________ (01:66).
16-15
Student Exercises
Built into WebSphere is a service that runs through the list of all certificates and
replaces any that are about to expire. This screen configures when that service is
run. It can be run immediately by clicking Start now, or it can be scheduled. The
default is to run on every fourth Sunday at 21:30. This service can be turned off by
clearing the Enable check box. It is also possible to run the checking service but to
V6.0.2
Student Exercises
EXempty
not automatically replace the existing certificates or not delete the replaced expiring
certificates.
By default, the expiration notifications are written to the log file. Additional
notifications, including email, can be configured by clicking the Notifications link
under Related Items.
16-17
Student Exercises
Information
The name of the Expiration notification threshold field can be misleading.
When the expiration notification thread is run (either manually or through scheduling), it
checks whether any certificates are within X days (the expiration notification threshold
defines X) of the current date. If there are any, they are subject to replacement.
There is another setting (a custom property) that defines how many days out the
notifications (but not replacement) occur.
__ b. Run the expiration notification service now by clicking Start now. Using a text
editor (such as dtpad), open the SystemOut.log file for the deployment
manager. Near the end of the file, there is an entry that starts with Expiration
Monitor.
__ c. Since the cell is newly created, there are no certificates that need replacement. If
any changes need to be saved, feel free to either save or discard.
__ 2. Use the security report to view the list of all the certificates and their expiration
dates.
V6.0.2
Student Exercises
EXempty
__ b. A new browser window shows the HTML report. Scroll to the bottom of the report
and find the Certificate Management section.
__ c. Notice the list of the certificates and the expiration dates. This report can be a
helpful tool for administrators in dealing with their certificate management.
__ d. Close the security report window.
16-19
Student Exercises
WebSphere is able to make sure that all of the required certificates are available to the web
server plug-in by creating the plug-in keystores from within WebSphere. By doing so,
WebSphere can make sure that not only does the plug-in have a valid personal certificate,
but that it also has the necessary cell root signer certificate. At the same time, WebSphere
can ensure that the plug-in signer certificate is also available in the cell truststore.
The real problem with this approach is that when WebSphere generates the plug-in
keystore, it then still needs to be propagated to the host that runs the web server. The
propagation process of plug-in keystores is similar to the propagation of the
plugin-cfg.xml file. Most of the time it is done manually, but in some cases it can be
configured to be done automatically (generally not desirable).
__ 1. View the contents of the plug-in keystore.
__ a. In the administrative console, browse to Servers > Server Types > Web
servers. Click your web server link (webserver1). Then, under Additional
Properties, click Plug-in properties.
V6.0.2
Student Exercises
EXempty
__ b. Notice the plug-in keystore file name. Initially this file can be found within the
configuration directory structure of the deployment manager. It can be found
under the ihsnode directory. More specifically, the directory is:
<profile_root>/Dmgr/config/cells/<cell-name>/
nodes/ihsnode/servers/<web-server>
This directory is also the same directory where the web server-specific version of
the plugin-cfg.xml file exists.
16-21
Student Exercises
__ e. There are a number of signer certificates. Verify that the cell root signer
certificate is among the list. Notice that the fingerprint matches what was seen
previously in this exercise.
Information
Seeing the cell root signer certificate validates the fact that WebSphere generated the
keystore for the plug-in and included the cell root certificate signer. In this case, the root
signer certificate is the one that ends with a fingerprint of 01:66.
V6.0.2
Student Exercises
EXempty
__ b. Return to the administrative console and return to the web server plug-in
properties page. Click Copy to web server key store directory.
__ c. Notice the message at the top of the administrative console window shows a
successful copying of the files:
16-23
Student Exercises
__ d. Return to the Explorer window and verify that the size of the file (and the
date-time stamp) is changed. This information validates that the propagation did
occur.
__ 3. If you have extra time, use iKeyman to open the .kdb file on the web server host
and verify that the new signer certificate was propagated.
__ 2. Create a key ring with a self-signed certificate for IBM HTTP Server.
__ a. Run the iKeyman for IBM HTTP Server by issuing the following command:
/usr/IBM/HTTPServer/bin/ikeyman
__ b. Create a new key ring by selecting Key Database File > New.
V6.0.2
Student Exercises
EXempty
__ d. When prompted for a password for the key ring, enter and confirm web1sphere
as the password. If wanted, modify the expiration time. Check the Stash the
password to a file check box.
Warning
The stash file is created containing an encoded form of the password. This encoding
prevents casual viewing of the password, but is not highly secure. Therefore, you must
protect this file by using operating system file permissions to prevent all access from
unauthorized principals.
The file name of the stash file is the same as the name of the key file, only it has an .sth
suffix. The stash file gets stored in the same directory as the key file.
__ e. Click OK.
__ 3. Create a new self-signed certificate.
__ a. In iKeyman, select Create > New Self-Signed Certificate and enter the
following information:
Table 11: Self-signed certificate details
Example
Description
Key label
ihsCertificate
Copyright IBM Corp. 2012
16-25
Student Exercises
__ c. Click OK.
Information
This stores the certificate in the key file in the Personal Certificates section. Optionally, it
is possible to extract the public signing certificate so that clients can use it (in the exercise,
there is no need to do this extraction). To extract the public signing certificate, click Extract
V6.0.2
Student Exercises
EXempty
16-27
Student Exercises
separate virtual host from HTTP. Place these lines near the bottom of the
httpd.conf file after the VirtualHost examples and just before the comment #
Enable IBM HTTP Server diagnostics features.
LoadModule ibm_ssl_module modules/mod_ibm_ssl.so
Listen 0.0.0.0:443
<VirtualHost www.plants.ibm.com:443>
SSLEnable
</VirtualHost>
KeyFile "/usr/IBM/HTTPServer/ssl/ihsKeyring.kdb"
SSLDisable
Information
There are sample configuration files in /usr/software/ssl/ that can be used to copy and
paste. These files include only this section of a completed httpd.conf file.
__ f.
V6.0.2
Student Exercises
EXempty
http://localhost/
16-29
Student Exercises
__ b. Now that the web server is known to be running, enter the following address to
verify that HTTPS is working (note: the only difference is that https replaced
the http protocol): https://localhost/
Why does the https connection to localhost fail? The answer is because the
virtual host definition for the SSL configuration is defined for the host named
www.plants.ibm.com.
__ c. Using the same browser window, go to the following URL:
http://www.plants.ibm.com/
This works since the host name www.plants.ibm.com is mapped to the local
system and there is no https necessary.
__ d. Now that you verified that the new host name works, change the protocol to https
so that the URL is:
https://www.plants.ibm.com/
V6.0.2
Student Exercises
EXempty
__ e. Assuming that the certificate is not added to the browser key ring, you receive a
certificate warning. (It is happening because the SSL connection is presenting a
self-signed certificate and therefore the browser is unable to validate the signer.)
Accept the security warnings (the interface for doing so depends on which
browser is used).
__ f.
The browser then takes you to the https connection for the web server home
page.
16-31
Student Exercises
Note
If application security is still enabled from a previous exercise, you are prompted to enter a
user name and password for the snoop servlet. In this case, any authenticated user has
access. Use PlantsUser and web1sphere to authenticate.
Notice that this action works as expected. If it does not, start by verifying that the
plug-in key ring was propagated (it was done earlier in the exercise) and
checking the plug-in log file for information.
__ c. Finally, use the following URL to access the PlantsByWebSphere application:
https://www.plants.ibm.com/PlantsByWebSphere
End of exercise
V6.0.2
Student Exercises
EXempty
16-33
Student Exercises
V6.0.2
Student Exercises
EXempty
Introduction
WebSphere Application Server offers a collection of tools to monitor
and help tune the runtime environment, including Tivoli Performance
Viewer (TPV), the TPV advisor, and Request Metrics.
The Tivoli Performance Viewer is the user interface for monitoring the
performance of application servers, servlets, and other resources in
the environment. It is integrated into the administrative console and
can be used for a number of tasks, including viewing real-time
Copyright IBM Corp. 2012
17-1
Student Exercises
Requirements
This exercise requires at least one application server that runs the
PlantsByWebSphere application and the Default application.
V6.0.2
Student Exercises
EXempty
Exercise instructions
Preface
In the first part of this exercise, you use Tivoli Performance Viewer to monitor applications
that run on WebSphere Application Server.
When the Performance Viewer is running in a Network Deployment environment, the data
is collected at each of the nodes and stored in memory at the node agent. Data is then
viewed from the deployment manager. With this architecture, the monitoring is distributed
among the nodes.
If you changed the maximum heap size for the deployment manager to a lower value to
conserve system resources, you must restore the maximum heap size to the default
setting. More memory is required because the Tivoli Performance Viewer runs inside the
deployment manager.
__ 1. Verify that the deployment manager, the node agent, and WebSphere Application
Server server1 in profile1 are all running.
__ 2. Start an administrative console and make sure that you are logged in as wasadmin
Information
You can stop server2 and its node agent to free up physical memory if the class
environment has limited memory. As a rule of thumb, if your computer has less than 2 GB
of memory, it can be beneficial to run only server1 for this lab.
17-3
Student Exercises
V6.0.2
Student Exercises
EXempty
__ c. Click the Runtime tab and verify that Basic is selected (default statistic set).
__ d. Click Cancel.
Information
The Runtime tab allows you to change the monitoring settings without restarting the
server. The new settings are applied immediately after clicking OK. If the Persist my
changes check box is selected, the runtime settings are saved and are shown in the
Configuration tab. This option allows you to make immediate changes to the PMI settings,
and have these changes become the standard configuration the next time the server is
started.
__ 2. To get more frequent data collections in the Tivoli Performance Viewer, change the
Monitoring Refresh Rate to 20 seconds.
Copyright IBM Corp. 2012
17-5
Student Exercises
__ a. Under Monitoring and Tuning, expand Performance Viewer and click Current
activity.
__ b. On the right pane, select the check box for server1 and start the monitoring
process for this server by clicking Start Monitoring.
__ c. Click the server1 link to view its current activity. If the tree for server1 is
collapsed, click [+] next to server1 to expand it. Expand Settings and click User.
V6.0.2
Student Exercises
EXempty
__ d. In the User Settings panel, change the Data Collection Refresh Rate to 20
seconds. Click Apply.
17-7
Student Exercises
__ c. Notice that there is one request for the Snoop servlet and an average response
time in milliseconds. Record the average response time here _____________.
__ d. Go back to the browser and click the reload button several times. Look at the
Servlets report again. What is the average response time now?____________
Is the response time longer or shorter after several requests are processed?
__ 3. Open a new browser and type in the web address for PlantsByWebSphere.
http://was8host01:9080/PlantsByWebSphere
Click the Flowers tab and the link for Lily.
__ a. Explore more summary reports:
Are there any Enterprise JavaBeans being monitored? Click EJBs under
Summary Reports. The EJBs Summary Report lists all enterprise beans
that are currently running on this server. It also shows the amount of time
that is spent in their methods, the number of EJB invocations, and the
total time that is spent in each enterprise bean.
17-8 WebSphere Application Server V8 Administration
Course materials may not be reproduced in whole or in part
without the prior written permission of IBM.
V6.0.2
Student Exercises
EXempty
Click Connection Pool. The Connection Pool Summary Report lists all
data source connections that are defined in the application server and
shows their usage over time. The performance data is shown in graph
form.
Click Thread Pool. The Thread Pool Summary Report shows the usage
of all tread pools in the application server over time.
__ 4. Inside Tivoli Performance Viewer (TPV), view the available performance counters
for the Snoop servlet and the JVM Runtime module.
__ a. In TPV, expand Performance Modules and select the JVM Runtime check box.
17-9
Student Exercises
__ c. Click View Module(s) at the top of the viewer (if necessary, you must scroll in
your browser to see this screen). You see a table or a graph that shows the
monitored data.
V6.0.2
Student Exercises
EXempty
__ d. Use the browser to reload the Snoop servlet several times by clicking the
browser refresh button. Review the changes in the console.
Information
You see changes in the metrics for the Snoop servlet. The request count increases and the
service time changes. Keep in mind that the JVM runtime counters change too. Notice in
17-11
Student Exercises
the screen capture, the FreeMemory metric was cleared and it therefore is not plotted on
the graph.
Warning
When viewing graphs and comparing lines, take note of the Scale value. The Performance
viewer scales values such that all data points can fit on the graph.
__ e. In the Performance viewer, click View Table to switch to a tabular view of the
performance data. You can toggle back and forth between the table and graph
view by selecting View Table or View Graph.
__ f.
Reload the Snoop servlet several times and observe the servlet metrics.
V6.0.2
Student Exercises
EXempty
__ b. Click the link for the TUNE5042W: Enable servlet caching message to see the
advice details.
17-13
Student Exercises
Information
In your lab environment, typically the processor utilization is low, and so you do not see
much relevant performance advice. However, you see the configuration advice to turn on
servlet caching with descriptions as to how to use the console to turn on this feature.
It is a good practice to run a representative workload against your application. Look at the
performance advisor after the work load is run.
You can use the IBM Rational Performance Tester to create load tests and run them
against your applications. You can read more about Rational Performance Tester and
download a trial version at the following website:
http://www.ibm.com/software/awdtools/tester/performance
V6.0.2
Student Exercises
EXempty
You can also filter requests so that only specific incoming requests result in request metrics
that are logged. Such filtering can keep the logs from being overloaded with request
metrics for every request.
__ e. Click OK.
__ f.
Save directly to the master configuration and log out of the administrative
console.
__ g. Restart server1.
__ 2. Open a web browser and run the PlantsByWebSphere application by entering the
following address:
http://localhost:9080/PlantsByWebSphere
__ a. Go through the site, look at some plants, buy something, and check out.
__ 3. Now view the standard JVM logs for server1. If HPEL is not turned on for server1,
you can go to the Problem Determination lab exercise for the steps on how to turn
on HPEL. Alternatively, you can open the SystemOut.log file with a text editor
Copyright IBM Corp. 2012
17-15
Student Exercises
and search for the PMRM codes. The remaining steps assume that HPEL is turned
on for server1.
__ a. In the administrative console, go to Troubleshooting > Logs and trace >
server1.
__ b. On the Logging and tracing panel, scroll down and click the link View HPEL logs
and trace.
__ c. You are now in the Log Viewer. Expand the Content and Filtering Details
section.
Note
Some versions of Firefox at times seem to have issues with loading the data. If there
is message asking that asks you to wait while the data is loaded, clicking in the body
background of the console window seems to solve the problem.
V6.0.2
Student Exercises
EXempty
__ d. Scroll down to the Filtering box and type PMRM* in the Message contents field.
__ e. Click Apply.
__ f.
Now only the request metrics messages are shown in the log view. Click any of
the PMRM0003I codes to view details of the message.
__ g. Scroll through the request metrics records. In addition to the Shopping Cart
bean, you also see metrics for PlantsByWebSphere (PWB) servlets and JSPs.
Look at the different event types. You see type=URI, type=EJB, type=JDBC,
and more, reflecting the request flow.
Information
The time and pid fields are the start time and ID of the application server process. Type
and detail are the description of the type of operation that is timed and its name. Most
important is the measured elapsed time in milliseconds, which includes all suboperations
17-17
Student Exercises
that this operation calls. The reqid is a unique ID assigned to the request by request
metrics.
Two correlators are shown, a parent correlator and a current correlator, representing the
upstream request and the current operation. A correlator consists of the comma-separated
fields that follow the parent or current keyword. If the parent and current correlators are
the same, as in this case where all field values are the same (including reqid=1), then the
record represents an operation that occurs as it enters WebSphere Application Server.
V6.0.2
Student Exercises
EXempty
__ f.
Click Next.
17-19
Student Exercises
__ i.
When the installation completes, make sure that Data Collector Configuration
Tool is selected, and click Finish.
V6.0.2
Student Exercises
EXempty
__ j.
__ k. Click Next.
17-21
Student Exercises
__ b. Click Next.
V6.0.2
Student Exercises
EXempty
__ c. Select profile1.
__ d. Click Next.
17-23
Student Exercises
__ f.
Click Next.
V6.0.2
Student Exercises
EXempty
__ h. Click Next.
Important
The ITCAM Configuration Tool requires a fully qualified host name. If you see an error
message during this step, check the /etc/hosts file on your system. If necessary, add
was8host01.websphere.ibm.com to the loopback address (127.0.0.1) so that there is a
line that reads as follows:
127.0.0.1
17-25
Student Exercises
__ i.
Select server1.
__ j.
Click Next.
V6.0.2
Student Exercises
EXempty
__ l.
Click Next.
Information
17-27
Student Exercises
__ n. Click Next.
Information
IBM Tivoli Composite Application Manager (ITCAM) for Application Diagnostics is a
separate monitoring product. ITCAM for Application Diagnostics provides real-time
monitoring and diagnosis of WebSphere Application Servers, and for other application and
HTTP servers.
The Managing Server is a component of ITCAM for Application Diagnostics; it provides
detailed diagnosis. If the ITCAM for Application Diagnostics is installed in your
environment, you can configure the ITCAM for WebSphere Application Server Data
Collector to connect to the Managing Server component.
More information about the ITCAM for Application Diagnostics is found at the Tivoli
software products website:
http://www.ibm.com/software/tivoli/products/composite-application-mgr-diagnostics
V6.0.2
Student Exercises
EXempty
__ p. Click Next. Wait for the backup to complete. This activity takes a couple of
minutes.
17-29
Student Exercises
__ q. Note the location of the configuration log file. Examine this log if you need to
troubleshoot the configuration.
__ r.
Also, notice that you are instructed to restart the application server. However,
before restarting, you first verify the configuration of server1. Click Finish.
V6.0.2
Student Exercises
EXempty
__ 3. Turn on the IBM Tivoli Composite Application Manager for WebSphere Application
Server Data Collector within PMI for server1.
__ a. From the administrative console, select Monitoring and Tuning > Performance
Monitoring Infrastructure > server1.
__ d. Click OK.
__ e. Save changes directly to the master configuration.
__ 4. Start monitoring server1 with ITCAM.
__ a. Restart server1.
__ b. Go to Monitoring and Tuning > Performance Monitoring Infrastructure >
server1.
17-31
Student Exercises
V6.0.2
Student Exercises
EXempty
__ f.
Select all of the statistics (there are 11 different statistics) and click Enable. In
this panel, a description of each statistic and the unit in which it is measured are
shown.
17-33
Student Exercises
You need to generate some activity on the server to see application components
listed. Start a new browser and access PlantsByWebSphere. Traverse the site
as you did before.
V6.0.2
Student Exercises
EXempty
__ j.
Information
RequestCount: The number of requests that are completed since the counter is enabled
or reset.
AverageResponseTime: This data point shows the average response time of requests in
milliseconds.
LastMinuteAverageResponseTime: The average response time of requests that are
completed in the last minute (when the counter value is retrieved) in milliseconds.
AverageCPUUsage: This data shows the average processor usage of requests in
milliseconds.
LastMinuteAverageCPUUsage: The average processor usage of requests that are
completed in the last minute (when the counter value is retrieved) in milliseconds.
End of exercise
17-35
Student Exercises
V6.0.2
Student Exercises
EXempty
reset script interface lists the available states that are available.
__ 9. There are a number of reset scripts available. Locate the name of the exercise that
directed you here and select the associated reset script state. For example, if you
A-1
Student Exercises
A-2
V6.0.2
Student Exercises
EXempty
If you would like more information about the specific reset scripts, type the letter d
followed by the number for the reset script.
A-3
Student Exercises
__ 11. Depending on how much work the reset script needs to do, the wait is several
minutes. When the script finished, press Enter to close the window.
A-4
V6.0.2
Student Exercises
EXempty
B-1
Student Exercises
As soon as you are successfully authenticated, you are presented with a Citrix
interface, which lists a number of applications that can be used to access your AIX
lab system.
When these applications are run, they display their window on your local system.
__ 2. Connect to the AIX system via VNC.
Double-click the VNC Client icon to start a connection. You are presented with a
dialog box. It allows you to specify the AIX system IP address (which is provided to
you in your course communications) and also the port number, which allows you to
choose the VNC screen size.
B-2
Screen Size
1024 x 768
1280 x 800
1280 x 1024
1600 x 1024
V6.0.2
Student Exercises
EXempty
Now, you are prompted to log in to the AIX operating system (see the following
details). You are then presented with a full AIX desktop in a VNC window.
__ 3. Use PuTTY (SSH) to connect to the AIX system.
If you prefer to use PuTTY (an SSH client) to connect to the remote system in a
command-line interface, double-click in the PuTTY icon. You are presented with a
dialog box which allows you to specify the remote IP address (which is provided to
you in your course communications).
Enter the IP address for your AIX system in the Host Name field and click Open.
Then, log in using the AIX user name and password (root and web1sphere).
You now have a command-line terminal to your AIX system logged in as root.
__ 4. Use Firefox to connect to the AIX system.
You are able to run Firefox on the AIX machine directly, which causes the Firefox
window to render within the AIX desktop window. See step 8 for details.
B-3
Student Exercises
It is also possible to run Firefox through the Citrix interface. This approach renders
the Firefox windows directly on the desktop of your local system. To do so,
double-click the Firefox icon within the Citrix window.
On the next screen, enter the password (web1sphere) and click OK.
B-4
V6.0.2
Student Exercises
EXempty
Now, you are presented with a CDE (Common Desktop Environment) screen.
B-5
Student Exercises
To start a terminal window, either click directly on the terminal icon or click the arrow
above the terminal icon. Clicking the arrow displays more application icons.
B-6
V6.0.2
Student Exercises
EXempty
B-7
Student Exercises
B-8
V5.4.0.3
backpg
Back page