Studio Clustering

Any number of Crafter Studio instances can be clustered, where multiple servers, each with their own Crafter Studio installed, act like a single Crafter Studio to the end users.

Crafter Studio by default is not configured for clustering. This section describes how to configure Crafter Studio for clustering. The configuration setup for one node or multiple nodes is the same.

Crafter CMS Authoring Clustering

Requirements

Before we begin configuring Studio for clustering, the following must be setup:

  1. An external MariaDB database, such as Amazon RDS for MariaDB , Azure Database for MariaDB or setup a server with MariaDB which can be downloaded here. Crafter Studio only supports MariaDB 10.1 for the shared database when clustering, so remember to use the MariaDB 10.1 Series
  2. A load balancer with sticky session support enabled

Clustering Setup

To setup your Crafter Studio to be part of a cluster, open the studio-config-overrides.yaml file (found in your Authoring installation, under bin/apache-tomcat/shared/classes/crafter/studio/extension)

Below is a sample configuration to setup a server with Crafter Studio installed for clustering, with the MariaDB database on 192.168.1.1 and the Crafter Studio being added to the cluster on 192.168.1.14:

bin/apache-tomcat/shared/classes/crafter/studio/extension/studio-config-override.yaml
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
##################################################
##                 Clustering                   ##
##################################################
# Clustering requires an external (not embedded) database, configure it below
# External MariaDB database connection string
studio.db.url: jdbc:mariadb://192.168.1.1:3306/crafter?user=crafter&password=crafter
# External MariaDB database connection string used to initialize database
# If using a database with an already created schema and user (like AWS RDS):
# studio.db.initializer.url: jdbc:mariadb://192.168.1.1:3306/crafter?user=USER&password=PASS
# If using a an empty database with root access to it:
studio.db.initializer.url: jdbc:mariadb://192.168.1.1:3306?user=root&password=

# Cluster Syncers
# Sandbox Sync Job interval which is how often to sync the work-area in msec
studio.clustering.sandboxSyncJob.interval: 2000
# Published Sync Job interval which is how often to sync the published repos
studio.clustering.publishedSyncJob.interval: 60000
# Cluster member after heartbeat stale for amount of minutes will be declared inactive
studio.clustering.heartbeatStale.timeLimit: 5
# Cluster member after being inactive for amount of minutes will be removed from cluster
studio.clustering.inactivity.timeLimit: 5

# Cluster member registration, this registers *this* server into the pool
# Cluster node registration data, remember to uncomment the next line
studio.clustering.node.registration:
#  this server's local address (reachable to other cluster members)
  localAddress: 192.168.1.14
#  authentication type to access this server's local repository
#  possible values
#   - none (no authentication needed)
#   - basic (username/password authentication)
#   - key (ssh authentication)
  authenticationType: basic
#  username to access this server's local repository
  username: user
#  password to access this server's local repository
  password: SuperSecurePassword
#  private key to access this server's local repository (multiline string)
#  privateKey: |
#    -----BEGIN PRIVATE KEY-----
#    privateKey
#    -----END PRIVATE KEY-----

Modify the values in the clustering section of your studio-config-overrides.yaml file with values from your setup and save the file then start Studio.

Cluster Menu

To view nodes in the cluster in your browser, click on Main Menu on the top right, then click on Cluster from the menu on the left. In the image below, we have one node in the cluster with local address 192.168.1.14 and authentication type used is basic:

Crafter CMS Authoring Cluster with One Node

As you start up new Crafter Studio nodes, they will automatically join the cluster, the Cluster menu will list them like below:

Crafter CMS Authoring Cluster with Two Node

In the cluster screen, it also gives an indication whether a node is ACTIVE (healthy) or INACTIVE (not healthy). When a node is INACTIVE, the user is given an option to delete the node from the cluster immediately, or it will be automatically removed in time.

Crafter CMS Authoring Cluster with an Inactive Node