Вы находитесь на странице: 1из 20

Skip to Content Java Solaris Communities My SDN Account Join SDN

Java for your


computer

Stay up to date with


the latest versions of
Java for your desktop
computer.

Free and Open


Source Java

Get your own copy


of the underlying
software code for the
Java language.

Download the latest


JDK

The basic developer


kit for Java
developers.

Download the Java


EE SDK

The SDK supports


Java SE 6 and the
latest Java EE 5
technologies.

Download NetBeans
IDE

Get the award-


winning, open-
source tool suite for
developing Java
applications.

Java Developer
Resources

Visit java.sun.com
for everything you
need to know about
the Java technology.

Java Developer
Tools

See and download all


software tools
available from Sun.

Java Standard
Edition

For developing and


deploying Java
applications for the
desktop, servers,
embedded, and real-
time environments.

Java Enterprise
Edition

For enterprise,
server-side Java
applications.

Java Micro Edition


For Java applications
running on mobile
devices.

Java Training

Sharpen your Java


skills with courses
from the source.

Java Support

Get dedicated help


from Sun including
technical assistance,
product support, and
support for deployed
Java applications.

Communities @ SDN Research

Join the Sun Developer Discover the latest projects


Network, a worldwide in Sun Labs.
community of over 2
million developers, and Java Technology
learn about the benefits of
membership. What's happening with the
Java programming
System Administrators language -- from mobile
devices and smart cards to
The BigAdmin portal enterprise-scale data
provides Solaris system centers.
administration
information, hardware User Groups
compatibility, a script
library, and other Join developers, IT
resources for managers, system
resources for
administrators of Sun administrators, and others
products, contributed both who share a common
by Sun and members of interest in Java technology
the community. or Sun products.

Sun Student Developers Newsletters

The SDN Academic Find out about new


Developer Program offers articles, product
you ready access to the announcements, upcoming
tools, resources, and releases, and future events.
student communities.
Forums
Java.net
Access a wide range of
A gathering place for Java Sun-related topics in the
technology enthusiasts Sun community forums.
and existing communities
across industries, Sun Blogs
platforms, and interest
Join the conversation --
groups.
meet the people at Sun who
Open Source & are passionate about their
Collaboration jobs.

Learn about Sun's


involvement in open
source projects.

Join SDN Now


Why Join

Becoming an Sun
Developer
Network (SDN)
member makes
you part of a
vibrant worldwide
community of
developers, and
gives you access
to cool stuff and
exclusive offers.

» search tips Search


Home Page

APIs

Java Card
Java EE
Java ME
Java SE
Solaris
Sun Studio Compilers &
Tools
Web Services
See All »

Java Card
Java EE
Java ME
Java SE
Solaris
Sun Studio Compilers &
Tools
Web Services
See All »

Downloads

Early Access
Java EE
Java ME
Java SE
Java Studio Creator
Java Studio Enterprise
NetBeans
Solaris
Sun Studio Compilers &
Tools
See All »

Early Access
Java EE
Java ME
Java SE
Java Studio Creator
Java Studio Enterprise
NetBeans
Solaris
Sun Studio Compilers &
Tools
See All »

Technologies

Java EE
Java ME
Java SE
Mobility
Solaris
See All »

Java EE
Java ME
Java SE
Mobility
Solaris
See All »

Products

Java Studio Creator


Java Studio Enterprise
NetBeans Mobility Packs
Sun Studio Compilers &
Tools
See All »

Java Studio Creator


Java Studio Enterprise
NetBeans Mobility Packs
Sun Studio Compilers &
Tools
See All »

Support

Big Admin
Developer Services
Forums
See All »

Big Admin
Developer Services
Forums
See All »

Training

Certification
Developer Training
See All »

Certification
Developer Training
See All »

Sun.com
About Sun
Downloads
Products
Services & Solutions
Support
Training
See All »

About Sun
Downloads
Products
Services & Solutions
Support
Training
See All »

