In this tutorial we will show all the steps to configure a
JBOSS as Domain on one physical server (Machine).
Always perform this procedure first on the Domain
Controller, and then repeat it on each associated Host Controller and every
other host that belongs to the domain.
I am going to configure one Domain Controller (DC), two Host
Controllers (HCs), and the application servers on the same machine. Therefore,
the first step is to copy the configuration directory from $JBoss_HOME/domain/
to separate locations for each controller instance.
/u01/apps/JBoss81 à JBoss_HOME
Here, I have
created three directories under JBOSS_HOME and copied the configuration
directory from /JBOSS_HOME/domain/ into each of them as shown below.
/u01/apps/JBoss81/my-domain/slave1 à Slave01 (Secondary host)
/u01/apps/JBoss81/my-domain/slave2 à Slave02 (Secondary host)
/u01/apps/JBoss81/my-domain/master à Master - (Primary
host)
1.Configure
the Domain
a. Configure
the Domain Name as below in host.xml file.
|
<host xmlns="urn:jboss:domain:20.0" name="primary"> |
Now we can start the domain controller with the following command.
|
[jbossas@middleware bin]$ nohup /u01/apps/JBoss81/bin/domain.sh
--host-config=host.xml -Djboss.bind.address=127.0.0.1
-Djboss.bind.address.management=127.0.0.1
-Djboss.bind.address.public=127.0.0.1
-Djboss.bind.address.private=127.0.0.1 -Djboss.management.http.port=9990
-Djboss.domain.base.dir=/u01/apps/JBoss81/my-domain/master
-Djboss.domain.temp.dir=/tmp & |
Admin console listening on http://127.0.0.1:9990/console
2.
Configure the slave 1
a. Configure the Host Name in host.xml (This file located in /u01/apps/JBoss81/my-domain/slave1/configuration directory)
|
<host
xmlns="urn:jboss:domain:20.0" name="slave01"> |
b. Configure the Domain-controller definition as below in host.xml file.
|
<domain-controller>
<remote
authentication-context="secondary-hc-auth-context">
<discovery-options>
<static-discovery name="primary"
protocol="${jboss.domain.primary.protocol:remote+http}"
host="${jboss.domain.primary.address}"
port="${jboss.domain.primary.port:9990}"/>
</discovery-options>
</remote>
</domain-controller> |
c. Configure
the authentication-client under the Elytron subsystem in the host.xml file as
shown below
ex:
|
... <subsystem
xmlns="urn:wildfly:elytron:16.0"
final-providers="combined-providers"
disallowed-providers="OracleUcrypto">
<authentication-client> <!-- This line has
been added --> <authentication-configuration
name="secondary-hc-auth" authentication-name="secondary"
realm="ManagementRealm"
sasl-mechanism-selector="DIGEST-MD5"> <!-- This line has been added
--> <!-- In authentication-name give the name of the user which was
created using ./add-user.sh --> <credential-reference
clear-text="Pass12#"/>
<!-- This line has been added. Add the same password given while
adding user -->
</authentication-configuration> <!-- This line has
been added --> <authentication-context
name="secondary-hc-auth-context"> <!-- This line has been added --> <match-rule
authentication-configuration="secondary-hc-auth"/> <!-- This
line has been added -->
</authentication-context> <!-- This line
has been added --> </authentication-client> ... |
Now
we can start the Host controller (Slave 01)with the following command.
|
[jbossas@middleware bin]$ nohup /u01/apps/JBoss81/bin/domain.sh
--host-config=host.xml -Djboss.bind.address.management=127.0.0.1
-Djboss.bind.address=127.0.0.1 -Djboss.bind.address.private=127.0.0.1
-Djboss.management.http.port=9994 -Djboss.domain.primary.address=127.0.0.1
-Djboss.domain.primary.port=9990
-Djboss.domain.base.dir=/u01/apps/JBoss81/my-domain/slave1
-Djboss.domain.temp.dir=/tmp & |
during the slave starting time, some files/directories
created in slave home directory.
|
[bharath@middleware slave1]$ ls -ltr
/u01/apps/JBoss81/my-domain/slave1 total 4 drwxr-xr-x 3 bharath bharath 18 Feb 20 12:59 tmp drwxr-xr-x 2 bharath bharath 80 Feb 20 12:59 log drwxr-xr-x 5 bharath bharath 53 Feb 20 12:59 data drwxr-xr-x 6 bharath bharath 76 Feb 20 13:02 servers drwxr-xr-x 3 bharath bharath 4096 Feb 20 13:33
configuration [bharath@middleware slave1]$
|
3.
Configure slave02
a. Configure
the Host Name in host-.xml (This
file located in /u01/apps/JBoss81/my-domain/slave2/configuration directory)
|
<host xmlns="urn:jboss:domain:20.0" name="slave02"> |
b. Configure the Domain-controller definition
as below in host.xml file.
|
<domain-controller>
<remote
authentication-context="secondary-hc-auth-context">
<discovery-options>
<static-discovery name="primary"
protocol="${jboss.domain.primary.protocol:remote+http}"
host="${jboss.domain.primary.address}"
port="${jboss.domain.primary.port:9990}"/>
</discovery-options>
</remote>
</domain-controller> |
c. Configure the authentication-client
under the Elytron subsystem in the host.xml file as shown below
Now we can
start the Host controller (Slave 02)with the following command.
|
nohup /u01/apps/JBoss81/bin/domain.sh
--host-config=host.xml -Djboss.bind.address.management=127.0.0.1
-Djboss.bind.address=127.0.0.1 -Djboss.bind.address.private=127.0.0.1
-Djboss.management.http.port=9996 -Djboss.domain.primary.address=127.0.0.1
-Djboss.domain.primary.port=9990
-Djboss.domain.base.dir=/u01/apps/JBoss81/my-domain/slave2
-Djboss.domain.temp.dir=/tmp & |
Once slave02 successfully started, check in admin console either slave02 connected to master or not.
The Primary (Master) and Secondary (Slave) hosts have been started successfully and are now visible in the administration console.