Lesson 3: Creating an application and an environment#
Applications are collections of components. Environments represent systems on which you deploy the application components.
Before you start this lesson, ensure that your agent is running. Click Resources > Agents and make sure that your agent is listed as
Online, as in the following figure:
In this lesson, you add the three components to an application and then create an environment on which to deploy the application. You also add your agent to the environment.
Parent topic: Deploying a simple web application
Creating an application#
Creating an application involves selecting the components that are in the application.
Click the Applications tab, and then click Create Application.
Name the new application
JPetStore, and then click Save.
Add the components to the application:
Click the Applications tab, and then click the new application,
Click the Components tab for the application (not the Components tab at the top of the page), and then click Add Component.
In the Add a Component window, in the Select a Component list, select the three components:
The application includes the three components, as shown in the following figure. Components can be included in any number of applications.
Creating an environment#
Creating an environment involves selecting one or more agent resources and specifying which components are deployed to each agent resource.
Define an environment for the application:
Go to the Environments tab for the application.
Click Create Environment.
Specify the name to be Tutorial environment 1.
Accept the defaults in the other fields in this window and click Save.
Specify the properties for the environment.
When you created the component processes, you included parameters that specify the location of artifacts on the target system, such as the location of the application server. Because these properties can vary on different target systems, you specify these properties as environment properties.
Open the environment by clicking the environment name.
Open the environment properties by clicking Configuration and then clicking Environment Properties.
Add the following properties one at a time by clicking Add Property and specifying the name and value of the property as shown in the following table:
Property Description Example
The Tomcat home folder on the target computer /opt/apache-tomcat-6.0.39 on Linux™ or C:\apache-tomcat-6.0.39 on Windows™
The Tomcat webapp folder on the target computer, which is an identifier in the application URL For all versions of Tomcat, specify
The URL to the MySQL database, relative to the target system If you installed MySQL on the same system as the agent and used the database name
jpetstore, the URL looks like the following example:
The location of the Tomcat manager application For Tomcat version 6, specify
http://host-or-ip:8081/manager; for Tomcat version 7 or 8, specify
The location of the startup script for Tomcat /opt/apache-tomcat-6.0.39/bin/startup.sh on Linux or C:\apache-tomcat-6.0.39\bin\startup.bat on Windows
Add the agent to the environment.
When you set up the agent, you added the agent as a resource to a resource group. Now you can use that resource as part of the environment, as described in the following steps:
Click the Resources tab for the environment.
Make sure that you are on the Resources tab for the environment and not the Resources tab at the top of the page.
Click Add Base Resources.
The Add Resource to Environment window shows all of the resources that are available on the server.
Select the check box next to your agent and then click OK.
The resource is shown on the Resources tab for the environment, as shown in the following figure:
Map the components to this agent resource.
If you had many agents on a system with multiple nodes, you would specify which components run on each agent resource. In this case, you have only one agent resource, so all of the components run on this agent.
On the same row as the agent resource, click Actions > Add Component.
The Actions button does not appear until you hover the mouse over the resource.
Select the application component and then click Save.
Repeat the process to add the other components to the resource.
Note: Be sure to add each component to the agent resource and not to another component. The components must be at the same hierarchy level, and not as child items of each other.
Now the components are mapped to the target system, as shown in the following figure:
The new environment appears on the Environments tab. Now that the environment is prepared and the agent is running, you can run application processes on the environment to deploy the components.