Clustering

A cluster can be created by installing VidiCore on multiple servers and configuring all instances to connect to the same database.

The one setting that should be set is the bindAddress, which an instance will bind to and publish to the other members of the cluster.

cluster:
  bindAddress: vs1.example.com

You can also change the address that is published, for example if there’s a firewall with port forwarding rules set up in front of each server.

cluster:
  bindAddress: vs1.example.com
  bindPort: 7800
  bindPortRange: 0
  externalAddress: fw.example.com
  externalPort: 7801

In a clustered setup some of the Vidispine services can run on all instances, others must run on a single instance (“singleton services”). To ensure that the singleton services only run on a single instance, the instances communicate with each other and agree on who is starting the service. Split-brain situations where all instances run, but cannot talk to each other need to be discovered to avoid singleton-service being started on more than one instance.

The mechanism in VidiCore for ensuring this is the “cluster quorum” configured via com.vidispine.service.quorum. It defines how many VidiCore instances must be up-and-running before starting any singleton services.

Please note that split-brain issues cannot be resolved properly in a two-node cluster as no majority can be found.

Note

For this to work you also need to use an external ActiveMQ instance, so make sure that the embedded broker is disabled and that the configuration points to your ActiveMQ instance:

broker:
  url: tcp://activemq.example.com:61616
  #embeddedBroker: broker:(tcp://localhost:61616)

Quick cluster setup

It is also possible to create a cluster on a single machine by starting multiple server processes each with a different configuration file.

$ cp server.yaml instanceA.yaml instanceB.yaml
$ vi instanceA.yaml instanceB.yaml

Make sure that all instances have distinct ports. Then start the instances that are to be part of the cluster:

$ java -jar vidispine-server.jar -Dcom.vidispine.service.quorum=2 server instanceA.yaml 2>&1 1>instanceA.log &
$ java -jar vidispine-server.jar -Dcom.vidispine.service.quorum=2 server instanceB.yaml 2>&1 1>instanceB.log &

Tail the log and you should see that the processes have found each other and have formed a cluster.

INFO  [2015-05-27 13:06:27,652] [403] org.infinispan.remoting.transport.jgroups.JGroupsTransport: ISPN000094: Received new cluster view: [di2-37999|1] [di2-37999, di2-55654]