Developers Home > Learning Resources >

Learning Resources

JavaOne Online Hands-on Labs

LAB-3315: Java EE 5 Hands-on and Clustering using Open Source


GlassFish Application Server

Authors:Dinesh Patil, Sreenivas Munnangi Version: FINAL Last Updated: 25-APR-2007


Expected duration: 60 minutes

GlassFish is the first Java EE 5 based application server with many ease of development features including Annotations, EJB 3.0, JPA, JAX-WS,
etc. GlassFish V2 adds enterprise level clustering to enable scalability and high availability. It also has ease of management capabilities and other
useful features for your production environment. In this lab, participants will learn, build, and run the Java EE 5 technologies using glassfish-
samples project. In the second half of the lab, we will guide participants to set up a cluster and deploy the examples to demonstrate high
availability.

GlassFish is the name for the open source development project for building a Java EE 5 application server. It is based on the source code for Sun
Java System Application Server PE 9 donated by Sun Microsystems and TopLink persistence code donated by Oracle.

The aim of the hands-on-lab is to get familiar with Java EE 5 technology features and recently introduced enterprise clustering feature through
open community Application Server, GlassFish V2.

Copyright

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Sun, Sun Microsystems, the Sun logo, Solaris, Java, the Java Coffee
Cup logo, JavaOne, the JavaOne logo, and all Solaris-based and Java-based marks and logos are trademarks or registered
trademarks of Sun Microsystems, Inc. in the United States and other countries.

Prerequisites

This hands-on lab assumes you have some basic knowledge or programming experience on the following technologies.

Java, Java EE, XML, Ant, NetBeans IDE

System requirement

Supported OS: Windows 2000/ XP, Solaris 9/10, Linux, MacOS X(Darwin)
Memory requirement: 512M minimum, 1024M recommended
Disk space requirement: 300M bytes
Loadbalancer plugin is not tested for support on Windows XP; on Win platform - Windows 2000 AS, and Windows server 2003 are the tested /
supported ones

Software needed for the lab

On JavaOne Lab machines, most of these softwares are installed and configured in the PATH already. But for your laptop or own system, please
download and install the following set of software. If you have any questions on installation, please feel free to send questions to the email alias
mentioned below.

Download and Install Java SE 1.6


Download and Install GlassFish V2 Application Server Build b41b
Download and install NetBeans 5.5.1
Download and Install Java EE 5 Samples Bundle
Download and Install Sun Java System Webserver 6.1 (SJSWS 6.1), SJSWS7.0 is NOT supported.
Download and Install GlassFish V2 LoadBalancer Plugin SunOS_X86 , Windows , SunOS_sparc , Linux

Notations used in this documentation

<lab_root> - directory into which lab zip file is unzipped


This document uses <lab_root> to denote the directory under which you have unzipped the lab zip file of this handson lab. The name
of the lab zip file of this handson lab is 3315_glassfishV2.zip.
Once you unzipped the lab zip file under <lab_root>, it will create a subdirectory called glassfishV2 For example, under Windows, if
you have unzipped the lab zip file in the root of drive E:\, it will create E:\glassfishV2. Under Linux/Solaris, if you have unzipped
the lab zip file in the /home/sang directory, it will create /home/sang/glassfishV2 directory
<NETBEANS551_HOME> is the install location of NetBeans IDE 5.5.1
<JAVAEE_HOME> is the install location of Application Server

Notes to JavaOne 2007 attendees using lab machines provided (This does not apply to those who use their own machines)

The lab machines are running Java Desktop System over Solaris 10
In order to open a terminal window in Java Desktop System, right click any point in the background of the desktop, and select Open
Terminal in the pop-up menu.
The following source code editors are provided on the lab machines
vi (type vi in a terminal window)
emacs (type emacs in a terminal window)
jedit (type jedit in a terminal window)
NetBeans (either click NetBeans icon or type netbeans in a terminal window)

