Generating a configuration template from an existing
Websphere Application Server cell and uploading it to Code Station
is required before deploying the configuration template. You use the
Middleware Configuration for WebSphere® plug-in
to generate the template.
Before you begin
- SSH must be set up on UNIX and Linux platforms. The scripts use
it to communicate to the remote system.
- JAVA_HOME must be set to a value that does not contain spaces.
On Windows systems, the eight-character
abbreviated form must be used if a directory name contains spaces.
For example, specify C:\Program Files\ as C:\Progra~1\.
- Determine what tokens you need. Tokens are used to represent information
that is different among deployment environments. For example, you
might specify a different database server or JDBC resource in each
of a development, test, and production environment. For each token,
you need a name and an initial value. You are prompted to enter the
names and values at the end of the process.
Procedure
- Install the Middleware Configuration for WebSphere plug-in to your system. You
can use a Windows or a Linux system. To install this plug-in,
see Installing plug-ins.
- Unzip the plug-in.
- Install the Version 6 UrbanCode Deploy command line client
tool.
To install the tool, download the udclient.zip file
to the system on which you want to use the tool. You can download
the file from the IBM® UrbanCode Deploy server
by clicking and then clicking IBM UrbanCode Deploy Client.
You can also find the file in the folder server_install/opt/tomcat/webapps/ROOT/tools/,
where server_install is the
installation folder for the server.
- Run the genWASTemplate script to discover
and import the configuration of an existing cell.
The
script imports configuration data from the cell and cluster scopes.
The
script generates one configuration template for the cell plus one
configuration template for each discovered cluster. The generation
process can take several minutes or longer, depending on the cell.
The
script does not import applications.
For full usage information,
execute genAMCTemplate with no options.
The
following command uses line breaks for readability. Do not use them.
If you are on a Windows system,
use genWASTemplate.bat.
./genWASTemplate.sh
-environment myenv
-osuser root
-ospassword rootpswd
-washost washost.mydomain.com
-port 8887
-soapClientProperties
-tmplname mytmplname
-profilePath /opt/IBM/was85twonode/AppServer/profiles/dmgr
During
execution, the genWASTemplate script creates a promote.properties file
and pauses to allow you to add tokens to the file.
- Add tokens to the properties file when the script pauses. Tokens are used in places where the user is expected to provide
information during deployment.
- Open the properties file:
<plug-in_home>/user/environments/myenv/cells/85/promote.properties
- Enter one token per line in the form name=value.
A commented token appears in the file.
# UatDbName=uat.db.com
# this will tokenize all "uat.db.com" strings read from WebSphere
so that when the template is instantiated, the value for UatDbName
from the Environment Property Definition is used to apply the configuration
template to the live cell.
- Save the file and exit the editor.
- Press Enter in the command window where
the script is running. The script then continues.
- Start UrbanCode Deploy if it is not already running.
- Import the component template provided for Middleware Configuration
for WebSphere. Do
the following in UrbanCode Deploy. The <plugin_home> directory
is the top directory where you unzipped the downloaded UrbanCode Deploy
plug-ins.
- Click the Components tab.
- Click the Templates tab.
- Click Import Templates.
- Select <plugin_home>/jsonTemplates/Middleware
Configuration for WebSphere.json . This template
becomes the default template for the remaining process. You may use
another template if you choose. It must already exist in UrbanCode
Deploy.
- Run the createUCDObjects script to upload
one of the generated templates to Code Station.
Choose
the template for the cell or cluster for the application you want
to manage.
For full usage information, execute createUCDObjects with
no options.
The script attempts to do the following:,
- create a component if it does not exist
- create a new version for the component
- upload files to the new version. The directory for the files to
upload is specified by -ucdBaseTmplDir
The following command uses line breaks for readability. Do
not use them. If you are on a Windows system,
use createUCDObjects.bat.
./createUCDObjects.sh
-ucdBaseTmplDir /home/myuser/workspaces/rafw-head/user/templates/environments/<tmpl-name>
-ucdBin /home/myuser/udclient/udclient # use udclient.cmd on Windows
-ucdCompName App1Comp
-ucdPass admin
-ucdTempl redcellTempl
-ucdTmplVer 1.0
-ucdUrl https://myhost.mydomain.com:8443
-ucdUser admin
- Go to the application properties for your application.
- Go to .
- Click Configuration.
- Click Application Properties.
- Add a property for each token you created in the promote.properties when
you ran the genWASTemplate script. Be
sure to create a property for each token you specified. Creating
a property at this level automatically creates the property in each
environment for the application.
- In the Application Properties section,
click Add Property.
- Name the property websphere.keyname The keyname corresponds to the key name you
entered for the token. The websphere prefix is used
as a filter properties that are to be used for token replacement.
- Repeat for each token.
- Set the property values for each token-derived property
in each application environment. When you deploy the application,
the environment specifies different properties for the environment.
For
example, if you use a different JDBC resource in the QA environment
and Production environment for the application, you would do the following:
- Add a token when you run the genWASTemplate script,
for example myappjdbchost=foo.mycom.com.
- Run createUCDObjects script.
- Add a websphere.myappjdbchost property to the
application properties.
- Edit the environment properties for each environment to specify
the host to use for JDBC resources in that environment. The host is
specified as the value for property myappjdbchost.
- QA environment (example): myappjdbchost is set
to qa.mycom.com
- Production environment (example): myappjdbchost is
set to production.mycom.com
Use the following procedure to change the environment property
values in each environment.
- Go to .
- Click Environments.
- Click the environment name.
- Click the Configuration tab.
- Click Environment Properties in
the left panel.
- Scroll down to the Component Environment
Properties section. The tokens you created
appear as properties. Each key uses the default value you specified
for the token.
- Edit the property value. Specify the value
to be used in this environment.