7.5. Configure Distribution Mode (Remote Client-Server Mode)


Distribution mode is a clustered mode in Red Hat JBoss Data Grid. Distribution mode can be added to any cache container using the following procedure:

Procedure 7.1. The distributed-cache Element

The distributed-cache element configures settings for the distributed cache using the following parameters:
  1. Add the Cache Name

    The name parameter provides a unique identifier for the cache.
    <cache-container name="clustered" 
    		 default-cache="default" 
    		 statistics="true">
    	<transport executor="infinispan-transport" lock-timeout="60000"/>
     	<distributed-cache name="default" />
    
  2. Set the Clustered Cache Start Mode

    The mode parameter sets the clustered cache mode. Valid values are SYNC (synchronous) and ASYNC (asynchronous).
    <cache-container name="clustered" 
    		 default-cache="default" 
    		 statistics="true">
    	<transport executor="infinispan-transport" lock-timeout="60000"/>
    	<distributed-cache name="default"
    			   mode="SYNC" />
    
  3. Specify Number of Segments

    The (optional) segments parameter specifies the number of hash space segments per cluster. The recommended value for this parameter is ten multiplied by the cluster size and the default value is 80.
    <cache-container name="clustered" 
    		 default-cache="default" 
    		 statistics="true">
    	<transport executor="infinispan-transport" lock-timeout="60000"/>
    	<distributed-cache name="default"
    			   mode="SYNC"
    			   segments="20" />
    
  4. Set the Cache Start Mode

    The start parameter specifies whether the cache starts when the server starts up or when it is requested or deployed.
    <cache-container name="clustered" 
    		 default-cache="default" 
    		 statistics="true">
    	<transport executor="infinispan-transport" lock-timeout="60000"/>
    	<distributed-cache name="default"
    			   mode="SYNC"
    			   segments="20"
    			   start="EAGER"/>
    
    
  5. Per-cache Statistics

    If statistics are enabled at the container level, per-cache statistics can be selectively disabled for caches that do not require monitoring by setting the statistics attribute to false.
    <cache-container name="clustered" 
    		 default-cache="default" 
    		 statistics="true">
    	<transport executor="infinispan-transport" lock-timeout="60000"/>
    	<distributed-cache name="default"
    			   mode="SYNC"
    			   segments="20"
    			   start="EAGER"
    			   statistics="true">
    			...
    	</distributed-cache>
    </cache-container>
    

Important

JGroups must be appropriately configured for clustered mode before attempting to load this configuration.
For details about the cache-container, locking, and transaction elements, see the appropriate chapter.
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.