Starting the wsadmin scripting client:
1.Launch the wsadmin tool using Jython:
wsadmin -lang jython wsadmin.sh -lang jython
Note OutPut:
WASX7209I: Connected to process “dmgr” on node dnodeV60 using SOAP connector; The type of process is: DeploymentManager
2. Launch the wsadmin tool using Jython when security is enabled:
wsadmin.bat -lang jython -user wsadmin -password wsadmin
3. Launch the wsadmin tool using Jacl with no options:
wsadmin.bat -lang jacl
4. Run scripting commands as individual commands
a. AdminApp object using Jython:
wsadmin -lang jython -c “AdminApp.list()” —->windows
wsadmin.sh -lang jython -c ‘AdminApp.list()’ —-> unix
b.AdminApp object using jacl:
wsadmin -c “$AdminApp list” —->windows
wsadmin.sh -c “\$AdminApp list” (or) wsadmin.sh -c ‘$AdminApp list’ —-> unix
5. To Run the a1.py script using Jython
wsadmin -lang jython -f al.py —>windows
wsadmin.sh -lang jython -f al.py —> unix
where the al.py file contains the following commands:
apps = AdminApp.list()
print “Applications currently installed:\n ” + apps
6. Run the a1prof.py script using Jacl:
wsadmin.bat -profile alprof.jacl —-> windows
wsadmin.sh -profile alprof.jacl —–> unix
where the alprof.jacl file contains the following commands:
set apps [$AdminApp list]
puts “Applications currently installed:\n$apps”
–> Using the wsadmin scripting objects: Use the AdminConfig, AdminControl, AdminApp, AdminTask, and Help objects to perform administrative tasks.
Each of the management objects have commands that you can use to perform administrative tasks. To use the scripting objects, specify the scripting object, a command, and command parameters. In the following example, AdminConfig is the scripting object, attributes is the command, and ApplicationServer is the command parameter.
Using Jython:
print AdminConfig.attributes(‘ApplicationServer’)
Using Jacl:
$AdminConfig attributes ApplicationServer
–> Help object for scripted administration:
For example, using Jacl, $Help AdminApp or using Jython, Help.Adminapp(), provides information about the AdminApp object and the available commands.
You can also use the Help object to obtain information about messages using the message command. The message command provides aid to understand the cause of a warning or error message and find a solution for the problem. For example, you receive a WASX7115E error when running the AdminApp install command to install an application, use the following example:
Jacl —> $Help message WASX7115E
jython –> print Help.message(‘WASX7115E’)
print Help.help()
—> Use the AdminConfig object, the AdminTask object, and the AdminApp object to handle configuration functionality.
The AdminConfig object, the AdminTask object, and the AdminApp object are used when you are managing the configuration of the server that resides persistently in a repository on permanent storage. Use these objects to create, query, change, or remove this configuration without starting an application server process. To use the AdminTask object, you must be connected to a running server.
–> Use the AdminControl object to manage running objects on application server installations.
—->
* AdminControl: Use to run operational commands.
* AdminConfig: Use to run configurational commands to create or modify WebSphere Application Server configurational elements.
* AdminApp: Use to administer applications.
* AdminTask: Use to run administrative commands.
* Help: Use to obtain general help.
—->Installing applications with wsadmin Tool:
On a single server installation, the server must be running before you install an application.
On a network deployment installation, the deployment manager must be running before you install an application.
The application that you install must be an .ear, .jar, .sar or .war for the wsadmin tool.
For example, if your configuration consists of a node, a cell, and a server,
AdminApp.install(‘location_of_ear.ear’, ‘[-node nodeName -cell cellName -server serverName]‘)
print AdminApp.options() —> list of supported options for an Enterprise Archive (EAR) file
For a single server installation only, –> AdminApp.install(‘c:/MyStuff/application1.ear’, ‘[-server serv2]‘)
. For a network deployment installation only, –> AdminApp.install(‘c:/MyStuff/application1.ear’, ‘[-cluster cluster1]‘)
Save the configuration changes —> AdminConfig.save()
In a network deployment environment only, synchronize the node. See the Synchronizing nodes with the wsadmin tool article for more information.
Set the variable for node synchronization
Sync1 = AdminControl. completeObjectName(‘type=NodeSync,node=myNodeName,*’)
Synchronize the node by issuing the following command:
AdminControl.invoke(Sync1, ‘sync’)
We receive an output value of true, if the synchronization completes.
=======================================
–> AdminApp.view( ‘appName’ ) : Replace appName with one of the names returned byAdminApp.list(). The name must be surrounded by quotes
–> AdminApp.list() : Lists every application installed in your cell
—> AdminTask.createApplicationServer(‘Node1?, ‘[-name serverNode1 ]‘) : Creates a new application server called “serverNode1? in a node called “Node1?
Recent Comments