Sunday, June 30, 2013

Provisioning JBoss Application Server as a RHQ bundle

** Click here to jump to references/introductions to terms and technologies **

Need for Application Provisioning

Rather than coming up with my interpretation of Application Provisioning and potentially not getting it quite right, I have decided to present it to you right from the JBoss Operations Network official documentation

Provisioning is a way that administrators can define and control applications, from development to production. The ultimate effect of the provisioning system is simplifying how applications are deployed. Administrators can control which versions of the same application are deployed to different resources, from different content sources, within the same application definition (the bundle definition). Resources can be reverted to different versions or jump ahead in deployment.

Obviously there is more detail provided in the documentation if you choose to read further. For now, we will next look at when you might use a RHQ bundle for provisioning.


When to use a RHQ Bundle for Provisioning ?

Without JON


You may choose to use a RHQ bundle for provisioning when :
  • You need portability of the bundle. Bundles come in as .zip files, a format that is well understood by various OS platforms
  • You have an application that can (or needs to) be deployed on mixed OS platforms
  • You have to externalize the deployment properties to a file that can be customized per destination at deploy time
  • You have (optional) pre-install and post-install tasks that you would like to execute on the destination before and after bundle deployment

With JON


In addition to all of the above reasons, one can use RHQ bundle with JON for following additional reasons:
  • You would like to deploy to a group of platforms at once
  • You would like to track the versions of bundles deployed thus far and have the ability to revert to any specific version at any time
  • You would like to be asked to provide values for the deployment properties prior to the deployment

Lets now take a look at the bundle I put together for our demo! The goal is to be able to provision the JBoss community Wildfly application server and start it post-deployment, all automatically.


Provisioning JBoss Application Server as a RHQ bundle

Setup

Follow the instructions step-by-step below to setup the bundle contents
  1. Go to Vijay's GitHub site here
  2. Click on Download ZIP and download the zip file. Unzip the file to an empty/clean folder of your choice
  3. While the browser window is pointing at the same site, read and execute the Pre-Installation Setup instructions in the Readme document
Following are images that show contents of the folder at various stages:

Extract from GitHub and initial unzip

Folder snapshot post-completion of steps of "Pre-Installation Setup"

Command-Line Installation

Follow the instructions step-by-step below to deploy the from command-line:
  1. Go to Vijay's GitHub site here
  2. Read and execute the Command-Line Installation instructions in the Readme document
  3. If everything goes well, you should see the server start-up as shown in the image below
Following are snapshots of the folder and command execution:

Creating deployment destination and defining deploy-time properties

Checkout of app server post command-line installation

Bundle Installation via JBoss Operations Network


Follow the instructions step-by-step below to upload/deploy the bundle from JON:
  1. Package the working demo folder into in deployable RHQ bundle

    Creating the RHQ bundle (.zip) for deployment via JON

  2. Assuming you have JON installed, make sure you made groups of compatible platforms that are potential destinations (Inventory tab)

    Creating a group of compatible destinations

  3. Create a new bundle (Bundle tab) by clicking on the the New button at the bottom of the window in the center. Once the zip file is uploaded, click thru next screens that ends with clicking on a Finish button

    Creation of a bundle in JON

  4. Select the bundle and click on Deploy button to start the deployment process. As a first step you would have to define a Destination, refer to the image below:

    Bundle Deployment - Assigning a Destination

  5. After choosing the default version of 1.0 in the next screen, move on to the screen where you need to fill in the deploy-time property values

    Bundle Deployment - Providing values for the deploy-time properties

  6. After successfully deploying the bundle on a platform (Windows) that is different from the platform (RHEL), verify both the destination deployment folder and the server start

    Folder snapshot post bundle deployment via JON - Windows Destination 

    Checkout of app server post bundle installation via JON

  7. Peek into JON for the view post-bundle deployment. To revert to a different version or to purge/delete the bundle from a destination you would click on one of the buttons shown in the image below

    Post-Bundle deployment view in JON

  8. To appreciate the value of the readymade scripts as part of the bundle deployment run the shutdown script as shown below and see the server shutdown

    Shutdown the server thru the ready-made shutdown script

References

1 comment: