Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Look up keyword
Like this
12Activity
0 of .
Results for:
No results containing your search query
P. 1
Glassfish

Glassfish

Ratings:

4.33

(3)
|Views: 1,803|Likes:
Published by VTR Ravi Kumar

More info:

Published by: VTR Ravi Kumar on Dec 04, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

04/22/2012

pdf

text

original

 
 
CONTENTS INCLUDE:
n
About GlassFish
n
Installing GlassFish
n
GlassFish Domains Profle
n
Common Administration Tasks
n
Clustering and Load Balancing
n
Hot Tips and more...
DZone, Inc.
 
|
 
The use o GlassFish application server is growing, and havinga reerence card or day-to-day jobs is inevitable. Looking or asample command to perorm a specifc job can take time but byusing this recard, you won’t need to look or any commands orlose time searching in countless pages o manuals and admin-istration reerences. This recard covers administration, security,and perormance management topics.GlassFish is a Java EE application server which is hosted onJava.net and mainly sponsored by Sun Microsystems. GlassFishusually has ull support o the latest Java EE related JSRs. It isaccessible both under GPL and CDDL licenses.What makes it dierent rom other products:
n
Support or the latest web services specifcation in additionto proven interoperability with Microsot WCF.
n
Support or both older and newer versions o EJBs.
n
Cluster wide management and deployment.
n
High availability both with in-memory replication andpersisted replication using HADB.
n
Fine grained monitoring API based on JMX in addition toalready available monitoring acilities in its administrationconsole.
n
Support or Ruby on Rails, in addition to PHP support,using Quercus makes GlassFish a suitable application serveror hosting heterogeneous applications.Usually more than one version o GlassFish is available ordownload, which includes the current stable version, the previousstable version with all patch and post ported eatures, anddevelopment builds o the next GlassFish version. You shouldchoose the current version unless you are looking or a mainte-nance release or past versions, or you are eager to check outnew JSRs or unctionalities.
Downloading the right version o GlassFish:
I you are goingto deploy some applications in a production environment youshould choose a current stable version. And i you have a verymission critical application, but you do not require to have thelatest standards, go with the previous stable version. Developmentversions are only suitable or experimental tasks and not orproduction. The current version o GlassFish is GlassFish Version 2,update release 2, which is available at:https://glassfsh.dev.java.net/downloads/v2ur2-b04.html.Distribution packages are available or six dierent operatingsystems as ollows:
Selecting a GlassFish version:
There are several downloadsavailable or each version o GlassFish. Each o these packagesis suitable or one operating system so you need to ensure toget the package designated or your own OS. Go tohttps://glassfsh.dev.java.net/public/downloadsindex.html to access theGlassFish download page.
Sun Microsystems’ distribution o GlassFish:
Sun Microsystemsprovides an alternate package o GlassFish application server.Sun’s package comes with an installer, integrated HADB or theenterprise version, an integrated Open ESB, Portlet container,access manager, and some other projects. Sun's distribution islocated athttp://java.sun.com/javaee/downloads/index.jsp.
GlassFish documentation:
There is plenty o documentation whichwill help you to get started or to continue with using GlassFish.Some o the most important:
 n
n
Master index or all versions o GlassFish documentation:https://glassfsh.dev.java.net/javaee5/docs/DocsIndex.html
n
 
 ABOUT gLASSfISh WhAT IS gLASSfISh? WhERE TO gET gLASSfISh
   G   l  a  s  s   F   i  s   h
   A  p  p   l   i  c  a   t   i  o  n   S  e  r  v  e  r
  w  w  w .   d  z  o  n  e .  c  o  m    S  u   b  s  c  r   i   b  e   N  o  w    f  o  r   F   R   E   E   !
n
Authoritative content
n
Designed for developers
n
Written by top experts
n
Latest tools & technologies
n
Hot tips & examples
n
Bonus content online
n
New issue every 1-2 weeks
Subscribe Now or FREE!Recardz.com
(They’re free!)
 
Operating SystemsEnglish LanguageDistribution PackageMultilingual DistributionPackage
Solaris SPARC Platormglassfsh-installer-v2ur2-b04-sunos.jarglassfsh-installer-v2ur2-b04-sunos-ml.jarSolaris x86 Platormglassfsh-installer-v2ur2-b04-sunos_x86.jarglassfsh-installer-v2ur2-b04-sunos_x86-ml.jarWindows Platormglassfsh-installer-v2ur2-b04-windows.jarglassfsh-installer-v2ur2-b04-windows-ml.jarLinux Platormglassfsh-installer-v2ur2-b04-linux.jarglassfsh-installer-v2ur2-b04-linux-ml.jarMacOS Platormglassfsh-installer-v2ur2-b04-darwin.jarglassfsh-installer-v2ur2-b04-darwin-ml.jarAIX Platormglassfsh-installer-v2ur2-b04-aix.jarglassfsh-installer-v2ur2-b04-aix-ml.jar
GlassFish
 
