WebSphere Administration
WebSphere Administration
WebSphere Administration
A practical guide to WebSphere scripted administration
options
Tool 2: wscp
What is it?
o v4’s configuration and runtime scripting language
Main features:
o Extension of Tcl, the Tool Command Language
• Tcl is portable across many platforms
• Tcl widely used for scripting tasks, not just WebSphere
• Simple to learn, powerful to use
o Interactive or scripted access
o Typically used for bulk and repeatable tasks, e.g.:
• Add a set of definitions in a repeatable manner
• Change the value of a system property on all servers in all domains (but
not easily)
o Can do most things that can be done in the Admin Console
Tool 3: XMLConfig
What is it?
o v4’s XML configuration utility
Main features:
o Private to WebSphere, unlike Tcl
o Exports full or partial repository to an XML file
o Imports from XML file with arbitrary substitutions
o Not interactive (but can be called interactively from wscp)
o Can create, update or delete objects
o Can start/stop objects
o Typically used for repeatable tasks, e.g.:
• Add a set of definitions in a repeatable manner
o Can be invoked from Admin Console, shell or wscp
Is a natural choice for doing anything in bulk or Is a good choice for repetitive tasks where
repetitive changes are simple substitutions
Is not dependent on having something built Is dependent on creating something first
manually first manually (unless you create the XML by hand)
Can be used for ad hoc purposes interactively Export+partial can do some ad hoc tasks
(but not always easily)
Tool 4: wsadmin
What is it?
o v5’s scripting language
Main features:
o Uses the Bean Scripting Framework (BSF)
• Provides access to Java objects and methods from supported scripting
languages.
• Architecture for easily incorporating scripting into Java applications
and applets
• Applications independent and not bound to a single scripting language
• Different language scripts can access Java objects using wsadmin
o Current supported languages for wsadmin:
• Jacl - Java Command Language based on Tcl scripting
• Jython – Java implementation of the OO language Python
Tool 4: wsadmin
How is it different from wscp?
o The WebSphere objects are completely different from wscp
o Tcl is easy to learn, but wsadmin is complex
o Separates static configuration from dynamic changes
Typically used for bulk and repeatable tasks, e.g.:
o Add a set of definitions in a repeatable manner
o Change the value of an environment variable on all servers in all cells
Can do everything in the Admin Console, but not in a necessarily intuitive
manner
p
inAp
m MBean
Ad
AdminConfig MBean
Script wsadmin AdminControl
H
el
MBean
p
MBean
wsadmin: Miscellaneous
Commands are case-sensitive
Configuration changes not persisted until "save" call
If multiple scripts or clients (Administrative Console) are saving
configuration changes at the same time, exception thrown on
Save call
o No changes will be persisted
Upon "save" call, validation procedure verifies updates
o Create two servers with the same name throws exception
wsadmin -f "xxxxx" much faster than wsadmin -c "xxxxx"
o Better to run multiple commands in a file than individual commands
o Call "save" in file periodically to persist configurations updates
• Avoids no changes being persisted should an exception occur
Tool 7: JMX
What is it?
o Java Management Extensions (JMX) is a framework oriented at managing applications
and resources (like application servers)
• Allows for exposing your application to remote or local management tools
• JMX is a specification oriented to the application and network management
• Part of J2SE
Main Features:
o Some of the JMX functionality:
• Allows you to query the configuration settings and change them at runtime
• Provides services such as monitoring, event notification, timers, ....
• Allows you to load, initialize, change, and monitor application components and
resources
o Structured in three layers:
• Instrumentation layer - MBeans
• Agent layer - MBeanServer and agents
• Distributed Services (this part is still out of the scope of the current level of the
specs)
JSR-077
JVM
Resources
External tools
Connector MBeans
and programs MBean
Server
MBeans
JMX Benefits
Enables Java applications to be managed without heavy investment
o Relies on a core managed object server that act as a ‘management agent’
o Java application simply needs to embed a managed object server and make some of its
functionality available as one or several Manageable Beans registered in the object
server
Provides a scalable management architecture
o Every JMX agent service is an independent module that can be plugged into the
management agent
Integrates existing management solutions
o JMX smart agents are capable of being managed through HTML browsers or by
various management protocols such as Web Services, JMS, SNMP, etc.
Defines only the interfaces necessary for management
Connector Adapter
Agent Layer
MBean Server
JMX
MBean Connector
Server
MBeans
MBeans
MBean
MBean
Proxy
Proxy
Node Mgr
Config Repository
Service
JMX
MBean Connector
Server To Other
Nodes Master
MBeans
Master
files
MBeans Master
files
To Other App MBean files
MBean
Servers Proxy
Proxy
JMX
tmx4j Connector config
MBean files
MBean
Server
Server
MBeans
EAR files
MBeans
Tool 8: SWAN
What is it?
o Simplified WebSphere AdministratioN
o Greatly eases wscp and wsadmin hassle
Main features:
o Runs in wscp and wsadmin
o Obtainable from the author
o Runs on WebSphere v4, v5, v5.1
o Runs on Windows, AIX (probably all UNIXes) and z/OS
o Simplifies writing wscp and wsadmin scripts
o Simplifies interactive access
o Provides a high degree of portability between WebSphere versions
SWAN
wscp wsadmin
SWAN Syntax
<class> <verb> [<object>] [<options>] [<attributes>]
Examples:
o appserv list
o dsource list –format -short
o jcafact delete jack –ra jill
o resadapt create ada –rarfile /usr/product/somefile.rar
o cluster show clouseau +maxheap +minheap
o appserv show jeeves +webhttpbacklog –constraint {Host * Port 9080}
o appserv modify jeeves +webhttpbacklog 53 –constraint {Host * Port 9080}
o appserv modify –constraint {Host * Port 9080} +webhttpbacklog 57 jeeves
o jmsdest exists jack –jmsprov jill
Getting help:
o help
o dsource help
o jdbcdrv help create
o jcafact attributes
o jcafact attributes -details
o cluster create clouseau -member sellers –vertical 3
o cluster showmembers clouseau
o appserv makecluster jeeves –cluster wooster
o cluster start wooster
o cluster stop wooster -force
SWAN: Coverage
appserv Application servers
cell Domain or cell
cluster Clusters (server groups)
dsource Data sources
entapp Enterprise applications
jcafact J2C connection factories
jdbcdrv JDBC drivers (providers)
jmsdest JMS destinations
jmsfact JMS connection factories
jmsprov Generic JMS providers
mail Java mail
nagent Node agents
resadapt Resource adapters
vhost Virtual hosts
v4 code 3700
v5 code 3600
2
Edit in Excel
PVCS
Project-Specific
Configuration Spreadsheet
iwf_acm_iiw_app.cfg.xls
Edit in Excel
Project-Specific
Configuration Edited
Spreadsheet Project-Specific
Configuration
Spreadsheet
7
Generator
Project-Specific
Configuration Configuration
Configuration
Configuration
Spreadsheet scripts
scripts
scripts
Generator
14
11
Package
i..edApps
on node EAR
A
Edited Configuration
Configuration
Configuration 12
13 scripts
Tivoli Software
.ear EAR scripts
scripts Configurator
Distribution
AID
15
WebSphere
Domain
entapp create
Heap sizes 2 4 6 45 9 2
(plus
Environment 16 60 24 19 wsad 35 6
min)
Transport 43 23 ? 40 3
Display 30 8 30 ? 50 6
(but displays
everything)
Installation 20 75 25 ? ? 4
Summary
References
o “IBM WebSphere System Administration” by Leigh Williamson et al (ISBN: 0-
13-144604-5)
o “IBM WebSphere Deployment and Advanced Configuration” by
Barcia/Hines/Alcott/Botzum (ISBN: 0-13-146862-6)
o WAP:
• http://www-1.ibm.com/support/techdocs/atsmastr.nsf/WebIndex/PRS981
o SWAN:
• [email protected]