Domain mode feature of JBoss allows to manage multiple server instances from a single control point. The server configuration of the domain is centralized in the domain.xml file of the domain controller. The domain.xml is located at domain/configuration/. It includes the main configuration for all server instances. This file is only required for the domain controller.
In the domain.xml file, this file will use to define the server group configuration (which can be anyway changed at runtime). All the server groups which we will create or already created that will be define here.
In the domain.xml file, this file will use to define the server group configuration (which can be anyway changed at runtime). All the server groups which we will create or already created that will be define here.
<server-groups>
<server-group
name="main-server-group" profile="full">
<jvm
name="default">
<heap
size="64m" max-size="512m"/>
</jvm>
<socket-binding-group ref="full-sockets"/>
</server-group>
<server-group
name="other-server-group" profile="full-ha">
<jvm
name="default">
<heap
size="64m" max-size="512m"/>
</jvm>
<socket-binding-group ref="full-ha-sockets"/>
</server-group>
</server-groups>
|
As you can see, we have two server groups: main-server-group and other-server-group. You can in turn associate each server group with a different profile.
The default configuration includes four preconfigured profiles:
The default configuration includes four preconfigured profiles:
- default - Support of Java EE Web-Profile plus some extensions like RESTFul Web Services or support for EJB3 remote invocations
- full - Support of Java EE Full-Profile and all server capabilities without clustering
- ha - default profile with clustering capabilities
- full-ha - full profile with clustering capabilities
<interfaces> <interface
name="management"/> <interface
name="public"/> <interface
name="unsecure"/> </interfaces> |
We are using “wildfly-11.0.0.Final” for this example setup. The domain controller needs both the domain.xml and host.xml configured. In the $WF_HOME/domain/configuration directory, you'll see that those two files are joined by a host-master.xml and a host-slave.xml. These are pre-configured host.xml files which you can use to give you a head start in making a host.xml for the domain controller (master) and host controller (slave) to use.
We will use two machines:
The "DomMaster" (192.168.1.10) box, which will run the Domain Controller, hereafter called the DC. A "DomeSlave" (192.168.1.11), which will run a Host Controller, hereafter called the HC1. You can use multiple slaves with each an HC. The principle stays the same. But in following steps we use on slave:
Step 1) Unzip wildfly-11.0.0.Final.zip on the DC (IP eg. - 192.168.1.10), for example to /opt/wildfly-11.0.0.Final-Master
Step 2) Unzip wildfly-11.0.0.Final.zip on HC1 (IP eg. - 192.168.1.11), for example to /opt/wildfly-11.0.0.Final-Slave
Step 3) On the DC, edit /opt/wildfly-11.0.0.Final-Master/domain/configuration/host.xml and set its host name as follows: (the name should be unique in the whole domain)
<?xml version='1.0'
encoding='UTF-8'?>
<host
xmlns="urn:jboss:domain:5.0"
name="DomMaster">
<extensions>
|
<?xml version='1.0'
encoding='UTF-8'?>
<host
xmlns="urn:jboss:domain:5.0"
name="DomSlave">
<extensions>
|
Step 5) On HC1, edit /opt/wildfly-11.0.0.Final-Slave/domain/configuration/host.xml and tell the DomSlave (HC1) where the DC is - here we need to use the actual hostname of the DC or IP address (192.168.1.10).
Change your <domain-controller> tag
Change your <domain-controller> tag
<domain-controller>
<local/>
<!--
Alternative remote domain controller configuration with a host and
port -->
<!-- <remote
protocol="remote" host="${jboss.domain.master.address}"
port="${jboss.domain.master.port:9999}"
security-realm="ManagementRealm"/> -->
</domain-controller>
|
with like this.
<domain-controller>
<remote
host="${jboss.domain.master.address:192.168.1.10}"
port="${jboss.domain.master.port:9999}"
security-realm="ManagementRealm"
username=”dcadmin”/>
</domain-controller>
|
Step 6) Now on the DC you will need to create a user, for each HC ( DomSlave in our scenario) you want to use, in the ManagementRealm. So in our scenario, create a user “dcadmin” for DomeSlave as we defined in <host name="DomSlave" ...>
Use the following script on the DC: /opt/wildfly-11.0.0.Final-Master/bin/add-user.sh
$./add-user.sh
What type of user do you
wish to add?
a) Management User
(mgmt-users.properties)
b) Application User
(application-users.properties)
(a): a
Enter the details of the
new user to add.
Using realm
'ManagementRealm' as discovered from the existing property files.
Username : DCAdmin
Password recommendations
are listed below. To modify these restrictions edit the
add-user.properties configuration file.
- The password should be
different from the username
- The password should
not be one of the following restricted values {root, admin,
administrator}
- The password should
contain at least 8 characters, 1 alphabetic character(s), 1
digit(s), 1 non-alphanumeric symbol(s)
Password :
Re-enter Password :
What groups do you want
this user to belong to? (Please enter a comma separated list, or
leave blank for none)[ ]:
About to add user
'DCAdmin' for realm 'ManagementRealm'
Is this correct yes/no?
yes
Added user 'DCAdmin' to
file
'/opt/wildfly-11.0.0.Final/standalone/configuration/mgmt-users.properties'
Added user 'DCAdmin' to
file
'/opt/wildfly-11.0.0.Final/domain/configuration/mgmt-users.properties'
Added user 'DCAdmin' with
groups to file
'/opt/wildfly-11.0.0.Final/standalone/configuration/mgmt-groups.properties'
Added user 'DCAdmin' with
groups to file
'/opt/wildfly-11.0.0.Final/domain/configuration/mgmt-groups.properties'
Is this new user going to
be used for one AS process to connect to another AS process?
e.g. for a slave host
controller connecting to the master or for a Remoting connection
for server to server EJB calls.
yes/no? yes
To represent the user add
the following to the server-identities definition <secret
value="cmVkaGF0QDEyMw==" />
|
<?xml version='1.0'
encoding='UTF-8'?>
<host
xmlns="urn:jboss:domain:5.0"
name="DomSlave">
<extensions>
<extension
module="org.jboss.as.jmx"/>
<extension
module="org.wildfly.extension.core-management"/>
<extension
module="org.wildfly.extension.elytron"/>
</extensions>
<management>
<security-realms>
<security-realm name="ManagementRealm">
<server-identities>
<secret
value="cmVkaGF0QDEyMw==" />
</server-identities>
<authentication>
|
Step 8) Start the DC with the script in /opt/wildfly-11.0.0.Final-Master/bin as below. Make sure that there are no firewall restrictions so that 192.168.1.10:9999 is accessible from remote HC ( DomSlave in our scenario) .
$./domain.sh
-Djboss.bind.address.management=192.168.1.10
|
Step 9) Start the HC1 (IP - 192.168.1.11) with the script in /opt/wildfly-11.0.0.Final-Slave/bin as below:
$./domain.sh
-b 192.168.1.11
|
Step 10) Now you can see HC1 (DomSlave) Registered with the DC (DomMaster).
[Host Controller]
12:43:07,738 INFO [org.jboss.as] (Controller Boot Thread)
WFLYSRV0025: WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
(Host Controller) started in 7304ms - Started 77 of 79 services
(23 services are lazy, passive or on-demand)
[Host Controller]
12:43:18,190 INFO [org.jboss.as.domain.controller] (Host
Controller Service Threads - 32) WFLYHC0019: Registered remote
slave host "DomSlave",
JBoss WildFly Full 11.0.0.Final (WildFly 3.0.8.Final)
|
Comments
Post a Comment