8.3. Configure Replication Mode (Remote Client-Server Mode)
Replication mode is a clustered cache mode in Red Hat JBoss Data Grid. Replication mode can be added to any cache container using the following procedure.
Procedure 8.1. The replicated-cache
Element
The
replicated-cache
element configures settings for the distributed cache using the following parameters:
Add the Cache Name
Thename
parameter provides a unique identifier for the cache.<cache-container name="local" default-cache="default" statistics="true"> <replicated-cache name="default">
Set the Clustered Cache Start Mode
Themode
parameter sets the clustered cache mode. Valid values areSYNC
(synchronous) andASYNC
(asynchronous).<cache-container name="local" default-cache="default" statistics="true"> <replicated-cache name="default" mode="SYNC">
Set the Cache Start Mode
Thestart
parameter specifies whether the cache starts when the server starts up or when it is requested or deployed.<cache-container name="local" default-cache="default" statistics="true"> <replicated-cache name="default" mode="SYNC" start="EAGER">
Per-cache Statistics
Ifstatistics
are enabled at the container level, per-cache statistics can be selectively disabled for caches that do not require monitoring by setting thestatistics
attribute tofalse
.<cache-container name="local" default-cache="default" statistics="true"> <replicated-cache name="default" mode="SYNC" start="EAGER" statistics="true"> ... </replicated-cache> </cache-container>
Set Up Transactions
Thetransaction
element sets up the transaction mode for the replicated cache.<cache-container name="local" default-cache="default" statistics="true"> <replicated-cache name="default" mode="SYNC" start="EAGER" statistics="true"> <transaction mode="NONE" /> </replicated-cache> </cache-container>
Important
JGroups must be appropriately configured for clustered mode before attempting to load this configuration.
For details about the
cache-container
, locking
, and transaction
elements, see the appropriate chapter.