Lab exercises
Exercise 0: Install and configure the lab environment
Exercise 1:Java EE 5 features using glassfish-samples
Exercise 2:Demonstrate the scalability and availability using clustering

Resources

The presentation slides for lab 3315


GlassFish V2 Architecture
My GlassFish V2 with Clustering Features Blog
Samples for the GlassFish project
New Java EE 5 samples available thru Java EE 5 SDK
Java EE Code Samples & Apps
GlassFish FAQ
GlassFish Developer Contributor's Guide
Building and developing the GlassFish project with NetBeans.
My GlassFish with NetBeans Blog
GlassFish QuickStart Guide
Java EE Downloads

Where to send questions or feedbacks on this lab and public discussion forums

You can send technical questions via email to the authors of this Hands-on lab (and experts on the subject) or you can post the questions to
the web. Please post questions that are relevant only to this hands-on lab.
handson lab06-glassfishV2@yahoogroups.com (via email)
http://groups.yahoo.com/group/handsonlab06-glassfishV2 /
You can also send your questions to the public GlassFish forums - this forum can be used to ask any GlassFish V2 related questions.
GlassFish forum in java.net
Exercise 0: Install and Configure Lab Environment
For JavaOne 2007 attendees using the lab machines provided, the steps in Exercise 0 are done for you as part of the login process. So
please proceed to Exercise 1.

Make sure the installation has set %JAVA_HOME% (Windows) or $JAVA_HOME (Solaris/Linux) environment variable to the installation
directory of Java SE 1.5.0_11
On Windows:Type "echo %JAVA_HOME%" in a command window to make sure the value is set properly.
On Solaris/Linux: "echo $JAVA_HOME" in a terminal window to make sure the value is set properly.
Verify the installation of GlassFish V2 application server
On Windows
cd %JAVAEE_HOME%\bin
asadmin version --verbose
On Solaris/Linux
cd ${JAVAEE_HOME}/bin
./asadmin version --verbose
Make sure that NetBeans IDE 5.5.1 is installed by verifying
On Windows: Start > All Programs > NetBeans 5.5.1 > NetBeans IDE or NetBeans IDE 5.5.1 desktop icon
On Solaris/Linux: <NETBEANS551_HOME>/bin/netbeans
Verify that Java EE 5 samples are installed by checking for the existence of
On Windows: %JAVAEE_HOME%\samples\javaee5
On Solaris/Linux: ${JAVAEE_HOME}/samples/javaee5
Verify the installation of SJS Webserver 6.1 and LB plugin
cd %sjsws6.1% (Windows) or $sjsws6.1 (Solaris/Linux)
cd https-<hostname>/bin
start
logs/errors will show output something similar to below:

info ( 939): CORE1116: Sun ONE Web Server 6.1SP5


info ( 940): reports: lb.monitor: HLCK1006: UnhealthyInstances cluster1
CORE3274: successful server startup

Also verify $sjsws6.1/https-<hostname>/config/loadbalancer.xml.example is present.

Exercise 1: Demonstrate Java EE 5 features using glassfish-samples (30 minutes)

Introduction:

Demonstrate the Java EE 5 technology features such as Web Services, JPA, EJB 3.0, Annotations, and Security using open source glassfish-
samples project. The sample applications can be built and run either using command line ant or NetBeans IDE. The samples are NetBeans
ready and participants will learn how to use the samples from NetBeans and be able to update and deploy the sample applications seamlessly to
the Application Server.

Because of time constraint, we will attempt to demo just 2 features of Java EE 5, which are Web Services and JPA using command line ant and
NetBeans IDE respectively. The downloaded glassfish-samples project contains samples for other areas as well including EJB 3.0, Annotations,
Security and JAXB. Students are expected to practise these samples on their own after the following exercises.

Goals of this excercise:

The goal of this exercise is to let you experience the features of Java EE 5 by building and running the Java EE 5 technology samples
using command line ant scripts and NetBeans IDE. In this exercise, you will learn the following:

Build and Run a simple web services sample hello-jaxws using ant
Build and Run a simple web based persistence sample web-jpa-war using NetBeans IDE
Ask the students to experiment with other samples related to EJB Annotations, Persistence, Web Services, Security, and EJB Interceptor

Steps to follow:

This exercise is made of the following steps:

1. Update build.properties
2. Start the application server and default database
3. Build and Run a simple web services sample hello-jaxws using ant
4. Start NetBeans IDE
5. Configure application server for the NetBeans IDE
6. Build and Run a simple web based persistence sample web-jpa-war using NetBeans IDE
Step 1: Update build.properties

Update samples/bp-project/build.properties corresponding to your installation of GlassFish application server. This is needed to build and run the
samples using command line based ant, if one plans to use only NetBeans IDE then this is not required.

cd ${JAVAEE_HOME}/samples/bp-project

Just a reminder that JAVAEE_HOME is the install location of Application Server.

Edit build.properties using your favorite text editor, most of the properties are already set to default values.

# path to your application server installation


javaee.home=D:/gfv2b33/glassfish/

...

# File that contains the password for the App-Server admin account.
# Edit this property to point to a file that
# contains the admin password for your app-server.
# The file should contain the password in the following line:
#
# AS_ADMIN_PASSWORD=adminadmin
#
# Notice that the password is adminadmin since this is
# the default password used by the glassfish app-server installation.
# For your purpose, use the password that you chose while installing
# the SDK

javaee.server.passwordfile=${JAVAEE_HOME}/samples/bp-project/passwordfile

...

# for platforms other than Windows and MAC


# Uncomment and set this property to the location of the browser you
# choose to launch when an application is deployed.
# On Windows and Mac OS X the default browser is used.
#default.browser=/Applications/Firefox.app/Contents/MacOS/firefox-bin

build.properties

Make sure the passwordfile is created and contains the proper password.

Step 2: Start the application server and default Database

cd ${JAVAEE_HOME}/bin

Start the default database.

asadmin start-database
Start the default application server.

asadmin start-domain

Step 3: Build and Run a simple web services sample hello-jaxws using ant

New and updated web services (JAX-WS 2.0 and JAXB 2.0) in GlassFish simplifies SOA implementation. With JAX-WS 2.0 the code
developers need to write can be significantly reduced and Web services performance increased by up to 5 times.

Study the Web Services sample for instructions on building and running by referring to the sample documentation, which is also accessible from
samples/javaee5/webservices/hello-jaxws/docs/index.html.

cd ${JAVAEE_HOME}/samples/javaee5/webservices/hello-jaxws
ant all

The ant target all executes the individual targets compile-deploy-service, get-artifacts, compile-client, and run-client. To experiment, these
targets can be run separately.
Step 4: Start NetBeans IDE

Since NetBeans IDE uses its internal configuration for application server and database, let us stop the previously started application server and
database.

cd ${JAVAEE_HOME}/bin

Stop the default database.

asadmin stop-database

Stop the default application server.

asadmin stop-domain

Start NetBeans IDE.

On Windows: Start > All Programs > NetBeans 5.5.1 > NetBeans IDE or click NetBeans IDE 5.5.1 desktop icon

Solaris/Linux: <NETBEANS551_HOME>/bin/netbeans
Step 5: Configure default web browser

Select Tools, Options which will pop up Options windowOn Options window, select General, WebBrowser and select appropriate Web
Browser

tools_options_browser

Step 6: Configure application server for the NetBeans IDE

Configure the application server using the following sequence.

Select Runtime tab, expand Servers node, right-click Servers and select Add Server ...

Choose Server
Choose the install location of application server
click on Browse... and select the application server installation directory which is same as JAVAEE_HOME
notice that the Domain field is populated automatically
click on Next>

Provide values for admin login and password, the default values are admin and adminadmin respectively.
Click on Finish which completes the configuration for application server.

