Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Administer applications using wsadmin.sh
Install enterprise applications using wsadmin.sh
Overview
Use AdminApp or AdminApplication to install an application to the application server run time. We can install...
- enterprise archive file (EAR)
- web application archive (WAR)
- servlet archive (SAR)
- Java archive (JAR)
The wsadmin tool automatically wraps WAR and JAR files as an EAR file.
Use the most recent product version of wsadmin.sh when installing applications to mixed-version environments to ensure that the most recent wsadmin options and commands are available. bprac
If the configuration consists of a node, a cell, and a server, you can specify that information when you enter the install command. Review the list of valid options for the install and installinteractive commands in the Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands using wsadmin.sh topic to locate the correct syntax for the -node, -cell, and -server options.
### Jython
AdminApp.install('location_of_ear.ear','[-node nodeName -cell cellName -server serverName]')
### Jacl
$AdminApp install "location_of_ear.ear" {-node nodeName -cell cellName -server serverName}
You can also obtain a list of supported options for an enterprise archive (EAR) file using the options command, for example:
### Jython
print AdminApp.options()
### Jacl
$AdminApp options
You can set or update a configuration value using options in batch mode. To identify which configuration object is to be set or updated, the values of read only fields are used to find the corresponding configuration object. All the values of read only fields have to match with an existing configuration object, otherwise the command fails.
We can use pattern matching to simplify the task of supplying required values for certain complex options. Pattern matching only applies to fields that are required or read only.
We can install the application in batch mode, using the install command, or you can install the application in interactive mode using the installinteractive command. Interactive mode prompts you through a series of tasks to provide information. Both the install command and the installinteractive command support the set of options you chose to use for your installation in the previous step.
Install to cluster
### Jython string
AdminApp.install('/path/to/MyStuff/application1.ear', '[-cluster cluster1]')
Jython list:
AdminApp.install('/path/to/MyStuff/application1.ear', ['-cluster', 'cluster1'])
### Jacl
$AdminApp install "/path/to/MyStuff/application1.ear" {-cluster cluster1}
Install interactively with prompts
### Jython
AdminApp.installInteractive('/path/to/MyStuff/application1.ear')
### Jacl
$AdminApp installInteractive "/path/to/MyStuff/application1.ear"Save the configuration changes.
AdminConfig.save()
Synchronize the node.
What to do next
The steps in this task return a success message if the system successfully installs the application. When installing large applications, the command might return a success message before the system extracts each binary file. We cannot start the application until the system extracts all binary files. If you installed a large application, use the isAppReady and getDeployStatus commands for the AdminApp object to verify that the system extracted the binary files before starting the application.
The isAppReady command returns a value of true if the system is ready to start the application, or a value of false if the system is not ready to start the application. For example, using Jython:
print AdminApp.isAppReady('application1')
### Jacl
$AdminApp isAppReady application1
If the system is not ready to start the application, the system might be expanding application binaries. Use the getDeployStatus command to display additional information about the binary file expansion status, as the following examples display:
### Jython
print AdminApp.getDeployStatus('application1')
### Jacl
$AdminApp getDeployStatus application1
Run the getDeployStatus command where application1 is DefaultApplication results in status information about DefaultApplication resembling the following:
ADMA5071I: Distribution status check started for application DefaultApplication. WebSphere:cell=myCell01,node=node1,distribution=unknown,expansion=unknown ADMA5011I: The cleanup of the temp directory for application DefaultApplication is complete. ADMA5072I: Distribution status check completed for application DefaultApplication. WebSphere:cell=myCell01,node=node1,distribution=unknown,expansion=unknown
Start servers using scripting
Install enterprise application files with the console
Automate application configuration
Use the wsadmin scripting AdminApp object for scripted administration
Synchronize nodes using wsadmin.sh
Related
startManager command
Application installation and uninstallation scripts
Commands for the AdminApp object using wsadmin.sh
Options for the AdminApp object install, installInteractive, edit, editInteractive, update, and updateInteractive commands using wsadmin.sh
Example: Obtaining option information for AdminApp object commands using wsadmin.sh