OpenSpecimen can be deployed in a clustered setup to facilitate high availability, high throughput processing of requests. Typically, OpenSpecimen nodes are deployed behind a load balancer/proxy which delegates the user requests to appropriate node based on the load, availability etc.
The configuration of OpenSpecimen cluster involves letting each node know about the presence of other nodes in the cluster. This is required to propagate the localised knowledge, like updates to cached metadata, of the actions to all the cluster nodes. This ensures all the cluster nodes have the same knowledge of the metadata and data, and behave exactly the same way in deterministic manner. The consequence of this is, requests can be routed to any node using any strategy that fits the user traffic pattern. This helps in achieving scalability.
As a first step, every node in the cluster should be given an unique name. This is to identify the nodes in the cluster. The name should not contain any whitespace characters. The node name should be assigned, preferably, only once and should not be changed thereafter.
Edit openspecimen.properties file located in $TOMCAT_HOME/conf directory.
The name attribute identifies the node (same as that specified in openspecimen.properties).
The URL attribute specifies the HTTP URL of the node's Tomcat to use for sending the cluster related events/notifications.
A secret known only to the OpenSpecimen nodes. Used for trusted communication between the nodes in the cluster.
Max. amount of time, in seconds, that a node waits for receiving the acknowledgement from the other nodes in the cluster for its broadcast event.
Comma separated list of email IDs to whom the cluster error notifications are sent.
The preferred way to startup the nodes in cluster is to start one node at a time, ensure the node is up and functional, and then move on to the next node in the cluster. Do not attempt to start all nodes of the cluster at the same time or concurrently.
A small amount of downtime is required for smooth upgrade of OpenSpecimen. When upgrading, bring down all the nodes. Upgrade one node at a time, ensure the node is up and functional, and then move on to upgrade the next node in the cluster. Do not attempt to run multiple versions of OpenSpecimen against the same database schema. Otherwise, the behaviour is unspecified.