Bookmark this page

Guided Exercise: Configuring Servers

Configure servers in a managed domain by using the JBoss EAP management command-line interface (CLI), and deploy applications on the managed domain.

Resources
Files /home/student/AD248/labs/domainconf-servers
Application URL NA

Outcomes

You should be able to configure and start a managed domain with two server groups and four servers and deploy applications on them.

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

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

The /home/student/AD248/labs/domainconf-servers 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 two server groups. In this exercise you create the servers.

Instructions

  1. Start the managed domain.

    1. Start the domain controller on the machine1 directory.

      Open a new terminal window and start the domain controller 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-servers/machine1/ \
      --host-config=host-master.xml
      ...output omitted...
      Host Controller] 03:31:21,696 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0062: Http management interface listening on http://172.25.250.9:9990/management and https://172.25.250.9:-1/management
      [Host Controller] 03:31:21,697 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0053: Admin console listening on http://172.25.250.9:9990 and https://172.25.250.9:-1
      [Host Controller] 03:31:21,732 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: JBoss EAP 7.4.11.GA (WildFly Core 15.0.26.Final-redhat-00001) (Host Controller) started in 3922ms - Started 80 of 81 services (22 services are lazy, passive or on-demand)
    2. Start the host controller on the machine2 directory.

      Open a new terminal window and start the machine2 host controller by using the host-slave.xml configuration file:

      [student@workstation ~]$ cd /opt/jboss-eap-7.4/bin
      [student@workstation bin]$ ./domain.sh \
      -Djboss.domain.base.dir=\
      /home/student/AD248/labs/domainconf-servers/machine2/ \
      --host-config=host-slave.xml \
      -Djboss.domain.master.address=172.25.250.9
    3. Inspect the output in the domain controller terminal window, and find the message about the host2 secondary controller connection:

      [Host Controller] 03:32:43,515 INFO  [org.jboss.as.domain.controller] (Host Controller Service Threads - 34) WFLYHC0019: Registered remote slave host "host2", JBoss JBoss EAP 7.4.11.GA (WildFly 15.0.26.Final-redhat-00001
    4. Start the host controller on the machine3 directory.

      Open a new terminal window and start the machine3 host controller by using the host-slave.xml configuration file:

      [student@workstation ~]$ cd /opt/jboss-eap-7.4/bin
      [student@workstation bin]$ ./domain.sh \
      -Djboss.domain.base.dir=\
      /home/student/AD248/labs/domainconf-servers/machine3/ \
      --host-config=host-slave.xml \
      -Djboss.domain.master.address=172.25.250.9
    5. Inspect the output in the domain controller terminal window, and find the message about the host3 secondary controller connection:

      [Host Controller] 03:35:16,767 INFO  [org.jboss.as.domain.controller] (Host Controller Service Threads - 34) WFLYHC0019: Registered remote slave host "host3", JBoss JBoss EAP 7.4.11.GA (WildFly 15.0.26.Final-redhat-00001)

      You have now started a managed domain with the domain controller running on machine1, and two host2 and host3 secondary host controllers.

  2. Access the management CLI and configure the servers.

    1. In a new terminal window on the workstation, start the management CLI and connect to the domain controller:

      [student@workstation ~]$ cd /opt/jboss-eap-7.4/bin
      [student@workstation bin]$ ./jboss-cli.sh --connect \
      --controller=172.25.250.9:9990
    2. Verify that Group1 and Group2 server groups exist. Run the following commands in the management CLI:

      [domain@172.25.250.9:9990 /] /server-group=Group1:read-resource
      {
          "outcome" => "success",
          "result" => {
      ...output omitted...
              "profile" => "default",
              "socket-binding-group" => "standard-sockets",
      ...output omitted...
          }
      }
      [domain@172.25.250.9:9990 /] /server-group=Group2:read-resource
      {
          "outcome" => "success",
          "result" => {
      ...output omitted...
              "profile" => "full",
              "socket-binding-group" => "full-sockets",
      ...output omitted...
          }
      }
    3. Define a server-one server on the host2 host with a port offset value of 100. Assign it to the Group1 server group.

      [domain@172.25.250.9:9990 /] /host=host2/server-config=server-one:add\
      (auto-start=true,group=Group1,socket-binding-port-offset=100)
      {
          "outcome" => "success",
          ...output omitted...
      }
    4. Define a server-two server on the host2 host with a port offset value of 200. Assign it to the Group2 server group.

      [domain@172.25.250.9:9990 /] /host=host2/server-config=server-two:add\
      (auto-start=true,group=Group2,socket-binding-port-offset=200)
      {
          "outcome" => "success",
          ...output omitted...
      }
    5. Define a server-three server on the host3 host with a port offset value of 300. Assign it to the Group1 server group.

      [domain@172.25.250.9:9990 /] /host=host3/server-config=server-three:add\
      (auto-start=true,group=Group1,socket-binding-port-offset=300)
      {
          "outcome" => "success",
          ...output omitted...
      }
    6. Define a server-four server on the host3 host with a port offset value of 400. Assign it to the Group2 server group.

      [domain@172.25.250.9:9990 /] /host=host3/server-config=server-four:add\
      (auto-start=true,group=Group2,socket-binding-port-offset=400)
      {
          "outcome" => "success",
          ...output omitted...
      }

      Note

      The auto-start property is set to true to ensure that the server starts up automatically when the host controller on which it is configured is started or restarted. If you do not want to start the server automatically, then set the property to false.

  3. Start the servers.

    1. Although you have defined and created the servers, they are not yet running. Start the servers in the managed domain.

      [domain@172.25.250.9:9990 /] /host=host2/server=server-one:start
      {
          "outcome" => "success",
          "result" => "STARTING"
      }

      Inspect the console window of machine2 and verify that server-one is starting up:

      ...output omitted...
      [Host Controller] 05:39:04,385 INFO  [org.jboss.as.host.controller] (Host Controller Service Threads - 15) WFLYHC0023: Starting server server-one
      05:39:04,523 INFO  [org.jboss.as.process.Server:server-one.status] (ProcessController-threads - 4) WFLYPC0018: Starting process 'Server:server-one'
      [Host Controller] 05:39:06,805 INFO  [org.jboss.as.host.controller] (management task-1) WFLYHC0021: Server [Server:server-one] connected using connection [Channel ID 7c02c775 (inbound) of Remoting connection 6de7abc7 to workstation.lab.example.com/172.25.250.9:46138 of endpoint "host2:MANAGEMENT" <5cc5e528>]
      [Host Controller] 05:39:06,872 INFO  [org.jboss.as.host.controller] (server-registration-threads - 1) WFLYHC0020: Registering server server-one
      
      ...output omitted...

      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.

    2. Verify that server-one is listening on the 8180 port, because you defined a port offset value of 100.

      Open a new browser window, and navigate to the http://172.25.250.9:8180 URL. The JBoss EAP welcome page shows.

    3. Start the server-two , server-three, and server-four instances, and verify that the HTTP listener is bound to the 8280, 8380, and 8480 ports respectively.

      [domain@172.25.250.9:9990 /] /host=host2/server=server-two:start
      {
          "outcome" => "success",
          "result" => "STARTING"
      }
      [domain@172.25.250.9:9990 /] /host=host3/server=server-three:start
      {
          "outcome" => "success",
          "result" => "STARTING"
      }
      [domain@172.25.250.9:9990 /] /host=host3/server=server-four:start
      {
          "outcome" => "success",
          "result" => "STARTING"
      }

      Note

      Instead of starting servers one by one, you can start all of the servers in a server group with one command:

      [domain@172.25.250.9:9990 /] /server-group=Group1:start-servers\
      (blocking=true)
      {
          "outcome" => "success",
          ...
      }
  4. Shut down of servers, server groups and host controllers

    1. Stop server-one by using the management CLI:

      [domain@172.25.250.9:9990 /] /host=host2/server=server-one:stop
      {
          "outcome" => "success",
          "result" => "STOPPING"
      }

      Verify that the HTTP listener is not accessible at http://172.25.250.9:8180/. The HTTP listeners should still be accessible at http://172.25.250.9:8380/ because server-three is still running.

    2. Stop server-three using the management CLI:

      [domain@172.25.250.9:9990 /] /host=host3/server=server-three:stop
      {
          "outcome" => "success",
          "result" => "STOPPING"
      }

      Verify that the HTTP listener is not accessible at the http://172.25.250.9.8380 URL.

    3. Stop all the servers in Group2 by using the management CLI:

      [domain@172.25.250.9:9990 /] /server-group=Group2:stop-servers
      {
          "outcome" => "success",
          "result" => undefined,
          "server-groups" => undefined
      }

      Verify that the HTTP listeners are not accessible at the http://172.25.250.9:8280/ and http://172.25.250.9:8480/ URLs because you have shut down the entire server group.

    4. Stop the host controllers on the machine2 and machine3 directories by using the management CLI. Shut down the machine2 host controller first:

      [domain@172.25.250.9:9990 /] /host=host2:shutdown
      {
          "outcome" => "success",
          "result" => undefined
      }

      Inspect the console window of machine2 and verify that the host controller has been shut down.

    5. Stop the host controller on machine3 by using the management CLI:

      [domain@172.25.250.9:9990 /] /host=host3:shutdown
      {
          "outcome" => "success",
          "result" => undefined
      }

      Inspect the console window of machine3 and verify that the host controller has been shut down.

  5. After all the host controllers are stopped, shut down the domain controller by pressing Ctrl+C. Alternatively, you can shut down the domain controller by using the management CLI as demonstrated in the previous step. Type exit to close the management CLI tool.

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-servers

Revision: ad248-7.4-18a9db2