Here are some of the basic concepts of running in domain mode.
domain controller::
The domain controller is a process that is responsible for storing, managing, and publishing the general configuration
for each node in the cluster. This process is the central point from which nodes in a cluster obtain their configuration.
host controller::
The host controller is responsible for managing server instances on a specific machine. You configure it to run
one or more server instances. The domain controller can also interact with the host controllers on each machine to
manage the cluster. To reduce the number of running process, a domain controller also acts as a host controller on
the machine it runs on.
domain profile::
A domain profile is a named set of configuration that can be used by a server to boot from. A domain controller
can define multiple domain profiles that are consumed by different servers.
server group::
A server group is a collection of servers. They are managed and configured as one. You can assign a domain profile to a server group and every service in that
group will use that domain profile as their configuration.
In domain mode, a domain controller is started on a master node. The configuration for the cluster resides in the domain controller.
Next a host controller is started on each machine in the cluster. Each host controller deployment configuration specifies how
many {{book.project.name}} server instances will be started on that machine. When the host controller boots up, it starts
as many {{book.project.name}} server instances as it was configured to do. These server instances pull their configuration
from the domain controller.
==== Domain Configuration
Various other chapters in this guide walk you through configuring various aspects like databases,
HTTP network connections, caches, and other infrastructure related things. While standalone mode uses the _standalone.xml_ file to configure these things,
domain mode uses the _.../domain/domain.xml_ configuration file. This is
where the domain profile and server group for the {{book.project.name}} server are defined.
.domain.xml
image:../../{{book.images}}/domain-file.png[]
NOTE: Any changes you make to this file while the domain controller is running will not take effect and may even be overwritten
by the server. Instead use the the command line scripting or the web console of {{book.appserver.name}}. See
the link:{{book.appserver.admindoc.link}}[{{book.appserver.admindoc.name}}] for more information.
Let's look at some aspects of this _domain.xml_ file. The +auth-server+ +profile+ XML block is where you are going to make the bulk of your configuration decisions.
You'll be configuring things here like network connections, caches, and database connections.
.auth-server profile
[source,xml]
----
<profiles>
<profile name="auth-server">
...
</profile>
----
The +ha-sockets+ +socket-binding-group+ defines the default port mappings for various connectors that are opened with each
{{book.project.name}} server instance. Any value that contains +${...}+ is a value that can be overriden on the command line
with the +-D+ switch, i.e.
----
$ domain.sh -Djboss.http.port=80
----
The definition of the server group for {{book.project.name}} resides in the +server-groups+ XML block. It specifies the domain profile
that is used (+default+) and also some default boot arguments for the Java VM when the host controller boots an instance. It also
binds a +socket-binding-group+ to the server group.