What

Virtuoso 7 and later versions can be configured in Elastic scale
out cluster mode. The data is sharded in a large number of
self-contained partitions. These partitions are divided among a
number of database server processes and can migrate between
them.

Why

An Elastic cluster can be dynamically resized with new
partitions or shards dynamically added to the same or new hardware
resources as the need to increase the size of the scale cluster or
relocation of partitions is required.

Optionally remove the default database such that is does not get
started with the cluster:

rm -rf database

Full list of supported options for the script
"virtuoso-mkcluster.sh":

-cluster-size Number of nodes in cluster
-cluster-node Node number in a cluster
-cluster-port Base portnumer for cluster
-cluster-ipc-port Base portnumer for cluster IPC
-cluster_size Size of the cluster
-virtuoso_home Virtuoso home path

Run the virtuoso-mkcluster.sh script to create the cluster, note
the default number of nodes is 4, but this can be changed by
setting the environment variable CLUSTER_SIZE to the required
number of nodes to be created before running the script:

This file can then be sym-linked to each of the cluster_XX directories of the cluster, and its
content will be merged with the cluster.ini in the respective directory of each node
when starting the cluster.

The [ELASTIC] section in the
cluster.ini files above, enables the
elastic cluster mode, where multiple segments and stripes as
detailed in the standard Virtuoso documentation database
striping .

The Slices parameter above should be
set to the number of hardware threads on the CPUs running on. Thus
in the example above where it is set to 6, this assumes all nodes
are running on the same physical machine with 12 cores with
hyper-threading enabled i.e. 24 threads, thus 6 per cluster
node.

The MaxSlices parameter above sets the
the maximum number of physical slices in the cluster.

The default SQL port of the master node is 12201, as indicated
in the virtuoso.ini file of the cluster_01 directory, and can then
be used for connecting to the newly created cluster and check its
status to ensure all nodes are online:

Splitting Cluster nodes across different
machines

Step 5 : Splitting
Cluster nodes across different machines

To split the node across across physical machines for better
scale out performance, scalability and growth, simply perform a
parallel Virtuoso installation on the additional physical machines
and move the cluster nodes required to the designated machine.
Example, for the default 4 node cluster to be split across two
identical machines it would make sense to split 2 nodes across each
machine, thus you would move say the cluster_03 and cluster_04
directory nodes to the new machine (removing them from the
original). The cluster.global.ini file on
each node would then need to be updated to set the HostXX
parameters to point to the new locations for nodes 03 and 04: