Quick Start WebLogic User Guide

Introduction

The document is a guide to demonstrate the WebLogic automation capabilities of RapidDeploy 3.x.

This document explains how to:

  • Initially create a WebLogic binary installation,
  • Create a “Golden Image” configuration on that binary with servers, clusters, JMS and Database resources and a simple Web App using a RapidDeploy WebLogic configuration file driving a Jython framework.
  • Take a snapshot of this environment.
  • Detect configuration drift and compare environment configurations
  • Create a template from the snapshot, and promote this to create further downstream environments based on this initial “golden” environment. This promote uses the RapidDeploy Snapshot/Template/Promote framework and doesn’t rely on any scripts.
  • Deploy ear files through these environments.

It uses the in-built Hypersonic in memory database, but in a live scenario, the data would be persisted to a RDBMS such as Oracle or DB2. Details of how to configure the application to use these databases can be found in the installation guide.

The instructions in this demonstration uses a remote agent to connect to the target server (in this case localhost). However a more likely scenario is to connect to a target server using the RapidDeploy in-built SSH client. Details of how to do this can be found in the MidVision RapidDeploy User Guide.

The document is intended for use by experienced middleware (including WebLogic Application Server) system administrators and therefore users are expected to possess the core capabilities required to manually administer environments.

This user guide is supplemented by the MidVision on-line media including quick-start video guides, all of which can be accessed from www.midvision.com

In this example we use file based snapshot/template/promote, but for WebLogic we could also use the RapidDeploy WebLogic JMX module to achieve the same ends.

In the case of a brown field site, the initial creation of the domain may not be required, and we would start by taking a snapshot of an existing environment.

Once these projects are implemented, creating further downstream WebLogic installations  should take minutes to set up and install. Deploying configuation to these installations is a simple matter of cloning (copying) the environment configurations already set up and deploying them either alone or with bundled code. Ear file builds can be performed by your usual process or through RD (using continuous integration if required) and the packages deployed through RD or automatically using the RapidDeploy command line API.

Windows/Linux: This demo project has been configured for use on Windows. However it is quite easy to convert to Linux. Look out for “Linux Configuration Tip:” throughout this guide.

Download the Weblogic Application Server binary file

Since this is a large file it is worth beginning the download (if you don’t already have the media to hand) for use in a later step when we create the package.

Version 10.3.3 can be downloaded from this location http://www.midvision.co.uk/downloads/repository_jars/repository/com/oracle/wls/weblogic-application-server/10.3.3/weblogic-application-server-10.3.3.jar

Later on this can be moved into your “build store”.

Download and install the RapidDeploy application

Download the latest RapidDeploy from one of the link below, check you select the correct version of your operating system:

Unzip the file to an installation directory, e.g. “/midvision” for linux or “C:\midvision” for windows.

This will create a directory called midvision. This location will now be referred to as $MV_HOME, e.g. “/midvision” for linux or “C:\midvision” for windows.

Edit the remote agent orchestration file.

If you plan to use a remote agent to run the deployments on the target servers then you will need to edit the remoting server file, putting in the host name of the server it will accept deployment requests from. Find the hostname of the machine you have installed the application to then type hostname from a command prompt.

e.g:

Windows Linux
C:\Users\user1>hostname [root@cloud ~]# hostname
user1-MV cloud.server.com

Goto $MV_HOME/remoting and edit the file midvision-remoting-server.xml. On line 43 change line:

<resource type=”auth.servers”>gui@localhost</resource>

To gui@hostname e.g.

<resource type=”auth.servers”>gui@user1-MV</resource>

Start the server and the remoting agent.

Goto $MV_HOME/bin and the run the start-up scripts to start the web app and the remote agent.

Windows Linux
start-web-app.bat start-web-app.sh
start-remoting-server.bat start-remoting-server.sh

Wait until you see “INFO: Server startup in“ in the output logs of the tomcat console (which opens as a separate window in Windows environments), alternatively check the $MV_HOME/logs/rapiddeploy-web-app.log for the line ”RapidDeploy web application is started” and ensure there are no errors, then go to http://localhost:9090/MidVision in a web browser. (Replace localhost with your linux server hostname/IP as appropriate)

At the login page enter the default username “mvadmin” and the default password “mvadmin” then click “Login”.  You will then be presented with a license page. Request a trial license from MidVision by emailing licensing@midvision.com. Once you have been emailed the license, enter the values on the screen and accept the EULA.

Note: This demo uses a Hypersonic in-memory database. This means if the web application process is killed from the Task Manager or a “kill” command then all data will be lost. To ensure that your data is stored to a file when the application is stopped, run the “stop-web-app.sh” or “stop-web-app.bat” script which is in the $MV_HOME/bin directory.

Use the Plugin Manager to Install the WebLogic Demo

Ensure the web application is started. Go to “Help / Plugin Manager” the “Available Plugins / Patches” tab. Click the “Install” button on the “WebLogic Example App” Plugin and then “Yes” to confirm, the project files will be downloaded to the $MV_HOME/projects directory. Once the download is complete the plugin will appear in the “Installed Plugins / Patches” tab.

WebLogic Example App (Click to Enlarge)

Alternatively, download the latest zip file from http://www.midvision.co.uk/wordpress/dnld/plugins/demo_projects_310/rapiddeploy-demo-projects-3.1.0-weblogic.zip and unzip in the root of your RapidDeploy installation (MV_HOME).

Configure the Resources.

Please note. If you are running RapidDeploy against an oracle database, a Sql script can be found in $MV_HOME/plugins/WebLogic Example App/<VERSION> that will create all of the following resources for you. You will still need to edit each project and replace “MV_HOME” with the correct path to the RapidDeploy install directory, and run a discovery on each project by editing it and then clicking “Discover” and clicking “Ok” to confirm.

Create the Projects

Go to “Resources/Projects/Add Project” then enter the following information (remember to change $MV_HOME with the actual location).

Field Value
Name WEBLOGIC_BINARY_INSTALL
Description WEBLOGIC_BINARY_INSTALL desc
Owner mvadmin
Deployment Type binaryInstall
Collection Type WEBLOGIC_CLUSTER_11
Log Directory $MV_HOME/logs
Project Root Directory $MV_HOME/projects/WEBLOGIC_BINARY_INSTALL
Properties Directory $MV_HOME/projects/WEBLOGIC_BINARY_INSTALL/j2ee/config
Build Store $MV_HOME/buildstore
Promotion Store $MV_HOME/promotionstore
Deployment package search string weblogic
Properties file identifier py
Master in Database False(not selected)

WebLogic Binary Install Project (Click to Enlarge)

Then click “Create”. Now add another project.

Field Value
Name WEBLOGIC_10_DEPLOY
Description WEBLOGIC_10_DEPLOY desc
Owner mvadmin
Deployment Type codeDeploy
Collection Type WEBLOGIC_CLUSTER_11
Log Directory $MV_HOME/logs
Project Root Directory $MV_HOME/projects/WEBLOGIC_10_DEPLOY
Properties Directory $MV_HOME/projects/WEBLOGIC_10_DEPLOY/j2ee/config
Build Store $MV_HOME/buildstore
Promotion Store $MV_HOME/promotionstore
Deployment package search string WEBLOGIC_DEPLOY
Properties file identifier py
Master in Database False(Not Selected)

Then click “Save”.

WebLogic Binary Install Project (Click to Enlarge)

Now edit the project named WEBLOGIC_10_DEPLOY and then click “Discover” and click “Ok” to confirm.

This will search the project configuration directory and look for the environment definition files and create any servers, environment, instances and deployment components it finds in to the application database. The environments are defined by the file names defined in the project properties directory. The structure of the environment filename is this:

SERVER.ENVIRONMENT.INSTANCE.APPLICATION

In a WebLogic context this relates to:

SERVER.WEBLOGIC_DOMAIN.WEBLOGIC_CLUSTER.APPLICATION

As the project WEBLOGIC_10_DEPLOY has a pre-configured environment definition, the discovery will create a new server named “wlsserver01”, a new environment named “weblogicenvironment01_file” and a new instance named “weblogicinstance01_file”. We will later configure the connection details to the server so we can install WebLogic and also we will configure the environment and the instance.

