Tutorials > Dynamic caching > Operate dynacache in a production environment
Set up cache replication in a clustered environment
In a clustered environment, set up cache replication for dynamic cache services to work properly.
When setting up cache replication, it is not necessary to replicate all cache entries. You can control the cache replication policy on a cluster member level or on an individual cache entry level.
Procedure
- Start the WebSphere Application Server administration server.
- Launch the WebSphere administrative console.
- Create an Internal Replication Domain for the application.
It is possible to create this as part of the initial cluster setup. If you have already created a Replication Domain for the application, you can use the existing one.
- Click...
Environment | Replication domains | New
- Fill in the required fields. For Number of replicas, select Entire Domain. Save the changes.
- Enable cache replication in each clone.
- Click...
Servers | Application servers | server_name | Container Services | Dynamic Cache Service | Enable Cache Replication
- Choose a replication domain.
- Choose a replication type. For WebSphere Commerce, the recommendation is to use Not shared.
- Repeat steps a-d for each clone.
- Save the changes.
- Instead of using a default setting, always explicitly specify the replication mode for each entry in cachespec.xml. For example:
- Add <sharing-policy>shared-push</sharing-policy> to each cache-entry in cachespec.xml.
Note: You can choose not to replicate certain cache entries.
To configure a cache entry to not replicate, set < sharing-policy>not-shared</sharing-policy>. See the cachespec.xml.
For more information, see Configuring cache replicationin the WebSphere Application Server documentation.
- Restart all the servers.
- Use the Cache Monitor to verify that replication is working.