Configuring cache replication

Use this task to improve performance by configuring the data replication service (DRS) to replicate data from the dynamic cache service across the consumers in a replication domain.

Before you begin

Important: If you are running a base server, you can skip the steps to create a replication domain and move on to enabling the data replication service (DRS). Setting up a replication domain on a base server with multiple servants is done automatically when the keywords DynacacheEnableUnmanagedServerReplication and DynacacheUnmanagedServerReplicationType are defined in step five below. If the server is in a WebSphere Application Server Network Deployment environment and has multiple servants, you must define a replication domain.
Setting up the dynamic cache service on WebSphere Application Server for z/OS apply for the following scenarios:
  • Clustered environment
    1. Define the replication domain.
    2. Set up the dynamic cache service as outlined in the steps below.
  • Base application server with multiple servants - Set up the dynamic cache service as outlined in the steps below.
  • Managed node where the server has multiple servants
    1. Define the replication domain.
    2. Set up the dynamic cache service as outlined in the steps below.
Note: The following steps also apply in non-clustered environments when the server has more than one servant.

See Cache replication for more information about replicating data for the dynamic cache service.

You should have a replication domain created for the dynamic cache service. Configure a different replication domain for each type of consumer of the replication domain. For example, configure two different replication domains for dynamic cache and session manager.
Important: If you are running a base server, you can skip the steps to create a replication domain and move on to enabling the data replication service (DRS). Setting up a replication domain on a base server with multiple servants is done automatically when the keywords DynacacheEnableUnmanagedServerReplication and DynacacheUnmanagedServerReplicationType are defined in step five below. If the server is in a WebSphere Application Server Network Deployment environment and has multiple servants, you must define a replication domain.
There are two ways to configure replication domains:
  • To create replication domains manually, click Environment > Replication domains in the administrative console.
  • To create a new replication domain automatically when you create a cluster, click Servers > Clusters > New in the administrative console.
For more details about configuring replication domains, see Replicating data across application servers in a cluster.

Do not use the default value of a single replica for the Number of replicas for dynamic cache replication domains. Instead, use a full group replica for any replication domains that you configure for dynamic cache.

Note: If you configured cache replication with a previous version of WebSphere Application Server, review Migrating servers from multi-broker replication domains to data replication domains to learn about the new type of replication domains that you should use with the current version of WebSphere Application Server.

About this task

Use this task to improve performance in a clustered environment by enabling the data replication service (DRS) to replicate cached data across the servers in a cluster. Invalidations of cache entries are sent across the cluster to keep the cached data consistent and valid.

Procedure

  1. In the administrative console, click Servers > Application servers > server_name > Container services > Dynamic cache service.
  2. To enable replication, select Enable cache replication.
  3. Choose a replication domain. Use different replication domains for each type of consumer. For example, dynamic cache should use a different replication domain than session manager. The only replication domains that you can select in this panel include replication domains that are configured to use full-group replication. In a full-group configuration, every cache entry is replicated to every other cache that is configured in the servers that are in the replication domain. If none of the replication domains in your configuration meet these requirements, the list is empty. In this case, create a replication domain or alter an existing replication domain so that you have a replication domain that can perform full-group replication. See Replicating data across application servers in a cluster for more information.
  4. Define the dynamic cache replication settings. Click Enable cache replication. On this page, you can define when and how often data is replicated across the dynamic cache replication domain. For more information about these settings, see Dynamic cache service settings.
  5. To enable cache replication on a server that has multiple servants configured, you must define the following JVM custom properties.
    1. In the administrative console, click Servers > Application Servers > server_name.
    2. Under Server Infrastructure, click Java and process management > Process definition > Servant > Java Virtual Machine > Custom properties > New.
    3. Add the new property name as DynacacheEnableUnmanagedServerReplication and set the value to true.
    4. Add another JVM property to specify the global sharing policy for the base z/OS server. This property must be set for managed and unmanaged nodes. Click New and add a new JVM custom property that is called DynacacheUnmanagedServerReplicationType. Use one of the following values:
      Value Description
      NOT_SHARED Cache entries for this object are not shared among different application servers. These entries can contain non-serializable data. For example, a cached servlet can place non-serializable objects into the request attributes, if the class type supports it.
      PUSH Cache entries for this object are automatically distributed to the dynamic caches in other application servers or cooperating Java Virtual Machines (JVMs). Each cache has a copy of the entry at the time it is created. These entries cannot store non-serializable data.
      PULL Cache entries for this object are shared between application servers on demand. If an application server gets a cache miss for this object, it queries the cooperating application servers to see if they have the object. If no application server has a cached copy of the object, the original application server runs the request and generates the object. These entries cannot store non-serializable data. This mode of sharing is not recommended.
      PUSH_PULL Cache entries for this object are shared between application servers on demand. When an application server generates a cache entry, it broadcasts the cache ID of the created entry to all cooperating application servers. Each server then knows whether an entry exists for any given cache ID. On a given request for that entry, the application server knows whether to generate the entry or pull it from somewhere else. These entries cannot store non-serializable data.
      If you do not define one of these values, the default is NOT_SHARED.
  6. Define sharing policies in the cachespec.xml file.

    To use cache replication among multiple servants on a base server, you must create a cachespec.xml file to define the cacheable objects that you want to create.

    You can override the global sharing policy by specifying a specific sharing policy in the cache policy. For example, if your global policy is to use Push only, you can change the sharing policy of a specific cache entry by making this change to your cache policy:
    <cache-entry>
    	<sharing-policy>not-shared</sharing-policy>
    	<class>servlet</class>
    	<name>/app</name>
    	<cache-id>
    		<component id="action" type="parameter">
    			<value>portfolio</value>
    			<required>true</required>
    		</component>
    		<component id="JSESSIONID" type="cookie">
    			<required>true</required>
    		</component>
    		<property name="EdgeCacheable">true</property>
    	</cache-id>
    </cache-entry>
    For more information about the sharing policies that can be defined in the cachespec.xml file, see cachespec.xml file.

Results

Cache entries copy to the other application servers in the configured replication domain.

What to do next

Use the cache monitor to view the contents of the cache. See Displaying cache information for more information.



In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Sep 20, 2010 10:03:57 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=vela&product=was-nd-zos&topic=tdyn_cachereplication
File name: tdyn_cachereplication.html