Application Server
By Masoud Kalali 
 
GlassFish
 
Application Server
2
DZone, Inc.
 
|
 
How to install GlassFish:
In order to install GlassFish you willonly need to execute the ollowing commands in the consolewindow:1.
 java -Xmx256m -jar glasssh-installer-vx-bx-osname.jar 
 
It will extract the packed fle, while vx and bx will bereplaced by version and build number.2.
ant -f setup.xml
I you do not have ANT in your environment then you cannavigate to the extracted GlassFish directory and execute: 
lib/ant/bin/ant -f setup.xml
 
The frst installer will install GlassFish in the developer profleand the second one will setup GlassFish in the enterpriseprofle, which is a cluster aware confguration.
GlassFish Directory Structure
Each GlassFish installation can host multiple domains thatwork independently with independent confguration areas likesecurity, access port, and libraries. You deploy your applicationsinside these domains, and the domains are the entities whichspan your server. Figure 1 shows typical content o a GlassFishinstallation directory.1. Domains parent older is typically where a createddomain will reside.2. A designated domain lib older is where you should putyour common libraries like JDBC driver, cache libraries,and web ramework library.3. Copy any deployable package into this older, andGlassFish will pick it up and deploy it using deaultconfguration.4. All logs that you may need or troubleshooting areinside this directory.5. Scripts to directly start and stop the domain withoutusing
asadmin
reside inside this older.6. Domain confguration fles like
domain.xml
and
default-web.xml
are inside this directory.7. Deployed applications reside in the sub-directory o this directory.
gLASSfISh ADmINISTRATION ChANNEL
 
INSTALLINg gLASSfISh
8. Domain master password which protects domaincertifcation store fles, is stored inside this fle.9.
asadmin
and other commands like
wsgen
,
wsimport 
,
 xjc
, and
 jspc
reside inside this older.10. Inside this older resides one o the most importanteatures o GlassFish. It lets you add or update yourapplication server unctionalities.11. JMS implementation o GlassFish applicaton serverresides in this older. There are some administrationtools or JMS broker administration inside its binolder. GlassFish uses Open MQ as the deault JMSimplementation.12. The library older o the application server whichis shared between all domains that are hosted in theinstance and certainly all applications that are deployedinside those domains.13. Sample application which will help you learn Java EEaster and easier.GlassFish provides you with several administration channelswhich can be used in dierent situations.
Web-based administration console:
You can access theAdministration console using a browser. GlassFish uses a separatehttp listener or the administration console in order to providea detailed, and completely separate confguration or it. You may access the web-based administration console usinghttp://127.0.0.1:4848/. In case you are trying to access theadministration console rom a remote place, change the IPaddress to the address which resembles your server address.The deault administration credentials are
admin
 
as usernameand
adminadmin
as password.
Command line administration console:
This is the preerredway or the experienced administrators who can‘t quit thecommand line habit. However, some tasks like creating/removing/backing-up and restoring a domain is only possibleusing the CLI (Command Line Interace). To enter the commandline administration console, navigate to GlassFish_home/bin and execute
./asadmin
. There are two ways to execute acommand using
 
./asadmin
or
asadmin.bat 
.1. Pass the command as a parameter to the asadminwhen you want to execute it. 
./asadmin help
2. Execute the asadmin and then execute the commandin the asadmin console. 
asadmin>help
Figure 1:
GlassFish installation directory structure.
HotTip
You should know that you can get generalhelp by executing the
help
command in theadministration console, and you can getdetailed help for each command by executing
help command-name
.
 
 
3
DZone, Inc.
 
|
 
GlassFish
 
