Bookmark this page

Deploying Applications on a Managed Domain

Objectives

  • Identify the different options available for application deployment on an JBoss EAP managed domain.

Application Deployment on a Managed Domain

Deploying an application to a managed domain requires a different process from that used to deploy in standalone mode. You cannot select a specific server to deploy an application to. All applications must be deployed to a group, and all servers that belong to the specified group deploy that application. The host controller communicates with the domain controller and ensures that deployments are synchronized across all the servers in the managed domain that are part of the server group.

There are four ways to deploy an application when using the domain mode:

  • The management console

  • The management CLI tool

  • Maven

  • The HTTP management API

Deploying applications by using Maven and HTTP management API is out of the scope of this course. To learn more about these deployment methods, refer to the references section.

Unlike the standalone mode, it is not possible to deploy applications by using the deployment-scanner subsystem. The reason for this is that is not possible to guarantee that the application is available for the entire group.

Application Deployment Using the Management Console

Application deployment using the management console is a two-step process, where the enterprise application archive (EAR), web application archive (WAR), or Java application archive (JAR), is first uploaded to the content repository. From the content repository you can deploy the application to selected server groups in the managed domain. The content repository is a directory on the domain controller located at DOMAIN_BASE_DIR/domain/content, where DOMAIN_BASE_DIR is the base directory where the configuration files of the managed domain are.

Using the Content Repository menu, click the plus icon view the options.

Figure 5.14: JBoss EAP management console - empty content repository page

Three options are available:

Upload Content

Using this option, you can upload an application to be available in the repository. A reference to the application is created in the domain.xml file.

Add Unmanaged Deployment

Using this option, you specify a path where the application archive is available. The deployment content is not uploaded to the repository and it is deployed directly from the specified location.

Create Empty Deployment

Using this option, you can upload and modify files in a directory that represents an exploded deployment

Note

To deploy an application using the unmanaged method, the application archive needs to be available in the same path for all hosts. The unmanaged method exists for application that must be deployed as exploded directories instead of WAR, EAR, or JAR files.

When you use the Upload Content option, the wizard asks for the file to upload. Click Choose a file or drag it here to navigate to and select the required file.

You must define two options in the next step on the wizard:

Name

The identifier of the deployment. This must be a unique value across all deployments.

Runtime Name

Technical name in use within the instance runtime. The runtime name is equivalent to the WAR, JAR, or EAR file name, and is the base for module names. This name is usually the same that the Name field. You can use a different Name for two files with the same name. For example, you can have two versions of myapplication.war, but with different Name to reference its version: MyApplication1.0, and MyApplication1.5.

When the applications are present in the Content Repository, then you can deploy them to one or more server groups, by using the Deploy button.

Figure 5.15: Deploying content

A list of server groups to deploy to opens.

Another approach is to choose a server group from the Server Group section of the Deployments tab in the management console, and then select applications to deploy to this server group.

Figure 5.16: Adding a deployment to a server group

You can replace, deploy, undeploy, or download, applications from the content repository.

Figure 5.17: Undeploying an application from all server groups

Application Deployment by Using the Management CLI

Deploying applications using the JBoss EAP management CLI gives administrators the benefit of a command-line interface with the ability to create and run deployment scripts. You can use this scripting ability to configure specific application deployment and management scenarios. You can manage the deployments for an entire network of servers when running in a managed domain, from a single point of control.

The advantage of this approach is that the steps to deploy and manage the applications can be scripted as part of an automated work flow and it is faster to deploy multiple applications to a managed domain in batched mode.

The management CLI offers the deploy and undeploy commands in the default top level namespace for deploying and undeploying applications in a managed domain. One of the advantages of the management CLI approach is that an application can be deployed to all server groups by using a single command:

[domain@workstation:9990 /] deploy /path/to/example.war --all-server-groups

To deploy an application to specific server groups, provide a comma-separated list of server groups as arguments to the deploy command:

[domain@workstation:9990 /] deploy /path/to/example.war \
--server-groups=Group1,Group2,Group3

Undeploy an Application by Using the Management CLI

The undeploy command undeploys an application from the domain. To undeploy and remove the application from the entire domain, the name argument and the --all-relevant-server-groups option should be declared:

[domain@workstation:9990 /] undeploy myapp.war --all-relevant-server-groups

In the previous example, the application is also removed from the content repository. To keep the application in the repository, use the --keep-content argument:

[domain@workstation:9990 /] undeploy myapp.war --all-relevant-server-groups \
--keep-content

It is possible to specify only specific groups with the --server-groups argument:

[domain@workstation:9990 /] undeploy myapp.war --server-groups=main-server-group \
--keep-content

Note

If the application is assigned to two or more groups, the --keep-content argument is required because the application content cannot be removed.

References

For more information about deploying applications in domain mode by using the management console, refer to the Deploy an Application in a Managed Domain Using the Management Console section, in the Configuration Guide in the Red Hat JBoss EAP documentation at https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/configuration_guide/index#deploy_app_domain_console

For more information about deploying applications in domain mode by using the management CLI, refer to the Deploy an Application in a Managed Domain Using the Management CLI in the Configuration Guide in the Red Hat JBoss EAP documentation at https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/configuration_guide/index#deploy_app_managed_domain_cli

For more information about deploying applications in domain mode by using Maven, refer to the Deploying Applications Using Maven section, in the Configuration Guide in the Red Hat JBoss EAP documentation at https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/configuration_guide/index#deploying_apps_using_maven

For more information about deploying applications in domain mode by using the management HTTP API, refer to the Deploying Applications Using the HTTP API section, in the Configuration Guide in the Red Hat JBoss EAP documentation at https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/configuration_guide/index#deploying_apps_using_http_api

For more information about exploded deployments, refer to the Managing Exploded Deployments section, in the Configuration Guide in the Red Hat JBoss EAP documentation at https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/configuration_guide/index#managing_exploded_deployments

For more information about customizing the deployment behaviour, refer to the Customizing Deployment Behavior section, in the Configuration Guide in the Red Hat JBoss EAP documentation at https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/configuration_guide/index#customizing_deploy_behavior

https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.4/html-single/configuration_guide/index#customizing_deploy_behavior

Revision: ad248-7.4-18a9db2