Websphere Application Server Command Line Administration: Ibm Software Group
Websphere Application Server Command Line Administration: Ibm Software Group
Tom Alcott
[email protected]
IBM Software Group
Agenda
Introduction
wsadmin Overview
wsadmin with Security
AdminApp
AdminConfig
AdminControl
AdminTask
Controlling MBeans
IBM Software Group
Introduction
ą Why Script?
– To Provide a Repeatable Process
ą
The Same Rationale As W riting a Business Application
IBM Software Group
Agenda
Introduction
wsadmin Overview
wsadmin with Security
AdminApp
AdminConfig
AdminControl
AdminTask
Controlling MBeans
IBM Software Group
wsadmin Overview
"wsadmin" - Scripting interface for WebSphere Application Server since v5.0
wsadmin offers a number of Advantages
Same scripting tool for all versions of WebSphere
Based on the Bean Scripting Framework (BSF)
Current supported languages for Wsadmin
jacl - Java Command Language based on Tcl scripting
JPython - Java implementation of the Python programming language
Robust scripting features and programming model very similar to Java
Utilize existing programming and scripting skills and technology
BSF Overview
Architecture for easily incorporating scripting into Java applications and applets
Scripting language are commonly used to augment an application function or to
script together a set of application components to form an application
Applications independent and not bound to a single scripting language
Different language scripts can access Java objects (wsadmin)
Java programs can evaluate and access results from scripts in other languages
BSF supports interoperability between Java and BML, JScript, Netscape Rhino
(JavaScript), NetRexx, PerlScript, VBScript, Jacl, JPython, and LotusXSL
IBM Software Group
nTas
k
pl
MBean
MBean
IBM Software Group
wsadmin help
ą Using Jacl
– $AdminConfig help
– $AdminControl help
– $AdminApp help
– $AdminTask help
ą
$AdminTask help -commands
ą Using Jython
– print AdminConfig.help()
– print AdminControl.help()
– print AdminApp.help()
– print AdminTask.help()
ą
print AdminTask.help('-commands')
IBM Software Group
ą V6.1 Application Server Toolkit and V7.0 RAD A&D provide tools
for the creation and maintenance of wsadmin Jython files
– Includes an editor with an outline view, color syntax highlighting
and context sensitive code completion
– Integration with the new "command assist" function
available in the admin console
– Intercepts generated commands for easy insertion into Jython Script
ą Jython debug support provides an
integrated debugger for stepping
through the execution of a wsadmin
Jython script
IBM Software Group
wsadmin>AdminTask.createApplicationServer('-interactive')
Create Server
Agenda
Introduction
wsadmin Overview
wsadmin with Security
AdminApp
AdminConfig
AdminControl
AdminTask
Controlling MBeans
IBM Software Group
Modify soap.client.props
# JMX SOAP connector identity
com.ibm.SOAP.loginUserid=jdoe1
com.ibm.SOAP.loginPassword=mypassword
IBM Software Group
Modify sas.client.props
Rely on Client Prompt
C:WAS61\AppServer\profiles\Dmgr01\bin>wsadmin -conntype RMI -port 9809
WASX7209I: Connected to process "dmgr" on node alcottManager using RMIconnector; The type of process is:
DeploymentManager
WASX7029I: For help, enter: "$Help help"
wsadmin>
IBM Software Group
Agenda
wsadmin Overview
wsadmin with Security
AdminApp
AdminConfig
AdminControl
AdminTask
Controlling MBeans
IBM Software Group
AdminApp
AdminApp
Agenda
Introduction
wsadmin Overview
wsadmin with Security
AdminApp
AdminConfig
AdminControl
AdminTask
Controlling MBeans
IBM Software Group
AdminConfig
AdminConfig
AdminConfig
{bootClasspath {}}
{classpath {}}
{debugArgs "-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket
,server=y,suspend=n,address=7777"}
{debugMode false}
{disableJIT false}
{genericJvmArguments {}}
{hprofArguments {}}
{initialHeapSize 0}
{maximumHeapSize 256}
{runHProf false}
{systemProperties {}}
{verboseModeClass false}
{verboseModeGarbageCollection false}
{verboseModeJNI false}
Agenda
Introduction
wsadmin Overview
wsadmin with Security
AdminApp
AdminConfig
AdminControl
AdminTask
Controlling MBeans
IBM Software Group
AdminControl
AdminControl
Start Server
wsadmin>$AdminControl startServer <servername> <nodename>
wsadmin>$AdminControl startServer server1 alcott
Stop Server
wsadmin>$AdminControl stopServer <servername> <nodename>
List Applications Running on a Server
set apps [$AdminControl queryNames type=Application,cell=$cname,node=$nname,process=$sname,*]
puts " Number of applications running on $sname: [llength $apps]"
foreach app $apps {
set aname [$AdminControl getAttribute $app name]
puts " $aname"
}
puts "----------------------------------------------------"
puts ""
IBM Software Group
AdminControl
Stop/Start Applications
List the Applications for a Server ($AdminApp list will also work)
wsadmin>set apps [$AdminControl queryNames cell=<cellname>,node=<nodename>,type=Application,process=<servername>,*]
wsadmin>
IBM Software Group
AdminControl
# Remove those servers from the serverMBeans list that should not be stopped
# .... For this example assume that two particular servers were removed from serverMBeans
set numOtherBeans 2
while {1} {
after 5000 # Wait 5 seconds for stop
set serverMBeans [$AdminControl queryNames cell=$cellName,node=
$nodeName,type=Server,processType=ManagedProcess,*]
if {[llength $serverMBeans] == $numOtherBeans} {
break
}
}
IBM Software Group
AdminControl
[1/7/04 0:26:59:725 EST] 4d87bd86 AbstractShell E WASX7120E: Diagnostic information from exception with text
"com.ibm.websphere.management.exception.ConfigServiceException
javax.management.InstanceNotFoundException: *:*,node=alcottManager,type=NodeAgent
AdminControl
Enabling Trace
Turn on Trace
wsadmin>$AdminControl setAttribute $ts traceSpecification com.ibm.*=all=enabled
Agenda
Introduction
wsadmin Overview
wsadmin with Security
AdminApp
AdminConfig
AdminControl
AdminTask
Controlling MBeans
IBM Software Group
AdminTask
– Using AdminTask
– AdminTask.setJVMDebugMode (['-serverName', 'server1', '-nodeName',
'node1', '-debugMode', 'true'])
IBM Software Group
Agenda
Introduction
wsadmin Overview
wsadmin with Security
AdminApp
AdminConfig
AdminControl
AdminTask
Controlling MBeans
IBM Software Group
Operation
boolean isStarted()
java.lang.String state()
java.lang.String stateExtended()
void start()
void start(java.lang.String)
void stop()
void stop(java.lang.String)
[Lcom.ibm.websphere.sib.admin.SIBQueuePoint; listQueuePoints()
com.ibm.websphere.sib.admin.SIBQueuePoint getQ ueuePoint(java.lang.String)
[Lcom.ibm.websphere.sib.admin.SIBQueuedMessage; getQueuePointMessages(java.lang.String)
com.ibm.websphere.sib.admin.SIBQueuedMessage getQueuePointMessage(java.lang.String, java.lang.String)
com.ibm.websphere.sib.admin.SIBQueuedMessageDetail getQ ueuePointMessageDetail(java.lang.String, java.lang.String)
com.ibm.websphere.sib.admin.SIBQueuedMessageDetail getQ ueuePointMessageDetail(java.lang.String, java.lang.String, java.util.Locale)
[B getQ ueuePointMessageData(java.lang.String, java.lang.String, java.lang.Integer)
com.ibm.wsspi.hamanager.G roupName getHAG roupName()
java.lang.String getHealth()
void injectF ault(java.lang.String)
void dump(java.lang.String)
java.util.Collection getPreparedT ransactions()
void commitPreparedT ransaction(java.lang.String)
void rollbackPreparedT ransaction(java.lang.String)
void resetDestination(java.lang.String)
[Ljava.lang.String; getEventT ypes()
javax.management.j2ee.statistics.Stats getStats()
IBM Software Group
Notifications
SIB.messaging.engine.start
SIB.messaging.engine.stop
SIB.security.not.authenticated
SIB.security.not.authorized
SIB.communications.connection.start
SIB.communications.connection.stop
SIB.message.exceptioned
SIB.client.connection.start
SIB.client.connection.stop
j2ee.state.starting
j2ee.state.running
j2ee.state.stopping
j2ee.state.stopped
j2ee.state.failed
j2ee.attribute.changed
jmx.attribute.changed
Constructors
IBM Software Group
Summary
Additional Resources
Beginning Tcl
http://mini.net/tcl/298.html
More Information on jacl (The Java version of Tcl)
http://mini.net/tcl/jacl
The Tcl/Jacl Project
http://tcljava.sourceforge.net/docs/website/index.html
The JPython Projct
http://sourceforge.net/projects/jpython/
http://www.jython.org
V6.0/V6.1/V7.0 Info Center
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp
http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/index.jsp
Additional Resources
ą
WebSphere Application Server
Administration Using Jython
– by Robert A. Gibson, Arthur Kevin
McGrath, Noel J. Bergman
IBM Software Group
wscp
wscp> EnterpriseApp install /Node:mynode/ c:\temp\myapp.ear -
defappserver /Node:mynode/ApplicationServer:Default_Server/
wsadmin
wsadmin>$AdminApp Install c:/temp/myapp.ear -conntype NONE
Multiple ways to execute the command
wsadmin -c "$AdminApp Install c:/temp/myapp.ear -conntype
NONE"
wsadmin -lang jacl -f mycommand.jacl