Skip to main content

Step By Step Guide:

Deploying Your Ear File Can Be Challenging

I am often asked how to standardize an ear file deployment around a WebSphere Cluster.  Deploying an ear file to a cluster can present challenges, particularly when attempting to accomplish the task with one-off deployment scripts written in any number of scripting languages.  In this example, I am using the defined logic with our DeployHub Continuous Deploy solution, designed to standardize the application release automation process. This logic can be called by any external process such as a Jenkins continuous integration workflow, or CloudBees Continuous Delivery pipeline process.

Whatever you may be using to orchestrate the calling of your deployment does not matter much. What matters is the ability to create a reproducible ear file deployment that all team members, from development to operations, can understand and track.

Steps for Setting Up an Ear File Deployment in the Websphere Cluster

  1. Get a list of the Servers that belong to the Cluster
  2. Loop through the list of Servers in the Cluster and Stop the App on each one
  3. Remove the App
  4. Install the App
  5. Apply warClassLoaderPolicy updates
  6. Apply classLoader updates
  7. Apply startingWeight
  8. Loop through the list of Servers in the Cluster and apply the following if changed
    1. Stop the Server
    2. Apply genericJvmArguments
    3. Apply initialHeapSize
    4. Apply maximumHeapSize
    5. Apply customProperty
    6. Apply websphereVariables
    7. Start the Server
  9. Loop through the list of Servers in the Cluster
    1. Start the Server if needed
    2. Start the App on the Server if needed

NOTES:  You may need to get the Cell Name for the Websphere Instance since that is one of the initial starting points.  Most of the time you can hard code it.

The stopping and re-starting of the Server is only needed if genericJvmArguments, initialHeapSize, maximumHeapSize, customProperty, websphereVariables values have changed. Otherwise, the servers can be left running saving total deployment time.  If you are using Jenkins, our plug-in can be downloaded from DeployHub Jenkins Plugin.

Make sure to check if something is stopped or started beforehand as this will prevent errors from being thrown. Of course, you can do similar processing for a War file.


Start Your Microservice Catalog

2017 SD Times 100 Award for DevOps Leadership