First add another project – the final one!

Field Value
Name WEBLOGIC_10_CONFIGURE
Description WEBLOGIC_10_CONFIGURE desc
Owner mvadmin
Deployment Type codeDeploy
Collection Type WEBLOGIC_CLUSTER_11
Log Directory $MV_HOME/logs
Project Root Directory $MV_HOME/projects/WEBLOGIC_10_CONFIGURE
Properties Directory $MV_HOME/projects/WEBLOGIC_10_CONFIGURE/j2ee/config
Build Store $MV_HOME/buildstore
Promotion Store $MV_HOME/promotionstore
Deployment package search string WEBLOGIC_CONFIGURE
Properties file identifier conf
Master in Database False(Not Selected)

Now edit the project named WEBLOGIC_10_CONFIGURE and then click “Discover” and click “Ok” to confirm.

Orchestration Panel

It is worth looking at the project orchestration panel at this point. The Examples projects have preconfigured orchestrations, but these may be amended as desired to add or change individual task actions (from the list of around 150 on the left hand side) for this deployment. In the example below, the TOKENIZERS tree item is opened, displaying three tasks. Task actions are environment independent actions that run in sequence whenever this deployment project is run (when any deployment package based on this project is deployed).

In this case we see the runInstaller task highlighted, with its values in the “Selected Task Detail” pane.

Take a look at the orchestrations for the other projects.

Orchestration Panel for the WebLogic_Binary_Install Project (Click to Enlarge)

Linux Configuration Tip: The orchestrations for WEBLOGIC_10_BINARY_INSTALL and WEBLOGIC_10_CONFIGURE will work correctly out of the box for Windows and Linux.

The WEBLOGIC_10_DEPLOY project is configured for Windows. In order to use on a Linux/Unix box, please edit the orchestration and DESELECT all tasks starting with  the word “Windows”. Instead SELECT all tasks Starting with “Linux”. All other tasks should be left as-is.

Configure the Server

Goto “Resources/Targets/Servers” then edit the server named wlsserver01. Edit these fields (remember to change $MV_HOME with the actual location, you will also need to ensure the Build Store directory exists on your target):

Field Value
General Tab
Display Name wlsserver01
Hostname localhost
Build Store: $MV_HOME/remotebuildstore
OS Type: <Select your OS type>
Version: <Set your OS version>
Allow Deployments: True
Connection timeout (ms): 2000000
Remoting Tab
Agent Enabled for deployments: True
Agent Enabled for discovery: True
Remote Agent Port: 20000
Agent Path:

Then click “Save”.

Click edit on the server named “wlsserver01”” and then click “Test Agent” and click “Yes” to confirm. The application will then check it can communicate with the remote agent. You should see the following output:


Test Success
The test connection completed successfully.

If the test was successful.

Configure the WebLogic Installation Directory

In this section we define the file path that WebLogic will be installed into on the target server.

Go to “Resources / Targets / Installations” then click “Add Environment Installation”.

Enter these fields. Remember to change $WEBLOGIC_HOME with the actual location you want to install WebLogic to, the default value for this demonstration example is:

Windows/Linux: “/midvision/apps/WebLogic/”

Linux Configuration Tip: Please note that using a leading “/” instead of “c:/” will resolve correctly on Windows and Linux.

Field Value
Installation Path $WEBLOGIC_HOME
Server wlsserver01

Then click “Create”.

WebLogic Binary Install Path (Click to Enlarge)

If you have entered anything different from the default path location, go to the project WEBLOGIC_BINARY_INSTALL (“Resources / Projects”) and click “edit” then select the “Orchestration” tab and edit orchestration tasks DeleteTask, MkDirTask, DiskSpaceCheckTask, DirectoryWriteCheckTask and change and paths from “/midvision/apps/WebLogic” to the value you entered for the Installation Path above Make sure the changes are saved in the orchestration.

Add the following Environment Variables to the installation (In this one case you must use absolute path beginning c:/or / depending on server architecture due to a WebLogic restriction):

Key

Value

WLS_INSTALL_DIR

