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 apersistence
element, with thepassivation
set tofalse
.<persistence passivation="false" />
- Create a
remoteStore
element within thepersistence
element 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
fetchPersistentState
attribute. 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
shared
attribute. This is set totrue
when 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
preload
attribute. When set totrue
, the cache store data is pre-loaded into memory and becomes immediately accessible after starting up. The disadvantage of setting this totrue
is that the start up time increases. The default value for this attribute isfalse
. - Add the
ignoreModifications
attribute. 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
purgeOnStartup
attribute. If set totrue
, the cache store is purged during the start up process. The default value for this attribute isfalse
. - Add the
tcpNoDelay
attribute. If set totrue
, this triggers theTCP
NODELAY
stack. The default value for this attribute istrue
. - Add the
pingOnStartup
attribute. 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
keySizeEstimate
attribute. This value is the class name of the driver user to connect to the database. The default value for this attribute is64
. - Add the
valueSizeEstimate
attribute. This value is the size of the byte buffers when serializing and deserializing values. The default value for this attribute is512
. - Add the
forceReturnValues
attribute. This attribute sets whetherFORCE_RETURN_VALUE
is enabled for all calls. The default value for this attribute isfalse
.
- Create a
servers
element within theremoteStore
element to set up the server information. Add aserver
element within the generalservers
element 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
host
attribute to configure the host address. - Add the
port
attribute to configure the port used by the Remote Cache Store.
- Create a
connectionPool
element to theremoteStore
element.<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
maxActive
attribute. This indicates the maximum number of active connections for each server at a time. The default value for this attribute is-1
which indicates an infinite number of active connections. - Add a
maxIdle
attribute. This indicates the maximum number of idle connections for each server at a time. The default value for this attribute is-1
which indicates an infinite number of idle connections. - Add a
maxTotal
attribute. This indicates the maximum number of persistent connections within the combined set of servers. The default setting for this attribute is-1
which indicates an infinite number of connections.