Identify the different options available for application deployment on an JBoss EAP 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 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 menu, click the plus icon view the options.
Three options are available:
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.
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.
Using this option, you can upload and modify files in a directory that represents an exploded deployment
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 option, the wizard asks for the file to upload. Click to navigate to and select the required file.
You must define two options in the next step on the wizard:
The identifier of the deployment. This must be a unique value across all deployments.
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 , then you can deploy them to one or more server groups, by using the button.
A list of server groups to deploy to opens.
Another approach is to choose a server group from the section of the tab in the management console, and then select applications to deploy to this server group.
You can replace, deploy, undeploy, or download, applications from the content repository.
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-groupsTo 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
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-groupsIn 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
If the application is assigned to two or more groups, the --keep-content
argument is required because the application content cannot be removed.
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