Posted: 25 Sep 2018 14:28 EDT Last activity: 11 Oct 2018 11:09 EDT
Cache in multiple node setup in Pega
We have a cluster environment where we have multiple nodes in multiple physical servers. We want to maintain common cache across all nodes. If we have node level data page, it wont suite our requirement because it is per node. How can we achieve one single common cache across all pega nodes?
***Edited by Moderator Marissa to update platform capability tags****
For your information, Pega is leveraging internally Hazelcast which is an in-memory data grid which helps implementing a distributed cache.
So you could attempt to leverage this but this is custom. Pega doesn't provide out of the box hook on this.
You would have to use custom java code to use it.
Also with great power comes great responsibilities...If badly implemented, the distributed cache can create stuck threads on all nodes and you can end up in the whole cluster unavailable. In other words this can become a single point of failure.
Having said that, you would need to set the password for the hazelcast cluster with a prconfig setting like this:
You also need the Hazelcast cluster ID and I'm not sure where you find it out which it should be one value found in the "Cluster Management" landing page-> Download system state, you get a JSON file with a description of the cluster.
Then use some code like this (in an activity step) to connect to the cluster:
(Please note my code only tried to connect and inspect the cluster. To leverage Hazelcast you would need to check directly hazelcast documentation. Please also note I wrote this in a hurry at the time so forgive me if there is a better way.)
com.hazelcast.client.config.ClientConfig clientConfig = new com.hazelcast.client.config.ClientConfig();