Chapter 38. High Availability Using Server Hinting

38.1. High Availability Using Server Hinting

In Red Hat JBoss Data Grid, Server Hinting ensures that backed up copies of data are not stored on the same physical server, rack, or data center as the original. Server Hinting does not apply to total replication because total replication mandates complete replicas on every server, rack, and data center.

Data distribution across nodes is controlled by the Consistent Hashing mechanism. JBoss Data Grid offers a pluggable policy to specify the consistent hashing algorithm. For details on configuring this policy refer to the ConsistentHashFactories section in the JBoss Data Grid Developer Guide .

Setting a machineId, rackId, or siteId in the transport configuration will trigger the use of TopologyAwareConsistentHashFactory, which is the equivalent of the DefaultConsistentHashFactory with Server Hinting enabled.

Server Hinting is particularly important when ensuring the high availability of your JBoss Data Grid implementation.

38.2. Establishing Server Hinting with JGroups

When setting up a clustered environment in Red Hat JBoss Data Grid, Server Hinting is configured when establishing JGroups configuration.

JBoss Data Grid ships with several JGroups files pre-configured for clustered mode. These files can be used as a starting point when configuring Server Hinting in JBoss Data Grid.

See Also: Pre-Configured JGroups Files

38.3. Configure Server Hinting (Remote Client-Server Mode)

In Red Hat JBoss Data Grid’s Remote Client-Server mode, Server Hinting is configured in the JGroups subsystem on the transport element for the default stack, as follows:

Configure Server Hinting in Remote Client-Server Mode

<subsystem xmlns="urn:jboss:domain:jgroups:3.0"
	   default-stack="${jboss.default.jgroups.stack:udp}">
	<stack name="udp">
		<transport type="UDP"
			   socket-binding="jgroups-udp"
			   site="${jboss.jgroups.transport.site:s1}"
			   rack="${jboss.jgroups.transport.rack:r1}"
			   machine="${jboss.jgroups.transport.machine:m1}">
			   <!-- Additional configuration elements here -->
		</transport>
	</stack>
</subsystem>

  1. Find the JGroups subsystem configuration
  2. Enable Server Hinting via the transport Element

    1. Set the site ID using the site parameter.
    2. Set the rack ID using the rack parameter.
    3. Set the machine ID using the machine parameter.

38.4. Configure Server Hinting (Library Mode)

In Red Hat JBoss Data Grid’s Library mode, Server Hinting is configured at the transport level. The following is a Server Hinting sample configuration:

Configure Server Hinting for Library Mode

The following configuration attributes are used to configure Server Hinting in JBoss Data Grid.

<transport cluster = "MyCluster"
           machine = "LinuxServer01"
           rack = "Rack01"
           site = "US-WestCoast" />
  1. The cluster attribute specifies the name assigned to the cluster.
  2. The machine attribute specifies the JVM instance that contains the original data. This is particularly useful for nodes with multiple JVMs and physical hosts with multiple virtual hosts.
  3. The rack attribute specifies the rack that contains the original data, so that other racks are used for backups.
  4. The site attribute differentiates between nodes in different data centers replicating to each other.

The listed parameters are optional in a JBoss Data Grid configuration.

If machine, rack, or site are included in the configuration, TopologyAwareConsistentHashFactory is selected automatically, enabling Server Hinting. However, if Server Hinting is not configured, JBoss Data Grid’s distribution algorithms are allowed to store replications in the same physical machine/rack/data center as the original data.