此内容没有您所选择的语言版本。
13.2.2. Remote Cache Store Configuration (Library Mode)
Procedure 13.4. Remote Cache Store Configuration
The following is a sample remote cache store configuration for Red Hat JBoss Data Grid's Library mode.
Configure the Persistence Element
Create apersistenceelement, with thepassivationset tofalse.<persistence passivation="false" />- Create a
remoteStoreelement within thepersistenceelement to configure the attributes for the Remote Cache Store.<persistence passivation="false"> <remoteStore xmlns="urn:infinispan:config:remote:6.0" fetchPersistentState="false" shared="true" preload="false" ignoreModifications="false" purgeOnStartup="false" tcpNoDelay="true" pingOnStartup="true" keySizeEstimate="62" valueSizeEstimate="512" forceReturnValues="false"> </remoteStore> </persistence>- Add the
fetchPersistentStateattribute. If set totrue, the persistent state is fetched when the remote cache joins the cluster. If multiple cache stores are chained, only one cache store can have this property set totrue. The default for this value isfalse. - Add the
sharedattribute. This is set totruewhen multiple cache instances share a cache store, which prevents multiple cache instances writing the same modification individually. The default for this attribute isfalse. - Add the
preloadattribute. When set totrue, the cache store data is pre-loaded into memory and becomes immediately accessible after starting up. The disadvantage of setting this totrueis that the start up time increases. The default value for this attribute isfalse. - Add the
ignoreModificationsattribute. When set to true, this attribute prevents cache modification operations such as put, remove, clear, store, etc. from affecting the cache store. As a result, the cache store can become out of sync with the cache. The default value for this attribute isfalse. - Add the
purgeOnStartupattribute. If set totrue, the cache store is purged during the start up process. The default value for this attribute isfalse. - Add the
tcpNoDelayattribute. If set totrue, this triggers theTCPNODELAYstack. The default value for this attribute istrue. - Add the
pingOnStartupattribute. If set totrue, a ping request is sent to a back end server to fetch the cluster topology. The default value for this attribute istrue. - Add the
keySizeEstimateattribute. This value is the class name of the driver user to connect to the database. The default value for this attribute is64. - Add the
valueSizeEstimateattribute. This value is the size of the byte buffers when serializing and deserializing values. The default value for this attribute is512. - Add the
forceReturnValuesattribute. This attribute sets whetherFORCE_RETURN_VALUEis enabled for all calls. The default value for this attribute isfalse.
- Create a
serverselement within theremoteStoreelement to set up the server information. Add aserverelement within the generalserverselement to add the information for a single server.<persistence passivation="false"> <remoteStore xmlns="urn:infinispan:config:remote:6.0" fetchPersistentState="false" shared="true" preload="false" ignoreModifications="false" purgeOnStartup="false" tcpNoDelay="true" pingOnStartup="true" keySizeEstimate="62" valueSizeEstimate="512" forceReturnValues="false"> <servers> <server host="127.0.0.1" port="19711"/> </servers> </remoteStore> </persistence>- Add the
hostattribute to configure the host address. - Add the
portattribute to configure the port used by the Remote Cache Store.
- Create a
connectionPoolelement to theremoteStoreelement.<persistence passivation="false"> <remoteStore xmlns="urn:infinispan:config:remote:6.0" fetchPersistentState="false" shared="true" preload="false" ignoreModifications="false" purgeOnStartup="false" tcpNoDelay="true" pingOnStartup="true" keySizeEstimate="62" valueSizeEstimate="512" forceReturnValues="false"> <servers> <server host="127.0.0.1" port="19711"/> </servers> <connectionPool maxActive="99" maxIdle="97" maxTotal="98" /> </remoteStore> </persistence>- Add a
maxActiveattribute. This indicates the maximum number of active connections for each server at a time. The default value for this attribute is-1which indicates an infinite number of active connections. - Add a
maxIdleattribute. This indicates the maximum number of idle connections for each server at a time. The default value for this attribute is-1which indicates an infinite number of idle connections. - Add a
maxTotalattribute. This indicates the maximum number of persistent connections within the combined set of servers. The default setting for this attribute is-1which indicates an infinite number of connections.