Note: Documentation for Pivotal GemFire 7.0.x is now
available at http://gemfire.docs.pivotal.io/7.0.2/index.html. Please refer to
the Pivotal site for the latest and most up-to-date documentation on GemFire
7.0.x. The vFabric GemFire 7.0 documentation site will no longer be
updated.

Configuring a Multi-site (WAN) System

Plan and configure
your multi-site topology, and configure the regions that will be shared between
systems.

Main Steps

Configure membership and
communication for each distributed system in your multi-site system. You must
use locators for peer discovery in a WAN configuration. See
Configuring Peer-to-Peer Discovery.
Start each distributed system using a unique
distributed-system-id and identify remote clusters
using
remote-locators.

Create the data regions
that you want to participate in the multi-site system, specifying the gateway
sender(s) that each region should use for WAN distribution. Configure the same
regions in the target clusters to apply the distributed events. See
Create Data Regions for Multi-site Communication.

Configure gateway
receivers in each GemFire cluster that will receive region events from another
cluster. See
Configure Gateway Receivers.

Start distributed system
member processes in the correct order (locators first, followed by data nodes)
to ensure efficient discovery of WAN resources. See
Starting Up Your System.

(Optional.) Deploy custom
conflict resolvers to handle resolve potential conflicts that are detected when
applying events from over a WAN. See
Resolving Conflicting Events.

Configure Gateway Senders

The distributed system ID
of the remote site to which the sender propagates region events.

A property that specifies
whether the gateway sender is a serial gateway sender or a parallel gateway
sender.

Optional properties that
configure the gateway sender queue. These queue properties determine features
such the amount of memory used by the queue, whether the queue is persisted to
disk, and how one or more gateway sender processes dispatch events from the
queue.

See WAN Configuration for more information about individual configuration properties.

For each GemFire system, choose the members that will host a gateway sender configuration and distribute region events to remote sites:

You must deploy a parallel gateway sender configuration on each GemFire member that hosts a region that uses the sender.

You may choose to deploy a serial gateway sender configuration on one or more GemFire members in order to provide high availability. However, only one instance of a given serial gateway sender configuration distributes region events at any given time.

Configure each gateway sender on a GemFire member using either the cache.xml file or Java API:

(For serial gateway senders only.) Whether to
use multiple dispatcher threads on each gateway queue to process the
queue's events. The dispatcher-threads attribute of
the gateway sender determines whether multiple threads process the
queue. If you use multiple dispatcher threads, also configure the
ordering policy to use for dispatching the events. For example:

You
cannot configure multiple dispatcher threads or an ordering
policy for a parallel gateway sender queue.

Note: When you configure multiple dispatcher threads, each thread
operates on its own copy of the gateway sender queue. Queue
configuration attributes such as
maximum-queue-memory are repeated for each
dispatcher thread that you configure.

Note: When using the Java API, you must configure a parallel
gateway sender
before you add its id to a region. This ensures that the
sender distributes region events that were persisted before new cache
operations take place. If the gateway sender id does not exist when you add it
to a region, you receive an
IllegalStateException.

Note: In addition to configuring regions with gateway senders to
distribute events, you must configure the same regions in the target clusters
to apply the distributed events. The region name in the receiving cluster must
exactly match the region name in the sending cluster.

Configure Gateway Receivers

Always configure a gateway receiver in each GemFire cluster that will
receive and apply region events from another cluster.

A gateway receiver configuration can be applied to multiple GemFire
servers for load balancing and high availability. However, each GemFire member
that hosts a gateway receiver must also define all of the regions for which the
receiver may receive an event. If a gateway receiver receives an event for a
region that the local member does not define, GemFire throws an exception. See
Create Data Regions for Multi-site Communication.

A gateway receiver configuration specifies a range of possible port
numbers on which to listen. The GemFire server picks an unused port number from
the specified range to use for the receiver process. You can use this
functionality to easily deploy the same gateway receiver configuration to
multiple members:

cache.xml
Configuration

The following configuration defines a gateway receiver that
listens on an unused port in the range from 1530 to 1550:

Note: When using the Java API, you must create any region that might
receive events from a remote site before you start the gateway receiver.
Otherwise, batches of events could arrive from remote sites before the regions
for those events have been created. If this occurs, the local site will throw
exceptions because the receiving region does not exist yet. If you define
regions in
cache.xml, the correct startup order is
handled automatically.