GlassFish Bootcamp Handson Lab 10mar09
Sunday Mar 08, 2009
The lab consists of 4 tasks and it starts with an easy one :-)
Prior to starting the lab, install and start application server. Call the install location of application server as <as-root>
Task_1: webservices sample deployment and testing
download pkghello-web.war and save it under, let us say <sample-root> directory
01 Connect to admin console from a browser using http://localhost:4848/
02 Deploy webservices application
- select 'Web Applications' from the left navigation menu
- Click <Deploy> button on the right
- provide location of the sample file pkghello-web.war
- scroll down and select 'server' as target
- click on <OK> for deployment
- observe the server.log <install_root>/domains/domain1/logs/server.log
03 Test the deployed webservices application
- select 'Web Services', 'Hello' from the left navigation menu
- click on <Test> button in the right window
- above action pops up a window with links
- click on the first link which points to 8080
- experiment with the sample by inputting appropriate values
Task_2: webservices sample monitoring
01 Turn on monitoring for webservices
- select 'Web Services', 'Hello' from the left navigation menu
- select 'Monitor' tab in the right window
- select 'Configuration' tab underneath 'Monitor' tab
- change 'Monitoring Level' to 'High' and click on <Save> button
02 Monitor webservices application
- gather monitoring data by experimenting with webservices application as described in item 03 above under task_1
- select 'Statistics' tab underneath 'Monitor' tab
- observe different monitoring stats
- select 'Messages' tab underneath 'Monitor' tab
- click on 'Time Stamp' url and notice the request/response messages
Task_3:Deploy, manage and Monitor using CLI
01 Define environment variables
AS_ADMIN_HOST=localhost
AS_ADMIN_PORT=4848
AS_ADMIN_USER=admin02 Remember that the default admin password is 'adminadmin'
03 Deploy web application
download cli-hello.war and save it under, let us say <sample-root> directory
> cd <as-root>/bin
> asadmin deploy <sample-root>/cli-hello.war
> asadmin list-components
04 Turn the monitoring on for web applications
> asadmin get "server-config.monitoring-service.module-monitoring-levels.*"> asadmin set "server-config.monitoring-service.module-monitoring-levels.http-service=HIGH"
> asadmin set "server-config.monitoring-service.module-monitoring-levels.web-container=HIGH"
05 Monitor the web application similar to 'top' in unix
> asadmin monitor --type
webmodule --filter //server/cli-hello serveruse key <h> for help on column titles
use key <q> to quit
> access the web application using a browser
> http://localhost:8080/cli-hello, as you experiment with the application, notice how the asadmin monitor values change
Task_4: Create a cluster and deploy a web application
01 Create and start node agent in a terminal using CLI
> asadmin create-node-agent agent1
> asadmin start-node-agent agent1
02 Create and start a cluster using Admin Console
> click on 'Create New Cluster' in the Common Tasks Page
> enter name of the cluster
> click <New...> in the Server Instances table, enter instance name and node agent
> click <New...> again to add another server instance
> click <OK> button to create this cluster with 2 instances
> in the Clusters table, select this cluster and press 'Start Cluster' button.
03 Deploy Web Application
> expand 'Clusters' in tree node and select the cluster
> go to Applications tab and click <Deploy...> button
> scroll down and observe that this cluster is preselected as the 'target'.
> enter application location and press <OK> button.










