Bookmark this page

Guided Exercise: Deployment on a Managed Domain

Deploy applications on the managed domain.

Resources
Files:

/home/student/AD248/labs/domainconf-deployment/greeter.war

/home/student/AD248/labs/domainconf-deployment/temperature-converter.war

/home/student/AD248/labs/domainconf-deployment

Outcomes

You should be able to deploy applications on a managed domain.

Before beginning the guided exercise, run the following command to prepare the environment:

[student@workstation ~]$ lab start domainconf-deployment

The /home/student/AD248/labs/domainconf-deployment directory contains a configured Red Hat JBoss Enterprise Application Platform (JBoss EAP) domain controller in the machine1 subdirectory. The machine2, and machine3 subdirectories simulate two secondary host controllers. This JBoss EAP managed domain contains the following elements:

  • The Group1 and Group2 server groups

  • Four servers that use 100, 200, 300, and 400, as port offset: server-one, server-two, server-three, and server-four

In this exercise you deploy applications to both server groups.

Instructions

  1. Start the domain and hosts controllers on the workstation machine.

    1. Use the following commands to start the domain controller:

      [student@workstation ~]$ cd /opt/jboss-eap-7.4/bin
      [student@workstation bin]$ ./domain.sh \
      -Djboss.domain.base.dir=\
      /home/student/AD248/labs/domainconf-deployment/machine1/ \
      --host-config=host-master.xml
    2. Open a new terminal window and start the host2 host controller by using the following commands:

      [student@workstation ~]$ cd /opt/jboss-eap-7.4/bin
      [student@workstation bin]$ ./domain.sh \
      -Djboss.domain.base.dir=\
      /home/student/AD248/labs/domainconf-deployment/machine2/ \
      --host-config=host-slave.xml \
      -Djboss.domain.master.address=172.25.250.9

      Note

      You can safely ignore the following output:

      WARNING: An illegal reflective access operation has occurred
      WARNING: Illegal reflective access by org.wildfly.extension.elytron.SSLDefinitions (jar:file:/opt/jboss-eap-7.4/modules/system/layers/base/.overlays/layer-base-jboss-eap-7.4.11.CP/org/wildfly/extension/elytron/main/wildfly-elytron-integration-15.0.26.Final-redhat-00001.jar!/) to method com.sun.net.ssl.internal.ssl.Provider.isFIPS()
      WARNING: Please consider reporting this to the maintainers of org.wildfly.extension.elytron.SSLDefinitions
      WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
      WARNING: All illegal access operations will be denied in a future release

      Refer to https://access.redhat.com/solutions/4996491.

    3. Open a new terminal window and start the host3 host controller by using the following commands:

      [student@workstation ~]$ cd /opt/jboss-eap-7.4/bin
      [student@workstation bin]$ ./domain.sh \
      -Djboss.domain.base.dir=\
      /home/student/AD248/labs/domainconf-deployment/machine3/ \
      --host-config=host-slave.xml \
      -Djboss.domain.master.address=172.25.250.9

      Wait for the domain controller and the two host controllers to start before proceeding.

  2. Deploy an application to the Group1 server group.

    1. On the workstation machine, open the management console by pointing a web browser to 172.25.250.9:9990. Use admin as the username, and redhat123 as the password.

    2. Click Deployments at the top of the page and then click Content Repository in the first column.

    3. Click the plus icon button, and select Upload Content. Then, click Choose a file or drag it here and select the /home/student/AD248/labs/domainconf-deployments/greeter.war file. Click Next.

    4. On the Specify Names step, leave the Name and Runtime Name as greeter.war, and then click Finish.

    5. Click View Content and then click greeter.war in the second column. Then, click the dropdown menu next to View, and select the Deploy option.

    6. Select Group1 to deploy greeter.war to the Group1 server group. Click Deploy:

  3. Verify the Deployment

    1. Navigate to server-one at http://172.25.250.9:8180/greeter/ and server-three at http://172.25.250.9:8380/greeter/ . The greeter application initial page is displayed.

    2. Navigate to server-two at http://172.25.250.9:8280/greeter/ and server-four at http://172.25.250.9:8480/greeter/ . A 404 HTTP error is displayed, because the greeter application is not deployed on Group2 server group.

    3. Open the /home/student/AD248/labs/domainconf-deployment/machine1/configuration/domain.xml file. Notice that greeter.war displays as an available deployment in the <deployments> section. Also notice that greeter.war is displayed in the <deployments> section of the Group1 in the <server-group> section.

  4. Deploy an application to the Group2 server group.

    1. Go back to the Deployments page of the management console of your domain. Click Content Repository. Then click the plus icon and select Upload Content.

    2. Click Choose a file or drag it here and select the /home/student/AD248/labs/domainconf-deployments/temperature-converter.war file. Click Next.

    3. On the Specify Names step, leave the Name and Runtime Name as temperature-converter.war, and then click Finish.

    4. Click View Content and then click temperature-converter.war in the second column. Then, click the dropdown menu next to View, and select the Deploy option.

    5. Select Group2 to deploy temperature-converter.war to the Group2 server group. Then click Deploy.

  5. Verify the Deployment.

    1. Navigate to server-two at http://172.25.250.9:8280/temperature-converter/ and server-four at http://172.25.250.9:8480/temperature-converter/. The temperature converter application initial page is displayed.

    2. Navigate to server-one at http://172.25.250.9:8180/temperature-converter/ and server-three at http://172.25.250.9:8380/temperature-converter/ . A 404 HTTP error is displayed.

  6. Undeploy the applications.

    1. In the management console navigate to the Deployments page.

    2. Click the Server Groups tab in the first column.

    3. Notice the deployed applications are listed by server group.

    4. Click Group1 in the Server Groups column.

    5. Click greeter.war in the list of Deployments, click the arrow next to View and select Disable to disable the application.

    6. Navigate to the greeter.war application on server-one at http://172.25.250.9:8180/greeter/, and verify that you now get a 404 error.

    7. Click the same arrow in the Deployment column and select Remove. The deployment is no longer deployed to the Group1 server group, although it is still in the domain content repository.

    8. Follow the same steps to disable and remove temperature-converter.war from the Group2 server group. To verify, try navigating to http://172.25.250.9:8280/temperature-converter/ for server-two and to http://172.25.250.9:8480/temperature-converter/ for server-four. You get 404 errors.

  7. Remove Deployments from the managed domain content repository.

    1. Click Content Repository in the Deployments page.

    2. Select greeter.war in the Content Repository list, and click the arrow next to greeter.war. Select Remove. Click Yes when the confirmation window is displayed.

    3. Similarly, remove temperature-converter.war from the Content Repository.

  8. Press Ctrl+C in each terminal window to stop the domain controller and the two host controllers.

Finish

On the workstation machine, use the lab command to complete this exercise. This step is important to ensure that resources from previous exercises do not impact upcoming exercises.

[student@workstation ~]$ lab finish domainconf-deployment

Revision: ad248-7.4-18a9db2