Now start the application server by selecting the Sun Java System Application Server under Servers node, right-click Sun Java System
Application Server, and click on Start. This will start the application server and the default database.

Step 7: Build and Run a simple web based persistence sample web-jpa-war using NetBeans IDE

New Java Persistence API makes object-relational mapping cleaner and easier. Java annotations can now be used to specify the mapping of Java
business objects to a relational database. The persistence implementation in the application server supports both the generation of database
schemas from Java objects and the mapping of existing database schemas to Java objects. In addition to using persistence inside the EJB
container, one can use the Persistence API directly with Java SE. This allows maximum flexibility in the application persistence needs, with a
common solution for both client and server environments.

Study the sample for instructions on building and running by referring to the sample documentation, which is also accessible from
samples/javaee5/enterprise/web-jpa-war/docs/index.html.

Select File, OpenProject and select <JAVAEE_HOME>/samples/javaee5/enterprise/web-jpa-war as the project and click on Open
Project Folder button.

When you expand the web-jpa-war node under projects, you'll see the following info.

Right click on web-jpa-war and select Run Project which will build, deploy and run the project.

The NetBeans IDE will open a separate output window for the project and logs the messages similar to the one shown below.
The IDE will open the browser as configured in build.properties with appropriate url of the deployed application.

Click on Create a Person Record to experiment with the sample.

Once you are done with the sample, you may want to stop the application server, by right clicking on Sun Java System Application
Server and selecting stop.
Summary:

In this exercise, you learned the features of Java EE 5 using Java EE 5 technology samples thru command line ant scripts and NetBeans IDE.

return to the top

Exercise 2: Demonstrate the scalability and availability using clustering (30 minutes)

Learning goals of this exercise:


Demonstrate the enterprise features of scalability and availability using clustering of GlassFish V2.

Goals of this exercise:

Glassfish V2 has new features such as Clustering, In-memory replication, so the goal of this exercise is to get students familiarize these concepts
and test these features with GlassFish V2.

User can create clusters of application server instances which can help distribute server instances from remote machines, and serve more
users by using Load balancing like Sun Webserver with Software Load Balancer plugin to avoid single-point of failure.
Other great feature of V2 is providing high availability using In-Memory replication to serve Http requests. High availability can be
enabled for both webcontainer (http requests) and ejb container (sfsb) in GlassFish V2 but this excercise will be based on http
loadbalancing / highavailability.
In these exercise students will learn how to setup clusters, use load balancer to distribute the http requests, and simulate the fail over of the
requests to healthy server instance if one of the instance is not available.

Steps to follow:

Configure the GlassFish application server and setup the Clustering, Load balancing and Availability features.

1. Setting up a One-machine Cluster using GlassFish V2


2. Configuring the Load Balancer Plugin
3. Deploying and Running the clusterjsp Sample Application, and testing clustering/load balancing.
4. High Availability/Fail over using In-memory Replication feature
5. Stop and Cleanup Cluster Settings

Step 1: Setting Up a One Machine Cluster

If you haven't verified the GlassFish V2 and SJS Webserver installation and configuration, please verify it as Exercise 0, as the next steps
assumes you have installed GlassFish V2 and SJS Webserver 6.1 and LB plugin.

Now to create the cluster, we need to first configure and start GlassFish V2 domain (which is in cluster mode), run following commands:

% cd $JAVAEE_HOME
This step is optional if you already have completed Exercise 1. But if you want to clean up previous
GlassFish Installation, and start everything from fresh, do
% ant -f setup-cluster.xml clean-runtime
% ant -f setup-cluster.xml
% cd ${JAVAEE_HOME}/bin
% asadmin start-domain domain1

To create a cluster on the machine running the above Domain Administartion Server (DAS), follow these steps:

1. In a shell window, change your working directory to ${JAVAEE_HOME}/samples/quickstart/clusterjsp


2. Run the command: ${JAVAEE_HOME}/bin/asant setup-one-machine-cluster which automates following steps.
The values of cluster.name and nodeagent.name are specified here, change it appropriately.
${JAVAEE_HOME}/samples/quickstart/clusterjsp/cluster.properties.
Creates a cluster with name cluster.name (cluster1)
Creates a node-agent with name nodeagent.name (cluster1-nodeagent)
Starts the node-agent
Creates two instances under the cluster that will use the node agent just created
3. Starts the cluster ${JAVAEE_HOME}/bin/asant start_cluster
4. Trouble-shooting:
if you see the errors while starting the cluster, you can ignore some harmless errors like "error 1, 2, 3" or "Caught JVM Exception:
java.net.ConnectException: Connection refused"
On some Windows XP PCs, if this command hangs at "start-node-agent", do CNTR-C and retry again. Second time this goes
through, starts node-agent, cluster successfully.
If asant setup-one-machine-cluster is not starting the cluster, in that case asant start_cluster must be explicitly invoked.

You can do the above steps using Adminstration GUI by accessing http://<glassfish-host-name>:<admin-port>

Step 2: Configuring the Load Balancer Plugin

After installing the Load Balancer Plugin, configure the <websrvr_instance_dir>/config/loadbalancer.xml file as follows:
<!DOCTYPE loadbalancer PUBLIC "-//Sun Microsystems Inc.//DTD Sun One Application Server 8.1//EN"
"sun-loadbalancer_1_2.dtd">
<loadbalancer>
<cluster name="cluster1" policy="round-robin">
<instance name="instance1" enabled="true" disable-timeout-in-minutes="60"
listeners="http://instance-one-host:instance-one-port" weight="100"/>
<instance name="instance2" enabled="true" disable-timeout-in-minutes="60"
listeners="http://instance-two-host:instance-two-port weight="100"/>
<web-module context-root="clusterjsp" enabled="true" disable-timeout-in-minutes="60"
error-url="sun-http-lberror.html" />
<health-checker url="/" interval-in-seconds="10" timeout-in-seconds="30" />
</cluster>

<property name="reload-poll-interval-in-seconds" value="60"/>


<property name="response-timeout-in-seconds" value="30"/>
<property name="https-routing" value="true"/>
<property name="require-monitor-data" value="false"/>
<property name="active-healthcheck-enabled" value="false"/>
<property name="number-healthcheck-retries" value="3"/>
<property name="rewrite-location" value="true"/>
</loadbalancer>

To turn on load balancer plug-in monitor messages, set the require-monitor-data property value to true. The load balancer plug-in logs record
the following information:

Request start/stop information for every request.


Failed-over request information when a request fails over from an unhealthy instance to a healthy instance.
List of unhealthy instances at the end of every health-check cycle.

Restart the Web Server after configuring the LB plugin from loadbalancer.xml file.

Step 3: Deploying and Running the clusterjsp Sample Application, and testing clustering/load balancing.

To test cluster1 of two GlassFish V2 Server instances, use the "clusterjsp" application located in
${JAVAEE_HOME} /samples/quickstart/clusterjsp directory as clusterjsp.ear
To deploy the clusterjsp application on "cluster1" of two instances, run following command

cd ${JAVAEE_HOME}/samples/quickstart/clusterjsp
% ${JAVAEE_HOME}/bin/asant deploy

Now all the clustering, load balancing configurations and application deployment is done.
You can access the clusterjsp application using http://hostname:web-server-port/clusterjsp (webserver port) and add
sessions to the application.

Clusterjsp http response will show which GlassFish Server instance (instance-ONE or instance-TWO) serving the request of the client. To
simulate application server clustering along with load-balancing, follow steps below

1. You will need to use two Firefox browsers or at least two seperate sessions of the browsers, and clear cache/cookies from the
browser before every new request (this is needed to simulate unique clients) to access a deployed clusterjsp sample application.
2. You access the clusterjsp application through webserver http://web-server-host:web-server-port/clusterjsp
and see the request is served by first instance that is running (instance-ONE in our case) in the http response you get in browser.
Healthy and the Unhealthy instance is been detected by webserver load-balancer plugin.
3. Open another Firefox browser, clear cache/cookies from the browser (Do it couple of times to really clear cache/cookies) and
access clusterjsp application again through webserver http://web-server-host:web-server-port/clusterjsp This time, you
can see the request is served by second instance that is running (instance-TWO in this case) in the http response you get in browser.
This ensures that requests are served by instances in the order set in the loadbalancer.xml file in Round-Robin fashion.
Screenshots below.

instance-ONE instance-TWO

This demonstrates the cluster of two instances instance-ONE, and instance-TWO which are managed by the Node-agents and Domain
Admininstration Server of GlassFish V2 and load balanced through Load Balancer plugin installed on SJS Webserver 6.1.

Step 4: High Availability/Fail over using In-memory Replication feature

To verify GlassFish server High-Availability or failover while accessing a deployed clusterjsp sample application, follow the steps below:

1. You can make a particular instance serve a request by restarting the web server that has the load balancer plugin installed before deploying
an application. This ensures that requests are served by instances in the order set in the loadbalancer.xml file. From the above
loadbalancer.xml instance-ONE will serve the first request.
2. We have already deployed a sample application that stores session data, e.g. clusterjsp web application as above. With this we should be
able to see that successive requests from same client are served by the same instance that the served first request and the session data is
maintained across the requests.
3. Send few requests and note down the instance that served those requests and shutdown that particular instance. Use this command to stop
the instance:
asadmin stop-instance --user adminuser --password adminpassword instance-name
4. Now send in the next request and verify that the new data is stored properly and that the previously added data is still there in the session.
Session Data

This demonstrate the same shopping-cart scenario to avoid single-point of failure. If one of the server serving requests and adding items in
shopping cart initially crashed, or not available anymore, then another server in the same cluster will take-over the request with all earlier session
data (added items of shopping cart) and complete the request. Here the session data is stored in Memory, so this demonstrates the in-memory
replication feature to get GlassFish server Highly Available.

Step 5: Stop and Cleanup Cluster Settings

To stop and remove the cluster setup, do the following.

1. To stop the cluster1 Cluster of two instances and cluster1-nodeagent nodeagent, run following command
cd ${JAVAEE_HOME}/samples/quickstart/clusterjsp
% ${JAVAEE_HOME}/bin/asant stop_cluster

% ${JAVAEE_HOME}/bin/asant stop_nodeagent

% ${JAVAEE_HOME}/bin/asadmin stop-domain domain1

% $sjsws6.1/stop

2. To remove cluster1 of two instances and node-agent, run following command


cd ${JAVAEE_HOME}/samples/quickstart/clusterjsp
% ${JAVAEE_HOME}/bin/asant clean-one-machine-cluster

% ${JAVAEE_HOME}/bin/asadmin delete-domain domain1

Summary:

This verifies the load balancing of GlassFish V2 with the SJS Webserver Load Balancer Plugin. The exercise above also verifies the in-memory
replication feature to get GlassFish server Highly Available

Congratulations! You have successfully completed the "LAB-3315: Java EE 5 Hands-on and Clustering using Open Source GlassFish Application Server " Hands -on lab.
Congratulations! You have successfully completed the "LAB-3315: Java EE 5 Hands-on and Clustering using Open Source GlassFish Application Server " Hands -on lab.
Please send your feedback to https://hands-on-labs.dev.java.net/servlets/ForumMessageList?forumID=2562

About Sun | About This Site | Newsletters | A Sun Developer


Contact Us | Employment Network Site
How to Buy | Licensing | Terms of Use | Privacy Unless otherwise
| Trademarks licensed, code in all
technical manuals herein
(including articles, FAQs,
samples) is provided
Copyright 1994-2007 Sun Microsystems, Inc. under this License.

Content Feeds

Вам также может понравиться