Bookmark this page

Guided Exercise: Assigning a Domain Controller

Assign the domain controller and start it from the workstation machine.

Resources
Files: /home/student/AD248/labs/domain-assigning
Application URL: http://172.25.250.9:9990

Outcomes

You should be able to start a domain controller from the workstation VM.

Before beginning the guided exercise, run the following command to prepare the environment, and to download the files for the exercise:

[student@workstation ~]$ lab start domain-assigning

Instructions

  1. Create a new domain base directory in the workstation machine.

    Create the machine1/domain directory at /home/student/AD248/labs/domain-assigning/, and copy the /opt/jboss-eap-7.4/domain/configuration into it.

    [student@workstation ~]$ cd /home/student/AD248/labs/domain-assigning
    [student@workstation domain-assigning]$ mkdir -p machine1/domain
    [student@workstation domain-assigning]$ cp -r \
    /opt/jboss-eap-7.4/domain/configuration \
    machine1/domain/

    Note

    In this exercise you are going to have a domain controller and two host controllers running on your student workstation. In real scenarios, you run these three controllers on separate machines. You are going to simulate separate machines by using subdirectories named machine1, machine2, and machine3.

    In this lab, machine1 acts as the primary controller. In the next lab, you create and configure machine2 and machine3 as secondary controllers connecting to machine1.

  2. Configure files in machine1 for a domain controller.

    1. Using the editor of your choice, open the host-master.xml file in the /home/student/AD248/labs/domain-assigning/machine1/domain/configuration directory. This host configuration file configures a domain controller that does not manage any local servers.

    2. Look at the following line at the beginning of the host-master.xml file:

      <host xmlns="urn:jboss:domain:16.0" name="master">

      Observe that this line configures the name of this host to be master.

    3. Notice there is only one interface defined in host-master.xml, the management interface.

      ...
          <interfaces>
              <interface name="management">
                  <inet-address value="${jboss.bind.address.management:127.0.0.1}"/>
              </interface>
          </interfaces>
      
      ...

      It is assumed that the host machine running the domain controller is not hosting servers; consequently it does not need to define a public network interface for the server instances to accept user requests.

    4. Any secondary controller must be configured to point to the IP address of the domain controller.

    5. The labs are going to simulate multiple machines, and the domain controller on the machine1 directory must use an IP from a public interface to be visible to the other machines.

      We could specify the jboss.bind.address.management property for the startup script, but instead, manually edit the XML file. Modify the management interface inet-address attribute to bind to the IP address of your workstation machine: (172.25.250.9). The <interfaces> section of host-master.xml should appear as follows:

      <interfaces>
          <interface name="management">
              <inet-address value="${jboss.bind.address.management:172.25.250.9}"/>
          </interface>
      </interfaces>
    6. Save your changes to host-master.xml and close the text editor.

  3. Start the domain controller on the workstation machine.

    1. In your terminal window, change to the /opt/jboss-eap-7.4/bin directory:

      [student@workstation domain-assigning]$ cd /opt/jboss-eap-7.4/bin
    2. To start the master host controller using the host-master.xml file in your /home/student/AD248/labs/domain-assigning/machine1/domain/ directory, enter the following command:

      [student@workstation bin]$ ./domain.sh -Djboss.domain.base.dir=\
      /home/student/AD248/labs/domain-assigning/machine1/domain/ \
      --host-config=host-master.xml

      Because you are starting a domain controller with no application server instances attached, it should start quickly. Look for the following output to confirm that the domain controller is running:

      ...output omitted...
      [Host Controller] 04:55:48,601 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] 04:55:48,602 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
      ...output omitted...

      Note

      This host controller instance is not using the default host.xml configuration tile, so the --host-config option is necessary. The --domain-config option is not needed because it is using the default domain.xml managed domain configuration file.

  4. Verify that the domain controller is running.

    1. Open a web browser in the workstation machine, and point the browser to http://172.25.250.9:9990/ to access the JBoss EAP management console from the domain controller. Use admin as the username, and redhat123 as the password

  5. Explore the management console in domain mode.

    1. Click Runtime. Then, in the Browse By column, click the Hosts category. Finally, in the Host column, click master. As there are no servers running, and you have not defined and started any yet, the Runtime section only has information about the host.

    2. Click the Configuration page, and then click Profiles. You can inspect some of the details of the profiles when you have a standalone server running.

      Note

      Recall that in a managed domain you can have multiple profiles defined, and each profile has a unique name. Contrast this to running JBoss EAP as a standalone server, where there is a single anonymous profile.

  6. Stop the domain controller by pressing Ctrl+C in the terminal window.

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 domain-assigning

Revision: ad248-7.4-18a9db2