C:/midvision/apps/WebLogic/bea/wls (Windows)

/midvision/apps/WebLogic/bea/wls  (Linux)

NODE_MANAGER_PORT

7890

LOCAL_JVMS

c:/apps/java16

INSTALL_NODE_MANAGER_SERVICE

no

BEAHOME

C:/midvision/apps/WebLogic/bea (Windows)

/midvision/apps/WebLogic/bea (Linux)

WebLogic Binary Installation Properties (Click to Enlarge)

Install WebLogic

Now you have defined a server and an installation directory you can install WebLogic to your target server at the location specified. Using the WebLogic binary file downloaded at the start of this document, add it to the $MV_HOME/buildstore directory otherwise you will not have a package to install.

Now start the install job. Go to “Job / New Job”. Select the project WEBLOGIC_BINARY_INSTALL the open the server tree and select the EnvironmentInstallation you created in the earlier step, then click “Next”.

New Binary Job Selection (Click to Enlarge)

Select the version (which is the file you have copied to the buildstore). Then select “Skip to finish” and then click “Next”. Click “Execute Request” then click “Yes” to confirm. WebLogic will start to install in the target server. You can click the “View Progress” button on the job and you should see the deployment log files.

In this binary installation the following tasks are executed:

  1. Delete the install directory if it exists
  2. Make the install directory
  3. Check there is at least 1024Mb of free space on the target server at the install directory.
  4. Check the directory is writable
  5. Install WebLogic to the directory.

When the job has finished you will see the text:


2011-12-21 12:01:34,902 [Thread-12] INFO  com.midvision.rapiddeploy.utilities.exec.LocalScriptRunner - 100%
2011-12-21 12:05:48,173 [Thread-12] DEBUG com.midvision.rapiddeploy.utilities.exec.LocalScriptRunner - Closing streams...
2011-12-21 12:05:48,174 [Thread-12] INFO  com.midvision.rapiddeploy.utilities.exec.LocalScriptRunner - Execution finished, exit code 0
2011-12-21 12:05:48,214 [Thread-12] INFO  com.midvision.rapiddeploy.orchestration.tasks - Task [ WebLogicBinaryInstallTask ]...Fixing permissions...
2011-12-21 12:05:48,214 [Thread-12] INFO  com.midvision.rapiddeploy.orchestration.tasks - Task [ WebLogicBinaryInstallTask ]...Finished... 2011-12-21 12:05:48,214 [Thread-12] INFO  com.midvision.rapiddeploy.orchestration.tasks - Work Unit ... Complete ...
2011-12-21 12:05:48,214 [Thread-12] INFO  com.midvision.rapiddeploy.orchestration.tasks - Finishing generic-batch...
2011-12-21 12:05:48,214 [Thread-12] DEBUG com.midvision.rapiddeploy.orchestration.tasks - Return Code = 0 Completed RapidDeploy Deployment Request

You can go to “Jobs / Previous Jobs” and you can download and view the log file of the complete deployment.

Install a sample WebLogic Domain

The following steps will:

  • Create a WebLogic node manager as a windows service and start it up
  • Create an AdminServer and start it up
  • Create 2 clusters and 2 Standalone servers
  • Create a JMS provider
  • Create a JDBC provider
  • Install a sample application

Check your installation path

If you are using the default install paths C:\midvision or /midvision, then there is nothing further required here. If you have changed the path, then please amend the dictionary file as follows:

  • Select Environment – Edit/Promote.
  • Select the WEBLOGIC_10_DEPLOY project.
  • From the Dictionary Drop-Down, select “Data Dictionary”
  • Change @@MV_WLS_HOME@@ from /midvision/apps/WebLogic to the required base path ($WEBLOGIC_HOME).
  • On Windows, change @@NODE_MGR_SVC_NAME@@=C_midvision_apps_WebLogic_bea_wls to be the correct path to your wls directory, with “_” replacing “/” or “\”.

Create a deployment package

Goto “Resources/Software Management/Packages” then select the WEBLOGIC_10_DEPLOY project from the drop down.

