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.
  1. Configure the Persistence Element

    Create a persistence element, with the passivation set to false.
    <persistence passivation="false" />
    
    
  2. Create a remoteStore element within the persistence 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 to true, 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 to true . The default for this value is false.
    • Add the shared attribute. This is set to true when multiple cache instances share a cache store, which prevents multiple cache instances writing the same modification individually. The default for this attribute is false.
    • Add the preload attribute. When set to true, the cache store data is pre-loaded into memory and becomes immediately accessible after starting up. The disadvantage of setting this to true is that the start up time increases. The default value for this attribute is false.
    • 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 is false.
    • Add the purgeOnStartup attribute. If set to true, the cache store is purged during the start up process. The default value for this attribute is false.
    • Add the tcpNoDelay attribute. If set to true, this triggers the TCP NODELAY stack. The default value for this attribute is true.
    • Add the pingOnStartup attribute. If set to true, a ping request is sent to a back end server to fetch the cluster topology. The default value for this attribute is true.
    • 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 is 64.
    • Add the valueSizeEstimate attribute. This value is the size of the byte buffers when serializing and deserializing values. The default value for this attribute is 512.
    • Add the forceReturnValues attribute. This attribute sets whether FORCE_RETURN_VALUE is enabled for all calls. The default value for this attribute is false.
  3. Create a servers element within the remoteStore element to set up the server information. Add a server element within the general servers 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.
  4. Create a connectionPool element to the remoteStore 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.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

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.