Search This Blog

Friday, 5 June 2015

Weblogic Application Deployment: weblogic.Deployer - [Part 2]

Here in this post I would like to share the illustration of weblogic.Deployer utility. This utility can be used when there are many ear or war files to deploy on the WebLogic domain. The redeployment process too complex if there are many deployment units exists. Such scenarios, you can use automation scripts for Windows platform use batch scripts (.cmd/.bat files) in Linux/ Unix environments (.sh/.ksh) files.



1. Deploy an application using Command line:




 
java weblogic.Deployer -adminurl [url] -username [username] -password [password] -name [myapp] -targets ["ms1" | "myCluster1"] -deploy ["c:/applications/myapp.ear"]  


Example :
Here we have deployment unit as benefits.war file and it is targets to ms1, ms2... you can target the same to cluster as well.
java weblogic.Deployer -adminurl t3://localhost:7001 -username weblogic -password weblogic1 -name benefits -source c:\applications\benefits.war -targets ms1,ms2,ms3 -deploy


Log :
The utility weblogic.Deployer invoked with options:  -adminurl t3://localhost:7001 -username weblogic -name benefits -source c:\benefits.war -targets ms1,ms2,ms3 -deploy
<Oct 25, 2012 11:04:22 AM IST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating deploy operation for application, benefits [archive: c:\applications\benefits.war] , to ms1 ms2 ms3 .>


Task 6 initiated: [Deployer:149026]deploy application benefits on ms1,ms3,ms2.

Task 6 completed: [Deployer:149026]deploy application benefits on ms1,ms3,ms2.

Target state: deploy completed on Server ms1

Target state: deploy completed on Server ms3

Target state: deploy completed on Server ms2


2. Undeploy an application


I've got to example specific to undeploy only. You can get the examples for specific comamnds you can try as follows:

vagrant@mydev:~$ java weblogic.Deployer -undeploy -examples
weblogic.Deployer invoked with options:  -undeploy -examples
[action] Undeploy deactivates and removes an application from a target.

 java weblogic.Deployer -adminurl url -username username -password password
-name myapp -undeploy -targets server1,server2..

Example :
java weblogic.Deployer -adminurl t3://localhost:7001 -username weblogic -password weblogic1 -name benefits -undeploy  -target  MS1,MS2



Output:

The following screen shot taken from Vikram execution...
Undeploy application using weblogic.Deployer command line tool

weblogic.Deployer invoked with options:  -adminurl t3://localhost:7001 -username weblogic -name benefits -undeploy

<Oct 25, 2012 11:14:54 AM IST> <Info> <J2EE Deployment SPI> <BEA-260121> <Initiating undeploy operation for application, benefits [archive: null], to configured targets.>

Task 7 initiated: [Deployer:149026]remove application benefits on ms1,ms3,ms2.

Task 7 completed: [Deployer:149026]remove application benefits on ms1,ms3,ms2.

Target state: undeploy completed on Server ms1

Target state: undeploy completed on Server ms3

Target state: undeploy completed on Server ms2



3. Redeploy an application:




java weblogic.Deployer -adminurl [url] -username [username] -password [password]  -name [myapp] -redeploy


Example:
java weblogic.Deployer -adminurl t3://localhost:7001 -username weblogic -password weblogic1 -name benefits -redeploy

Output:

The utility weblogic.Deployer invoked with options:  -adminurl t3://localhost:7001 -username weblogic -name benefits -source c:\benefits.war -targets ms1,ms2,ms3 -deploy
    


Task 6 initiated: [Deployer:149026]deploy application benefits on ms1,ms3,ms2.

Task 6 completed: [Deployer:149026]deploy application benefits on ms1,ms3,ms2.

Target state: deploy completed on Server ms1

Target state: deploy completed on Server ms3

Target state: deploy completed on Server ms2



4. Multiple servers sharing the same physical deployment:



java weblogic.Deployer -adminurl [url] -username [username] -password [password] -name [myapp] -targets [server1,server2] -nostage -deploy [c:/myapps/myapp.ear]




No comments:

Post a Comment

WebLogic Books

  • Oracle WebLogic Server 12c: Administration Handbook
  • WebLogic Diagnostic Framework
  • Advanced WebLogic Server Automation
  • Oracle SOA Suite 11g Administrator's Handbook

Popular Posts