Ce contenu n'est pas disponible dans la langue sélectionnée.
7.6. Configure Distribution Mode (Library Mode)
The following procedure shows a distributed cache configuration in Red Hat JBoss Data Grid's Library mode.
Procedure 7.2. Distributed Cache Configuration
Configure the Clustering Element
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The
clusteringelement'smodeparameter's value determines the clustering mode selected for the cache. - The
syncelement'sreplTimeoutparameter 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. - The
stateTransferelement specifies how state is transferred when a node leaves or joins the cluster. It uses the following parameters:- The
chunkSizeparameter is the number of cache entries to be transferred in one chunk. The defaultchunkSizevalue is 512. ThechunkSizedepends 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 thechunkSizeoffers better performance. - The
fetchInMemoryStateparameter when set totrue, requests state information from neighboring caches on start up. This impacts the start up time for the cache. Set the default totrueif there is no shared cache store behind to avoid cache inconsistency. - The
awaitInitialTransferparameter causes the first call to methodCacheManager.getCache()on the joiner node to block and wait until the joining is complete and the cache has finished receiving state from neighboring caches (iffetchInMemoryStateis enabled). This option applies to distributed and replicated caches only and is enabled by default. - The
timeoutparameter specifies the maximum time (in milliseconds) the cache waits for responses from neighboring caches with the requested states. If no response is received within thetimeoutperiod, 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.
Specify Transport Configuration
<global> <transport clusterName="${NAME}" distributedSyncTimeout="${TIME}" transportClass="${CLASS}" /> </global><global> <transport clusterName="${NAME}" distributedSyncTimeout="${TIME}" transportClass="${CLASS}" /> </global>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Thetransportelement defines the transport configuration for the cache container as follows:- The
clusterNameparameter specifies the name of the cluster. Nodes can only connect to clusters that share the same name. - The
distributedSyncTimeoutparameter 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. - The
transportClassparameter specifies a class that represents a network transport for the cache container.