此内容没有您所选择的语言版本。

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" />
    
    
    Copy to Clipboard Toggle word wrap
  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>
    
    Copy to Clipboard Toggle word wrap
    • 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>
    
    Copy to Clipboard Toggle word wrap
    • 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>
    
    Copy to Clipboard Toggle word wrap
    • 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

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat