An OWLIM-Enterprise cluster is organised as one or more master nodes that manage one or more worker nodes. Fail-over and load-balancing between worker nodes is automatic. Multiple (stand-by) master nodes ensure continuous cluster performance even in the event of a master node failure. The cluster deployment can be modified when running, which allows worker nodes to be added during peak times, or released for maintenance, backup, etc. Such a set up guarantees a high performance always on service that can handle millions of query requests per hour.
A cluster is made up of two basic node types: masters and workers. The cluster master manages and distributes atomic requests (query evaluations and update transactions) to a set of workers. A master node is responsible for:
Worker nodes are based on OWLIM-SE and are set up using the Sesame HTTP server (a Web application running inside a servlet container, e.g. Apache Tomcat). Master nodes do not store or manage any RDF data themselves (although it is possible to run a master and a worker instance on the same physical machine). From an external point of view, a master behaves exactly like any other Sesame/OWLIM repository that is exposed via the Sesame HTTP server, but utilises worker nodes (also exposed via a Sesame HTTP server) to store and manage RDF data. In this way, parallel query execution performance can be increased by having worker nodes answer queries in parallel.
OWLIM-Enterprise therefore has the following advantages over a stand-alone OWLIM-SE instance:
A master node of an OWLIM-Enterprise cluster implements the Sesame Repository interfaces and appears to clients like any other OWLIM instance. However, it does not store any RDF data itself, rather its function is to route queries and update requests to a set of OWLIM-SE instances (nodes).
A cluster can contain more than one master node. In this case, every master monitors the health of all the workers and can distribute query execution tasks between them, effectively allowing a cluster to have multiple entry points for queries. However, only one master at any given time can be responsible for propagating updates across the workers and this node is said to be in 'normal' (also called 'read/write') mode. All other master nodes are in the 'hot-standby' (also called 'read-only') mode. Switching the modes of master nodes can be achieved using the JMX management interface.
The master node that is currently in the 'normal' mode will respond to problems with the worker nodes as soon as they are detected, such as not responding to status queries, HTTP errors, invalid fingerprint etc. This typically takes just a few seconds. If a worker is lost completely then it simply does not take part in cluster operations and the cluster master remains in 'normal' mode, even though it will show the worker in the OFF state and will send a JMX notification that this has occurred.
In case the 'normal' master node fails and does not respond to HTTP requests, the cluster will process only read requests (e.g. query evaluations) via any hot-spare masters until the main master is running again or the standby master is switched in to 'normal' mode.
Worker nodes are OWLIM-SE repositories configured with identical rule-sets hosted in the openrdf-sesame Web application running in a Java servlet container, such as Tomcat. These are accessible to the Master node via the HTTP protocol of the exported SPARQL endpoint of the Sesame service.
Every read request (SPARQL query) is passed to one of the available worker nodes. The node is chosen based on runtime statistics: number of queries currently running on that node and average query evaluation time. The available nodes are organised in a priority queue which is rearranged after every read operation. If an error occurs (time-out, lost connection, etc) the request is resent to one of the other available nodes and so on until it is successfully processed.
Updates are handled in the following way: Each update is first logged. Then a probe node is selected and the request is sent to it. If the update is successful, any control queries are evaluated against it in order to check its consistency with respect to the data it holds. If this control suite passes, the update is forwarded to the rest of the nodes in the cluster. During the handling of an update the nodes that do not successfully process it are disabled and scheduled for recovery replication.
The master node can be configured with a set of control SPARQL queries, which may be only CONSTRUCT or ASK queries. The CONSTRUCT queries, when evaluated, check for the presence of the statements generated from the query. If any of these statements are missing, then a condition is raised and the control suite is considered to have failed. An example of a control query could be the check for proper values respecting the rdfs:range of an arbitrary property, e.g.
For example, the following update will cause a synchronisation error, because the result of the update will be different for each worker node:
i.e. the value of ?timestamp will be set according to the clock and time of execution at each worker. After promulgating this update to all worker nodes, the master will detect a difference in each worker nodes signature (which will not match any previous state in its logs) and will trigger a full replication between the worker that first received the update and all other worker nodes.
During normal operations, the master node keeps the cluster synchronised by processing updates as described above. If a worker node becomes out of synch with the rest of the cluster, perhaps because it was offline or unreachable due to network problems then the master node will detect this condition. If the auto-replication attribute is set to false then a notification is sent and the cluster master switches in to read-only mode, i.e. it will not process any more updates. If desired, the startReplication operation can be used to start replication manually and when completed the worker node and cluster will return to normal status.
If the auto-replication attribute is set to true, or if replication is started manually, then the master will attempt to bring the problem worker node to the same state as the other worker nodes using one of the following replication methods:
Skip to end of metadata Go to start of metadata