Click “Add Package Wizard” button and enter “WEBLOGIC_DEPLOY_001″ as the package name. Check the “Skip to Finish” checkbox and click next.

Click “Create This Deployment Package” on the final tab.

WebLogic 10 initial deployment package (Click to Enlarge)

We have now packaged our project directory, including a war file and all the required configuration to create the target domain. This package can be used to create our environment. It could also be used to create additional environments by simply cloning the configuration of the first environment. Instructions can be found in the RapidDeploy User Guide. For our purposes, creating one environment using this method is sufficient.

Deploy the Package.

Go to “Jobs / New Job” then select the project WEBLOGIC_11_DEPLOY then open the server, environment, instance and select the application “examplesWebApp” then click “Next”.

New Configuration Deployment Selection (Click to Enlarge)

Now select the version, which is the deployment package you have just created, select “Skip to finish” then click “Next”. Click “Execute Request” then click “Yes” to confirm. This will start to deploy the package.

The steps taken in this deployment are:

  1. Delete the domain directory
  2. Create the Domain Directory
  3. Delete the deployment directory
  4. Create the deployments directory
  5. Initial Domain Creation (Includes creation of Clusters, servers, JMS, JDBC resources and deployment of an ear file).
  6. Install NodeManager
  7. Start NodeManager
  8. Restart the domain

Once the job has completed you can view the deployment log file from the Previous Jobs section.

Check the domain

The following Url: http://localhost:22347/examplesWebApp/ should return a “Hello” message from the installed application.

Log into and explore the WebLogic install by accessing the Admin Web UI at: http://localhost:7001/console/login/LoginForm.jsp

Username: weblogic

Password: weblog1c

Using the Created Project and first environment in a real life scenario

The WEBLOGIC_10_DEPLOY project is reusable to update the domain or its servers or resource providers as changes are made, as well as deployable applications. However all the tasks in the orchestration except the WebLogicInitialDomainCreation task should be switched off.

If you wish to deploy an ear file over time (such as during the normal development lifecycle), without associated configuration changes, this can be achieved via the DeployFileViaJmxTask. An example of this configuration may be found in the WEBLOGIC_EAR_DEPLOY_JMX project  included with this demo.

The project we have created at this point has just one environment. You may now use RapidDeploy to clone multiple further weblogic environments from this one in order to, for example, create a set of route to live environments. The creation process asks you to amend the dictionary items used in the first environments for your environment specific values.

Snapshot a WebLogic Server Profile

Now WebLogic has been installed we can take a snapshot of the default configuration to use as a control when configuration changes are made.

Configure the Environment (WebLogic installation – all profiles)

Go to “Resources / Targets / Environments” edit the environment named “weblogicenvironment01_file”. Enter the following values (remember to change $WEBLOGIC_HOME with the actual location):

Field Value
General Tab
Display Name weblogicenvironment01_file
Parent Server display name wlsserver01
Owner mvadmin
Software Product: Oracle WebLogic 11
Environment Type: Unknown
Software Version: 11
Binary Path: $WEBLOGIC_HOME e.g. /midvision/apps/WebLogic/bea/WLSTestCases/11g/MyGenericDomain (Windows and Linux)
Connectivity Tab
Admin Port:  7001
Connection String:
Environment Admin Username:  weblogic
Environment Admin Password:  weblog1c

Then click save.

Configure the Instance

Go to “Resources / Targets / Instances” edit the instance named “weblogicinstance01_file”.  This is normally the logical name of  a cluster or stand alone server to deploy to. Enter the following values:

Field Value
General Tab
Instance Name weblogicinstance01_file
Parent Environment name: weblogicenvironment01_file
Parent Server display name wlsserver01
Owner mvadmin
Collection Type: WEBLOGIC_CLUSTER_11
Software Version: 11
Binary Path:
Allow deployments True
Connectivity Tab
Hostname
Port:  7001
Username:  weblogic
Password:  weblog1c
Alias:

Then click Save.

Take a Domain (Environment) Snapshot

Now we will take a snapshot of the version of WebLogic that has just been installed. It is a “Golden Image” version of the configuration, which will be used to compare against in the future.

