8.4. Configure Replication Mode (Library Mode)

download PDF
The following procedure shows a replication mode configuration in Red Hat JBoss Data Grid's Library mode.

Procedure 8.2. Replication Mode Configuration

  1. Configure the Clustering Element

    <clustering mode="replication">
            <sync replTimeout="${TIME}" />
            <stateTransfer chunkSize="${SIZE}"                       
                           timeout="${TIME}" />
    1. The clustering element's mode parameter's value determines the clustering mode selected for the cache.
    2. The sync element's replTimeout parameter specifies the maximum time period in milliseconds for an acknowledgment after a remote call. If the time period ends without any acknowledgment, an exception is thrown.
    3. The stateTransfer element specifies how state is transferred when a node leaves or joins the cluster. It uses the following parameters:
      1. The chunkSize parameter is the number of cache entries to be transferred in one chunk. The default chunkSize value is 512. The chunkSize depends on many parameters (for example, size of entries) and the best setting needs to be measured. To change the value for larger cache entries, smaller chunks are advisable and for smaller cache entries, increasing the chunkSize offers better performance.
      2. The fetchInMemoryState parameter when set to true, requests state information from neighboring caches on start up. This impacts the startup time for the cache. Set the default to true if there is no shared cache store behind to avoid cache inconsistency.
      3. The awaitInitialTransfer parameter causes the first call to method CacheManager.getCache() on the joiner node to block and wait until the joining is complete and the cache has finished receiving state from neighboring caches (if fetchInMemoryState is enabled). This option applies to distributed and replicated caches only and is enabled by default.
      4. The timeout parameter specifies the maximum time (in milliseconds) the cache waits for responses from neighboring caches with the requested states. If no response is received within the timeout period, the start up process aborts and an exception is thrown. As a result of the failed state transfer, the cache is not available on that instance.
  2. Specify Transport Configuration

        <transport clusterName="${NAME}"
            transportClass="${CLASS}" />
    The transport element defines the transport configuration for the cache container as follows:
    1. The clusterName parameter specifies the name of the cluster. Nodes can only connect to clusters that share the same name.
    2. The distributedSyncTimeout parameter specifies the time to wait to acquire a lock on the distributed lock. This distributed lock ensures that a single cache can transfer state or rehash state at a time.
    3. The transportClass parameter specifies a class that represents a network transport for the cache container.
Red Hat logoGithubRedditYoutubeTwitter


Try, buy, & sell


About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.