WildFly Domain Mode Concepts

From NovaOrdis Knowledge Base
Jump to navigation Jump to search

Internal

Managed Domain

A JBoss managed domain is a centrally-managed group of JBoss instances running on multiple physical hosts. The domain provided centralized management of modules, extensions, system properties, deployments, profiles and deployments. Managed domain is one of the two operating modes a JBoss EAP instance is capable of - the other is standalone. While running in managed domain mode, multiple JBoss EAP instance are managed from a central location, the domain controller, and share a common management policy. A domain has one or more domain controllers, one or more host controllers and zero or more server groups. A server group can span multiple hosts.

EAPDomain.png

Management Policy

The central management policy for a domain in stored in $JBOSS_HOME/domain/configuration/domain.xml. The hosts and the server instances that are part of the domain are not specified in domain.xml, directly. The management policy list a series of profiles, and a series of server groups. Each server group refers a profile, jvm parameters and a socket binding group. The association between actual server instances, running on different hosts, and the server group, is made on thehosts running those instances, in $JBOSS_HOME/domain/configuration/host.xml.


domain.xml contains configuration, not topology. This approach allows to add instances to a server group without modifying domain.xml.

Domain Controller

The domain controller is the Java process from which the domain is controlled. The domain controller ensures that each server instance is configured according to the management policy of the domain. The domain controller's responsibilities are to maintain the domain's central management policy, to ensure all host controllers are aware of its current contents and to assist the host controllers in ensuring that all running server instances are configured in accordance with this policy. For the host it runs on, the domain controller takes also on the host controller responsibilities, controlling the server instances collocated on the host. For more details about the relationship between domain and host controllers, see the "Relationship between a Host Controller and a Domain Controller" section. The domain controller must be started before any servers in any server groups in the domain. The domain controller process is started with $JBOSS_HOME/bin/domain.sh script.

Domain Controller High Availability

Since EAP 6.3, the domain controllers can be run in a highly available mode:

Domain Controller High Availability

Host Controller

The host controller is a Java process tied to a specific physical or virtual host. The host controller controls the lifecycle of the application server instances running on its host by starting and stopping them and assisting the domain controller in managing them. Each host can run multiple server groups. Host controllers delegate domain management tasks to the domain controller.



The host controller process is started with $JBOSS_HOME/bin/domain.sh script.


The host controller runs in its own JVM instance, identified by {{-D[[Host Controller]}} in the process table.

Each host controller has a name unique within the domain. The default name of the default host controller is "master".

The host controller reads its configuration from Template:$JBOSS HOME/domain/configuration/host.xml. See [host.xml|Host.xml].

An interesting behavior of the host controller process is that it is restarted (I presume by the process controller) if the JVM is killed -9.

!!Relationship Between a Host Controller and a Domain Controller

A host controller can interact with only one domain controller - the domain controller that manages the domain the host controllers are part of.

The domain controller must be running when the host controllers controlled by it are started.

The host controller and the domain controller are the same process on the domain controller machine - it is declared as <local> in the host.xml.

When the host controller lives on a different machine, it is configured to connect to the domain controller in {{<host><domain-controller><remote ... ></domain-controller></host>}}.

For more details see [<domain-controller>|Host.xml#DomainController].

A host controller can be configured with multiple options for finding the domain controller, in case the primary domain controller fails. Host controllers iterate through the list of options until one succeeds. For details on how to configure the domain controller failover, see [JBoss7 Domain Configuration#DomainControllerFailover].

Relationship Between a Host Controller and a Domain Controller

Process Controller

Profile

Server Group

Socket Binding Group

Host

Server Instance

Domain Mode

Details about configuring WildFly in domain mode are available here:

WildFly Domain Mode Configuration

Domain

Migrate https://home.feodorov.com:9443/wiki/Wiki.jsp?page=JBoss7Domain

A set of system properties available to the entire domain can be declared as described here: System Properties at the Top of domain.xml.

Domain Controller

Also see:

WildFly Domain Controller Post-Install Configuration


High-Availability Domain Controller

Definition.

For more details, see:

WildFly High Availability Domain Controller

Host Controller

Host Controller Networking

The actual values for the management and public interface bind addresses for a specific host are host-dependent, and they are defined in the host controller configuration Note that a host controller and all the server nodes running on the same host share the values for the management and public bind addresses. Also see server node networking.

For more details on how to configure the bind addresses, see:

'jboss.bind.address.management' for host and domain controllers

Subordinate Host Controller

Also see:

Subordinate WildFly Host Controller Post-Install Configuration

Domain Controller/Host Controller Communication

Host controllers connect to the domain controller's management interface native API endpoint to get domain configuration, so the domain controller management functions have to be externally accessible over the management interface, hence the management interface has to be visible on the management (internal) network. A subordinate host controller does not have to expose its management interface.

Process Controller

Server Group

A server group is a set of WildFly server nodes that share the following:

  • a common configuration, described in a domain profile
  • optionally, a common jvm configuration, described by the <jvm> configuration element.
  • optionally, a set of system properties available only to servers that belong to the server group. The declaration is described here: System properties per Server Group.
  • a set of port values, described in a domain socket binding group
  • a set of deployments.
<server-group name="server-group-A" profile="some-profile">
    <system-properties>
        <property name="some.system.property" value="some value"/>
    </system-properties>
    <jvm name="default">
         <heap size="6000m" max-size="12000m"/>
         <permgen max-size="2048m"/>
    </jvm>
    <socket-binding-group ref="full-ha-sockets"/>
    <deployments>
        <deployment name="..." runtime-name="..."/>
        ...
    </deployments>
</server-group>

It can be said that the servers of a server group are configured and managed as one, via the domain controller. Server groups allow to apply common management policies, deploy applications to all servers belonging to the server group. The servers of a server group can be subjected to group-wide management operations: all servers can be started or stopped at the same time, in one operation.

The servers belonging to a server group may run on one or multiple VMs. The association between servers, server groups and the VM they run is described here: relationship between servers and server groups.

The server groups are defined and configured in domain.xml.

In domain mode, each server instance belongs to a server group, even if that server group has just one single instance.

Server Groups and Rolling Upgrades

Different server groups can also have the same profile and deployments. This can allow for rolling application upgrades where the application is upgraded on one server group and then updated on a second server group, avoiding a complete service outage.

Server

The association between servers, server groups and the VM they run is described here: relationship between servers and server groups.

Server Node Networking

The actual values for the server node network interfaces are host-dependent, so the host controller defines the actual values for the public and management bind addresses, in its configuration. The host controller and all the server nodes running on the same host share the values for the management and public bind addresses. Also see host controller networking.

Relationship Between Servers and Server Groups

The association between server instances and the hosts they run is defined by the host controller running on each host: the host controller reads its host.xml configuration file and instantiates the server nodes defined in its <servers> section, During start-up, the host controller determines what server group a specific server instance is part of, and pulls the profile configuration, port definitions and jvm configuration associated with that server group from the domain controller.

If more than one server instance is required on a specific host, the port offset that allows multiple server instance to run on the same host is specified in the host.xml's <server> definition as socket-bindings port-offset. For more details, see host.xml <servers> section.

Profile

See:

WildFly Profile

WildFly Networking Concepts

The networking concepts valid for the standalone mode are also used by the domain mode:

WildFly Networking Concepts