Configure cache replication
Cache replication uses the WAS internal replication service. The internal replication service is also used for HttpSession memory-to-memory replication for failover purposes. To use cache replication, configure a replication domain with at least one replicator entry. For information about replication domains and replication entries, see Adminsiter replication domains in Administration.
Note: Cache replication is available only in WAS Network Deployment.
In a clustered environment, data is generated one time and then copied or replicated to other servers in the cluster. As a result, the other application servers do not need to generate the data separately. Verify that all resources in the cluster have the necessary access to generate and access cached data.
Use the administrative console to configure data replication at the Web container level, or edit the cachespec.xml file to configure data replication for individual cache entries. For example, you might want to configure cache replication at the Web container level, but disable replication for a specific cache entry.
Three types of cache replication are available:
- PUSH: Sends out new entries, including ID and data, and updates to those entries.
- PULL: Requests data from other servers in the cluster when that data is not locally present.
- PUSH/PULL: Sends out IDs for new entries, then requests entries only for those IDs that were sent. The dynamic cache always sends out cache entry invalidations.
For PUSH or PUSH/PULL types of cache replication, the dynamic cache provides a batch update option. The dynamic cache broadcasts the updates asynchronously, based on a timed interval, instead of sending them as they occur. Invalidators are sent immediately. Distribution of invalidations resolves the issue of stale data in a cluster.
To configure cache replication, perform these steps:
- Start the administrative console.
- In the topology tree, expand Servers and click Application Servers.
- Click the name of the server for which you want to configure cache replication.
- Click Dynamic Cache Service.
- Select the check box for Enable cache replication. For help with cache replication settings, see Internal messaging configuration settings.
- (Optional) If you want to manage runtime mode or batch update interval, perform these steps:
- On the Dynamic Cache Service page, click Enable cache replication.
- On the Internal Messaging page, select an internal messaging server. These settings specify which replication domain and initial replicator entry the dynamic cache service uses.
- In the Runtime mode field, select one of these options:
- Both push and pull
- Pull only
- Push only
- Not shared
- To change the batch update setting, specify a value in the Push frequency field.
- Click OK.
- Click Apply or OK.
- Save the configuration.