Application Server
Each GlassFish domain can be created in one o the ollow-ing three profles. Each profle has its own characteristics,and thereore, its own benefts and drawbacks. You should consider that when you have no replication,you have the best possible perormance provided by theapplication server, and using any kind o replication either inmemory or HADB degrades the perormance.
--prole
letsyou determine your domain profle during domain creation.Here is a detailed profles comparison:Some common administration tasks that you may encounterin perorming your daily jobs are categorized as ollows:GlassFish provides web-based administration console andCLI or perorming administrative tasks. Supporting bothCLI and web-based console will let administrators withdierent tastes manage their GlassFish installation rom theiravorite channel. For example, a veteran administrator maywrite some scripts or perorming daily jobs while anotheradministrator may preer to use web-based console to managethe application server. In this recard I will use CLI path as it iseasier and saves time.
Deploying and undeploying an application:
To deploy anapplication independently rom its type (WAR, EAR, RAR,etc.), the ollowing command will do the job. The commandhas many options which are omitted to show the commonuse case. Application server should be running to executethe command.
deploy 
--name samplename
--contextroot samplecontext --upload=true --dbvendorname derby --createtables=true /home/ masoud/customer-cmp-ear.ear 
Following are some additional commands related to domainmanagement:
GlassFish Administration Channel, continued
JMX (Java Management eXtension) / AMX (ApplicationServer Management eXtension):
This channel is mostlypreerred by developers who need to interact with theGlassFish administration core by code. These APIs allowyou to extend monitoring and management acilities o theGlassFish application server. In order to connect to the JMXadministration console, you can use any JMX console likeJDK's JConsole or MC4J, and then connect to the GlassFishserver using
IP: 8686
and its administration credentials. Theport may dier based on your selected port number duringdomain creation.JConsole is a part o the JDK (Java Development Kit). Youcan run it by issuing the
 jconsole
command in your operat-ing system command line interace.MC4J is a JMX management console built on top o Net-Beans RCP. It is highly modular and easy to use. MC4J canbe ound athttp://www.mc4j.org.
HotTip
If you would like to change the default 60 minutestime out of the web-based administration consoleto something smaller or bigger, you can use thefollowing command in
asadmin
CLI:
set server.admin-service.das-confg.admin-session-
timeout-in-minutes= NUMBER
ProfleCharacteristicsDeveloper
Suitable or developers who develop and test applications; embeddedJMS implementation; no clustering; heart-beat support
Clustered
Can join a cluster, support heartbeat, has both embedded and local JMSimplementation and can also support in-memory session replication.
Enterprise
This domain is comprised o all the Cluster profle eatures, in additionto utilizing NSS or security store, replication using HADB, and enabledplatorm security manager by deault
CommandDescription
list-domains
Lists all available domains. You can pass
--domaindir <PATH_TO_DOMAINS_DIRECTORY>
in orderto list domains that are not in the deault domains directory
verify-domain-xml
 Veriy the domain.xml fle to check its consistency. You mayissue this command ater you edit the
domain.xml
manually. Ittakes domain name as its required operand
TaskCommandDescriptionTo createa domain
create-domain --adminuser admin --adminport 4848--instanceport 8080 --prolecluster --domainpropertiesdomain.jmxPort=8686:http.ssl. port=8181 domain8
Although the command gives you muchmore control, the ones mentioned areenough.
To start adomain
start-domain --verbose=truedomain8
By using
--verbose=true
you can seedetailed output about what applicationserver is doing and spot any possibleproblem it may encounter.
To stop adomain
stop-domain domain8
It will stop the
domain8
; you will need toinclude domain name i you have morethan one domain in the domains directory.
To deletea domain
delete-domain domain8
It will delete the given domain(
domain8
)
To backupa domain
backup-domain domain8
This command will create a backup roma domain named domain8. The domainis in the deault domains directory o GlassFish. Otherwise you will needto pass
--domaindir 
, which points toa parent directory o the designateddomain. Backups will reside inside adirectory named backups, which is insidethe domain8 directory.
Restorea domainbackup
restore-domain --lename / opt/dev/apps/Glasssh_2_ur2/ domains/domain8/backups/ sjsas_backup_v00001.zipdomain8
As you can see, we pass the completepath o the backup fle in order to allowthe asadmin to process and restore thegiven domain based on its content.
ProflesFeaturesDeveloperClusterEnterpriseSecurity Manager
DisabledDisabledEnabled
Security Store
JKSJKSNSS
HTTP Access Log
DisabledDisabledEnabled
JVM Sotware
ClientClientJDK
Session Replication
NoIn MemoryHADB
Cluster Support
NoYesYes
GMS Heartbeat
NoYesYes
Quick Startup
 YesNoNo
 
gLASSfISh DOmAINS pROfILECOmmON ADmINISTRATION TASkS
DEpLOyINg, UNDEpLOyINg AND mONITORINg AppLICATIONS, AND mANAgED RESOURCES

Activity (12)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
bugmenot540 liked this
sspadmin liked this
chakri029 liked this
pranay1507 liked this
eliazarmorillo liked this
maurochess liked this
Louie Casimero liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->