Go to “Resources / Targets / Environments” edit the environment named “weblogicenvironment01_file“. Then click “Snapshot” then click “Yes” to confirm. The snapshot will be requested. You can go to “Jobs / Executing Jobs” and see the log output of the snapshot.

Make a change to Configuration through the WebLogic Console.

Log in to the WebLogic Console. Select Servers / ClusteredManagedServer1 /Tuning

Change one of the parameters. Save the change.

Now take another snapshot as was done in the previous section.

Compare The Snapshots

Go to “Environment / Environment Comparison”, click on “Snapshot Comparison”.  Enter “5” into the “Comparison Context size (optional 1-50):” field.  This will display 5 lines above each difference and 5 line below, to give the comparison some context.  If you leave this field blank it will display the complete XML, which can be quite large.  Then select snapshot with ID 2 for the left side and snapshot with ID 1 for the right side, then click “Compare”.

You should see the configuration differences from the “Golden Image” domain to the changed domain.

Create further environment definitions from the created one

Convert Snapshot to Template

Now that we have a template of our “Golden Domain”, we can turn that into a template for creating as many new environments as we need. We can then keep these environments (typically our “Route To Live” environments) in sync throughout the lifecycle of our project, deploying new versions of code, configuration or both. We can always roll back to our Golden Image, or any subsequent change made upon it, by redeploying previous deployment packages.

Please see the RapidDeploy User guide for assistance in converting a snapshot to a template and deploying out to subsequent environments.

Go to Environment / Edit/Promote. Select the WEBLOGIC_10_CONFIGURE project.

You will see one (preconfigured) environment. Click “Create Template from Snapshot Wizard”.

On the “Choose Location” tab, accept the default (this projects configuration directory). You can change this value if you want to use the configuration from this project to “seed” another project.

Click “Next”

On the “Snapshot Selection” tab, select one of the snapshots you took above. It doesn’t matter which one.

Click “Next”

On the “Name” panel you need to give the new environment you are creating a name, based on the server, environment instance and application you are going to deploy to.

Some values may be prefilled with the values from the originating environment (where the snaposhot was taken from). Add additional values. In this case set the instance to “weblogicinstance01_file” and the application to “examplesWebApp1

Click “Next”

On this panel we convert the snapshot to a template by adding placeholder variables to the snapshot, which are replaced at deploy time to environment specific values.

In this case click on “Edit Local”, search for “-Xmx256m” and replace it with -Xmx@@MAX_HEAP@@m. Do this for all occurrences.

You can also use the download/upload buttons to download the snapshot to your desktop and edit in your favorite browser.

Normally you would repeat this for all the variables you want to change. But for this demo we’ll just change this one.

Click “Next”.

On this panel, add in “512″ for the MAX_HEAP variable, so that this will be the new value in this environment.

Click “Next”

On the final tab click “Create this environment”. The template files will be copied to the project, and the configuration and dictionary files created.

Returning to the “Edit/Promote” panel we now see the new environment.

The buttons to the right enable us to edit the environment files, promote changes to the environment properties to other environments, delete or copy this environment. Please see the user guide for a complete description.

For example as administrators we can directly edit project files, stored on the RapidDeploy server (possibly in a configuration management tool) through the GUI :

Or as a user we can request changes that go into a workflow approval process:

Create a package

Create another deployment package as described above. This time use the “WEBLOGIC_10_CONFIGURE” project. Name the package “WEBLOGIC_CONFIGURE_001

Deploy the package

Use “WEBLOGIC_10_CONFIGURE” project, and select the package created above.

You will notice you have two targets to deploy to now, the one shipped with this demo and the one you have just created. In this demo example these are actually the same target environment we created previously.

Take a snapshot

Take another snapshot of the target environment. Notice that the heap size has now changed to “512″.

Result

We have used the snapshot/template/promote to push a changed heap size back to our original domain. In fact we could have used this method to push our entire configuration of the “golden” domain to another vanilla WebLogic install, which would have created all of the servers, clusters, JMS and Database providers present in the first instance.

Did you find the Guide "Quick Start WebLogic User Guide" Useful?

View Results

Loading ... Loading ...

Comments are closed.