3.7. Configuring the Discovery Service

The discovery service was added to JOnAS services in order to support Chapter 41 Domain Management in JOnAS.

In order to enable domain management, all the servers in the domain must start the discovery service by adding discovery in the services list (joanas.services property).

By default, a server running the discovery service is a slave, but the discovery service can be configured to make a server play the role of master. All the slave servers in the domain can be administered by a management application deployed on a master server. However, a management application can be deployed on a slave in order to administer it individually.

The discovery service is based on a communication infrastructure (currently IP Multicast) that enables message broadcasting in order to publish the connector-server addresses and state changes of the servers in the domain. The master servers listen to these discovery messages. Moreover, they are able to broadcast messages asking the servers in the domain to identify themselves. See Chapter 35 Howto: JSR 160 Support in JOnAS for more details about JMX Remote connectors.

3.7.1. Configuration Settings for All Servers

The default configuration of the discovery service provides the IP Multicast configuration. The following two properties must have identical values for all the servers in the domain:

jonas.service.discovery.multicast.address = 224.224.224.224
jonas.service.discovery.multicast.port = 9080

3.7.2. Additional Configuration Settings for Master Servers

To start a server as a master, you must uncomment the following line:

jonas.service.discovery.master = true

The configuration of a master server must also define an additional port number by setting the following property:

jonas.service.discovery.source = 9888

3.7.3. Master or Slave?

In a management domain, at least one server must be started as a master. But, any slave server can be dynamically promoted to be a master. This is allowed by a management operation exposed by the MBean associated with the discovery service (startDiscoveryMaster operation).