Summary: How to define the replication policy in a static cluster.

Overview

Replication ensures that changes to a space's information are mirrored in other cluster members. The procedure below explains how to define a replication policy.

To define a replication policy:

  • Replication Mode - Sync for Synchronous. The default value is sync.
  • Communication Mode - Optional vales are multicast or unicast. The default value is unicast.
  • Todo Queue Timeout - The time in milleseconds that the target space waits for missing packets. When the timeout expires, replication is performed via the asynchronous replicator. The default value is 1500.
  • Asynchronous Interval Check - The interval time in milliseconds where the asynchronous replicator checks for missing packets sent to target the space as one batch. This parameter is also the interval time for the asynchronous redo log that cleans packets which have been sent successfully to all target spaces. The default value is 2000.
  • Asynchronous Interval Operations -The number of destructive operations performed before the asynchronous replicator checks for missing packets sent to the target space as one batch. This parameter is also the number of destructive operations performed before the asynchronous redo log cleans packets which have been sent successfully to all target spaces. The default value is 1000.
  • Asynchronous Replication Chunk Size - The number of sync packets that are transmitted together on the network. The default value is 100.

Unicast Values

  • Min Work Threads - The synchronous replicator module allocates a thread to communicate with the target space. This thread is taken from a pool. This parameter defines the pool's minimum size. The default value is 4.
  • Max Work Threads - The maximum pool size. Make this number larger than the number of target spaces. The default value is 64.

Multicast Values

  • Min Work Threads- When running in multicast mode the target space handles incoming replication packets through multiple threads taken from a dedicated thread pool. You may configure the size of this thread pool.Default value is 4.
  • Max Work Threads- This parameter sets the pool minimum size. The default value is 64.
  • IP Group - This is the multicast IP value. The default is 224.8.8.8.
  • Port - This is the multicast IP port value. The default is 5555.
  • Ack Interval: This value keeps alive the heartbeat interval in milliseconds by waiting for missing packets or processing incoming requests (writing an Entry to the replica space.) Communication is performed via multicast. Every non-completed packet gets a heartbeat. <ack-interval> value must be smaller than the <response-timeout>. The default value is 4000.
  • Response Timeout - The maximum expected response time in milliseconds to get acknowledged from the target space. Acknowledgement is received when the packet has been completely processed at the target space. Default value is 2000.

  • Continue from step 8 in Defining Cluster Name and Spaces.
  • From the Cluster Options area, select the Replication checkbox. Observe that the Replication tab is enabled at the bottom of the dialog.
  • Use the Policy Type drop-down to specify whether replication should be full or partial (meaning that only some Entries are replicated):
    • Full Replication - All Entries in the group's spaces are replicated.
    • Partial Replication - Entries are only replicated if their class implements the com.j_spaces.core.client.IReplicatable interface, a tag interface that contains no methods. This allows you to control replication on a class-based level.
  • Select the Synch on Commit check-box if your application uses transactions, and you want the commit operation to be blocked until all members of the replication group receive the changes made by the transaction. The operation is not blocked if some of the transaction participants are unavailable; they simply receive the changes when they come back up.
  • With regard to the Trigger Notify Template and Replicate Notify Template check-boxes, there are four options:
Replicate Notify Template Setting Trigger Notify Template Setting Description
True (checked) False (unchecked) Client gets notification from the master space while it is active after registration. If failover has been configured, it gets notification from replica space when master space fails.
False (unchecked) True (checked) Client gets notification only from those spaces that are registered for notification.Notification occurs when data has been delivered to the space, either by a client application or from the replication.
True (checked) True (checked) Client gets notification from all cluster spaces after registration.Client gets multiple notifications for every space event.
False (unchecked) False (unchecked) Client gets notification only from those spaces to which it registered.Client does not get notifications from spaces which received their data by replication.
Replicate Notify Template and Trigger Notify Templates are orthogonal. However, if you check them both (option 3), you should be aware that, for each Entry that matches the notify template and is replicated to another space, you get a remote event. This may result in more events than you initially intended. You can use the source of the event to check which space triggered it.
  • Select the Memory Recovery checkbox if you want the space to recover its data from a replication partner when the GigaSpaces Server starts. This is only relevant for memory (transient) spaces).
  • Type the number of sync packets that are transmitted together on the network in the Chunk Size field.
    Type the time (in milliseconds) to wait between replication operations in the Interval Millisecond... field.
  • In the Interval Operations field, type the number of destructive space operations (write, take, Notify) to wait before replicating.
  • Type the timeout (in milliseconds) to wait for the lookup of a peer space in the Find Timeout field. This parameter applies only when the space is searched in a Jini lookup service.
  • Select the Group Members Attribute check-box if you want to enable replication selectively across the group members. If this check-box is clear, all spaces in the group are replicated with all the other spaces in the group. The Edit... button is enabled if you have selected the Group Members Attribute check-box.
  • Click the Edit... button to define the replication matrix, which specifies which spaces replicate to which spaces.

  • The Replications tab of the Replication Matrix dialog box allows you to define which spaces replicate to which spaces. Boxes in white are possible combinations for replication. Selecting the check-box where sp2 is target and sp1 is source enables one-way replication, from sp1 to sp2. This is shown in the screenshot below. By selecting additional check-boxes in the matrix, you enable other replication relationships.
  • The Properties pane on the right of the dialog relates to the box that is currently selected (shaded in purple) in the matrix. Use the check-boxes under Operations, on the right of the dialog, to enable or disable the replication of specific operations, for the current replication relationship (e.g. sp1 to sp2):

  • Select the Sync on commit check-box to block the commit operation until both the spaces in the current replication relationship have received the changes made by the transaction.
    The Filters/Recovery tab contains advanced settings related to space filters and recovery from a replication partner after shutdown. For more information, see Creating a Cluster.
  • Click the OK button to save the changes and return to the Create New Cluster Group dialog box.
  • You may now define additional policies for the group. See Defining a Failover Policy. If you do not need to define additional policies for this group, press Create to finish creating it.
  • If you need to define additional groups, see Creating Groups . If not, page through to the end of the wizard and jump to Creating Spaces.

    Cluster repl-original-state:
<repl-policy>
<repl-original-state>true</repl-original-state>
</repl-policy>

When this option is set to true, the replication mechanism maintains for every entry its full state together with the operation. For example, if an Entry has been written to the space and updated several times within a specific replication batch, the replication mechanism replicates the operations in their correct order together with the Entry's original state for each operation.
When this option is set to false, the replication mechanism replicates the latest state of the Entry to the target space. For example, if an Entry has been written to the space and updated several times within a specific replication batch, the replication mechanism replicates the operations in their correct order, but uses the Entry with its latest state for all operations.
Config file example:

<repl-policy>
             ...
             ....
             <repl-find-timeout>10000</repl-find-timeout>
             <repl-original-state>true</repl-original-state>  
</repl-policy>
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence