Create a managed domain.
| Resources | |
|---|---|
| Files |
/opt/domain
|
| Application URL | 172.25.250.10:8080 - 172.25.250.11:8080 - 172.25.250.9:9990 |
| Resources | N/A |
Outcomes
You should be able to start a domain controller on the workstation and run a host controller in the serverA, and serverB machines.
The final solution must be in line with the following architecture with regards to the host controller and the domain controller.
You configure the servers in later labs:
![]() |
In this lab, you create a managed domain comprised of a domain controller on the workstation, a host controller on server A and a host controller on server B.
Verify that you can access servera by running the following command from a terminal window in the workstation:
[student@workstation ~]$ ssh servera hostname
servera
Verify that you can access serverb by running the following command from a terminal window in the workstation:
[student@workstation ~]$ ssh serverb hostname
serverb
Use the following command to download the relevant lab directory, and prepare the environment:
[student@workstation ~]$ lab start domain-review
Instructions
Create the domain controller by copying files from /opt/jboss-eap-7.4/domain into the /opt/domain directory on the workstation machine.
Set the /opt/domain owner to the jboss user.
Run the following command to copy the JBoss EAP domain configuration to the /opt/domain directory on the workstation machine.
[student@workstation ~]$ sudo cp -r /opt/jboss-eap-7.4/domain /opt/Use the following command to set the directory owner as user jboss:
[student@workstation ~]$ sudo chown -R jboss:jboss /opt/domainThe JBoss EAP instance in workstation is the domain controller, and exposes the management interface to an internal network.
The internal network is 172.25.250.X.
Other network interfaces should not be exposed to guarantee that external host controllers cannot get sensitive information from the domain controller.
Update the address of the management interface for the domain controller to point to the 172.25.250.9 workstation IP address.
You must use the host-master.xml configuration file.
Open the /opt/domain/configuration/host-master.xml file with a text editor using jboss as user.
[student@workstation ~]$ sudo -u jboss vim \
/opt/domain/configuration/host-master.xmlModify the interface sections of the configuration file as follows:
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:172.25.250.9}"/>
</interface>
</interfaces>Save your changes and exit the editor.
Start the domain controller on the workstation by using /opt/domain as the base directory, and host-master.xml as the host configuration file.
In your terminal window, change to the /opt/jboss-eap-7.4/bin directory:
[student@workstation ~]$ cd /opt/jboss-eap-7.4/binTo start the domain controller by using the host-master.xml file in your /opt/domain/ directory, use the following command:
[student@workstation bin]$sudo -u jboss ./domain.sh \-Djboss.domain.base.dir=/opt/domain/ \--host-config=host-master.xml
Review and find the following output to confirm that the domain controller is running:
[Host Controller] 06:31:48,034 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] 06:31:48,034 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] 06:31:48,065 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 3490ms - Started 80 of 81 services (22 services are lazy, passive or on-demand)Open a new terminal on the workstation machine, and access the server A machine by using the ssh command:
[student@workstation bin]$ ssh serveraThere is an instance of JBoss EAP onto both servera and serverb.
Copy the files from /opt/jboss-eap-7.4/domain into the lab directory at /opt/domain on server A and set the jboss user as the owner.
Set servera as the host controller name.
Update the address of the management interface for the host controller to point to the 172.25.250.10
server A IP address.
The domain controller contains a servera management user for remote connection of the secondary host controller.
The password is redhat123, and its hashed value is cmVkaGF0MTIz.
You must use the host-slave.xml configuration file.
Open the /opt/domain/configuration/host-slave.xml file on server A with a text editor by using jboss as the user, and update the name of the host controller to servera by adding the name property to the <host> tag:
<host name="servera" xmlns="urn:jboss:domain:16.0">Set the host controller server identity to use the cmVkaGF0MTIz value:
<host name="servera" xmlns="urn:jboss:domain:16.0">
...ouput omitted...
<management>
<security-realms>
<security-realm name="ManagementRealm">
<server-identities>
<secret value="cmVkaGF0MTIz"/>
</server-identities>
...ouput omitted...Update the public IP address as follows:
<interface name="public">
<inet-address value="${jboss.bind.address:172.25.250.10}"/>
</interface>Update the management IP address as follows:
<interface name="management">
<inet-address value="${jboss.bind.address.management:172.25.250.10}"/>
</interface>Save the file and exit the editor.
Start the host controller on server A with the configuration file /opt/domain/configuration/host-slave.xml and point to the domain controller running on 172.25.250.9.
Run the following command to start the host controller and connect to the domain controller:
[student@servera ~]$cd /opt/jboss-eap-7.4/bin[student@servera bin]$sudo -u jboss ./domain.sh \-Djboss.domain.base.dir=/opt/domain/ \--host-config=host-slave.xml \-Djboss.domain.master.address=172.25.250.9
Look in the terminal window of the host controller on servera.
Review the log output.
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
There are log entries referring to the host controller connecting to the master, and also server-one and server-two starting up.
[Host Controller] 09:16:11,527 INFO [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0148: Connected to master host controller at remote+http://172.25.250.9:9990 [Host Controller] 09:16:11,645 INFO [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0023: Starting server server-one
Look in the terminal window of the domain controller running on the workstation.
You should see a log entry showing the secondary controller connecting:
[Host Controller] 09:16:12,097 INFO [org.jboss.as.domain.controller] (Host Controller Service Threads - 31) WFLYHC0019: Registered remote slave host "servera", JBoss JBoss EAP 7.4.11.GA (WildFly 15.0.26.Final-redhat-00001)
Access the server B machine by using the ssh command:
[student@workstation bin]$ ssh serverbCopy the files from /opt/jboss-eap-7.4/domain into the lab directory at /opt/domain on server B and set the jboss user as the owner.
Set the name of the host controller to serverb.
Update the address of the management interface for the host controller to point to the 172.25.250.11
server B IP address by using the host-slave.xml configuration file.
The domain controller contains a serverb management user for remote connection of the secondary host controller.
The password is redhat123, and its hashed value is cmVkaGF0MTIz.
When you finish the secondary controllers configuration, delete existing servers, and configure a server-three server in the other-server-group server group, with no port offset.
Open the file /opt/domain/configuration/host-slave.xml on server B with a text editor as the jboss user.
Update the name of the host controller to serverb by adding the name property to the <host> tag:
<host name="serverb" xmlns="urn:jboss:domain:4.1">Set the host controller server identity to use the cmVkaGF0MTIz value:
<host name="serverb" xmlns="urn:jboss:domain:16.0">
...ouput omitted...
<management>
<security-realms>
<security-realm name="ManagementRealm">
<server-identities>
<secret value="cmVkaGF0MTIz"/>
</server-identities>
...ouput omitted...Update the public IP address as follows:
<interface name="public">
<inet-address value="${jboss.bind.address:172.25.250.11}"/>
</interface>Update the management IP address as follows:
<interface name="management">
<inet-address value="${jboss.bind.address.management:172.25.250.11}"/>
</interface>Delete the existing servers, and add a new server-three server.
Update the servers tag to match the following:
<servers>
<server name="server-three" group="other-server-group"/>
</servers>Save the file and exit the editor.
Start the host controller on server B by using the configuration file /opt/domain/configuration/host-slave.xml and point to the domain controller running on 172.25.250.9.
Run the following command to start the host controller and connect to the domain controller:
[student@serverb ~]$cd /opt/jboss-eap-7.4/bin[student@serverb bin]$sudo -u jboss ./domain.sh \-Djboss.domain.base.dir=/opt/domain/ \--host-config=host-slave.xml \-Djboss.domain.master.address=172.25.250.9
Inspect the serverb terminal window.
Review the log output and find the messages related to the host controller connecting to the domain controller.
Find also the messages related to the server-three starting up.
...output omitted... [Host Controller] 03:50:35,464 INFO [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0148:Connected to master host controller at remote+http://172.25.250.9:9990[Host Controller] 03:50:35,549 INFO [org.jboss.as.host.controller] (Controller Boot Thread) WFLYHC0023:Starting server server-three...output omitted...
Inspect the domain controller terminal window running on the workstation machine.
Find a log entry showing the secondary controller connecting:
[Host Controller] 03:50:36,531 INFO [org.jboss.as.domain.controller] (Host Controller Service Threads - 32) WFLYHC0019: Registered remote slave host "serverb", JBoss JBoss EAP 7.4.11.GA (WildFly 15.0.26.Final-redhat-00001)
On the workstation machine, open a web browser and navigate to 172.25.250.9:9990 to access the JBoss EAP domain management console.
Use admin as the username, and redhat123 as the password.
Verify that both hosts show under the section.
Stop and remove all the three servers: server-one, server-two, and server-three.
Use the management CLI to stop and remove the servers.
In a new terminal on the workstation machine, connect to the JBoss EAP management CLI for the domain controller:
[student@workstation bin]$sudo -u jboss /opt/jboss-eap-7.4/bin/jboss-cli.sh \--connect --controller=172.25.250.9:9990
Use the following command to stop all servers in the managed domain. The servers must be stopped before removing them:
[domain@172.25.250.9:9990] :stop-serversAfter the servers are all stopped, use the following command to remove server-one from the servera host controller:
[domain@172.25.250.9:9990] /host=servera/server-config=server-one:removeRun the command to remove server-two on servera:
[domain@172.25.250.9:9990] /host=servera/server-config=server-two:removeRun the command to remove server-three on serverb:
[domain@172.25.250.9:9990] /host=serverb/server-config=server-three:removeRemove all the server groups and exit the JBoss EAP management CLI.
Run the following command to remove main-server-group on workstation with the management CLI:
[domain@172.25.250.9:9990] /server-group=main-server-group:removeRun the following command to remove other-server-group on workstation with the management CLI:
[domain@172.25.250.9:9990] /server-group=other-server-group:removeExit the management CLI.
Press Ctrl+C to stop the domain controller on workstation
and the two host controllers on servera and serverb.
Then, run the following command to grade the exercise:
[student@workstation bin]$ lab grade domain-review