Setting up Cluster with a Single Master¶
What’s in this document?
Prerequisites¶
A valid license for each of your worker nodes;
GraphDB EE distribution unzipped on all cluster machines;
GraphDB EE installed and configured on each of your cluster machines.
Hint
All worker nodes that will be included in the cluster (will be connected to
the same master) must be configured identically (apart from the
repository name and label). A worker configuration template file, worker.ttl
, is included in the GraphDB EE distribution.
Tip
GraphDB does not impose any requirements on naming the master and the worker repositories that will be used in the same cluster. For production environment, where each master or worker repository is hosted in a separate GraphDB installation, we recommend using a common name as it will facilitate the automated deployment and configuration of the GraphDB cluster. For other setups, we recommend using distinct names for each repository, e.g., master1, master2, worker1, worker2, worker3, and so on. This will help you identify the particular master or worker when you look at the logs or when you manage your repositories through the GraphDB Workbench.
Initial GraphDB nodes list¶
Master1, repository: m1 (SPARQL endpoint URL: http://master-ip:7201/repositories/m1)
Worker1, repository: w1 (SPARQL endpoint URL: http://worker-ip:7301/repositories/w1)
Worker2, repository: w1 (SPARQL endpoint URL: http://worker-ip:7302/repositories/w1)
Worker3, repository: w1 (SPARQL endpoint URL: http://worker-ip:7303/repositories/w1)
General procedure¶
Create and configure Master1.
If the machine where each repository is installed does not have a GraphDB Workbench deployed, or if you are not using the RDF4J console for initialization, you have to initialize the repository yourself by executing the command:
curl http://master-ip:7201/repositories/m1/size curl http://master-ip:7301/repositories/w1/size curl http://master-ip:7302/repositories/w1/size curl http://master-ip:7303/repositories/w1/size
Link Worker1 to Master1 using the WorkerID SPARQL endpoint URL.
Jolokia:
http://master-ip:7201/jolokia/exec/ReplicationCluster:name=ClusterInfo!/m1/addClusterNode/http:!/!/worker-ip:7301!/repositories!/w1/0/true
cURL:
curl -H 'content-type: application/json' \ -d "{\"type\":\"exec\",\"mbean\":\"ReplicationCluster:name=ClusterInfo\/m1\",\"operation\":\"addClusterNode\",\"arguments\":[\"http://worker-ip:7301/repositories/w1\",0,true]}" \ http://master-ip:7201/jolokia/
Link the 2nd worker to Master1 using the WorkerID SPARQL endpoint URL.
Jolokia:
http://master-ip:7201/jolokia/exec/ReplicationCluster:name=ClusterInfo!/m1/addClusterNode/http:!/!/worker-ip:7302!/repositories!/w1/0/true
cURL:
curl -H 'content-type: application/json' \ -d "{\"type\":\"exec\",\"mbean\":\"ReplicationCluster:name=ClusterInfo\/m1\",\"operation\":\"addClusterNode\",\"arguments\":[\"http://worker-ip:7302/repositories/w1\",0,true]}" \ http://master-ip:7201/jolokia/
Link the 3rd worker to Master1 using the WorkerID SPARQL endpoint URL.
Jolokia:
http://master-ip:7201/jolokia/exec/ReplicationCluster:name=ClusterInfo!/m1/addClusterNode/http:!/!/worker-ip:7303!/repositories!/w1/0/true
cURL:
curl -H 'content-type: application/json' \ -d "{\"type\":\"exec\",\"mbean\":\"ReplicationCluster:name=ClusterInfo\/m1\",\"operation\":\"addClusterNode\",\"arguments\":[\"http://worker-ip:7303/repositories/w1\",0,true]}" \ http://master-ip:7201/jolokia/
Check the workers nodes state using the JMX attribute NodeStatus. The result list should contain all linked nodes and their state should be:
ON
.Jolokia:
http://master-ip:7201/jolokia/read/ReplicationCluster:name=ClusterInfo!/m1/NodeStatus
cURL:
curl -H 'content-type: application/json' \ -d "{\"type\":\"read\",\"mbean\":\"ReplicationCluster:name=ClusterInfo\/m1\",\"attribute\":\"NodeStatus\"}" \ http://master-ip:7201/jolokia/
Note
Use the “!” symbol for escaping characters when necessary in Jolokia requests.
Note
Using basic HTTP authentication may be required for accessing the HTTP-JMX bridge.