Creating an environment involves selecting one or more
agent resources and specifying which components are deployed to each
agent resource.
Procedure
- 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:
Table 1. Properties for the environment
| Property |
Description |
Example |
tomcat.home |
The Tomcat home folder on the target computer |
/opt/apache-tomcat-9.0.100 on Linux® or
C:\apache-tomcat-9.0.100 on
Windows |
tomcat.contextroot |
The Tomcat webapp folder on the target computer, which is an identifier in the
application URL |
For all versions of Tomcat, specify JPetStoreDev |
db.url |
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:
jdbc:mysql://host-or-ip:3306/jpetstore |
tomcat.manager.url |
The location of the Tomcat manager application |
For Tomcat version 9, specify
http://host-or-ip:8081/manager/text |
tomcat.start |
The location of the startup script for Tomcat |
/opt/apache-tomcat-9.0.100/bin/startup.sh on Linux or
C:\apache-tomcat-9.0.100\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 .
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:
Results
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.