Set up a cluster#

A cluster is set up in a fixed order. The first node keeps its metabase, which becomes the cluster’s; the second node is installed on a metabase of its own, which it leaves when it joins. Cluster mode is switched on in each node’s instance configuration file, never by the installer.

Before you start, meet the Cluster requirements: a metabase with synchronous high availability, the group managed service account, the cluster name in DNS, a certificate on each node that carries the cluster name, and the service principal name.

The examples use the cluster name db-cluster.contoso.com and the nodes NODE-A (first) and NODE-B (second).

1. Install both nodes#

  1. Install Querona on NODE-A against the cluster’s metabase. In the instance parameters step, tick Cluster node and keep or change the Administrative port (8080 by default); see Install Querona. Select the node’s certificate, which carries the cluster name. As the service account, enter the group managed service account with its trailing $ and no password (see Group managed service account).

  2. Install Querona on NODE-B the same way, with the same TDS, web and administrative ports, but against a metabase of its own, for example a new database on the same SQL Server. Nothing that the installation on NODE-B writes into that metabase goes into the cluster.

Nothing listens on the administrative port until cluster mode is switched on.

2. Give the instance master key a password-protected copy#

The second node gets the instance master key from a password-protected copy that the first node stores in the metabase. On NODE-A:

CREATE MASTER KEY ENCRYPTION BY PASSWORD = '<password>';
EXEC qua_security_verify;

master-key.portable-copy reports PASS. Keep the password with the cluster’s recovery material: whoever knows it and can read the metabase can recover every stored credential. See Set up the master key of a cluster.

3. Run the preflight on both nodes#

On NODE-A, whose metabase becomes the cluster’s:

EXEC qua_cluster_preflight @cluster_name = N'db-cluster.contoso.com';

Fix every finding with the status FAIL and review every WARN. The checks see the configuration the node runs with, so restart the Querona service after a change to instance.config before you run the procedure again.

On NODE-B, run the same statement against its own metabase and read only the rows addressing.cluster-name, addressing.spn and addressing.certificate: the checks of its host. Its other rows describe a metabase that is discarded. Everything that depends on the cluster’s metabase runs on NODE-B when it first starts in cluster mode, and its findings appear in its log.

See qua_cluster_preflight for every check.

4. Provision the cluster#

On NODE-A, check what would be provisioned, then provision. Give the thumbprint of NODE-B’s own certificate:

EXEC qua_cluster_provision @cluster_name = N'db-cluster.contoso.com', @node2_host_name = N'NODE-B',
     @node2_ssl_thumbprint = N'<NODE-B certificate thumbprint>', @dry_run = 1;

EXEC qua_cluster_provision @cluster_name = N'db-cluster.contoso.com', @node2_host_name = N'NODE-B',
     @node2_ssl_thumbprint = N'<NODE-B certificate thumbprint>';

The procedure writes the cluster into the metabase, in manual failover mode, and returns, for each node, the settings its instance.config needs (see Instance configuration settings). NODE-B’s instance settings in the metabase are a copy of NODE-A’s, with NODE-B’s certificate thumbprint and, where NODE-A’s Data API certificate subject is its computer name, NODE-B as the subject. Keep the result. See qua_cluster_provision.

From now on NODE-A no longer starts outside cluster mode, and it serves without the protection of the lease until it is restarted in cluster mode.

5. Switch cluster mode on, first node first#

  1. On NODE-A, stop the Querona service, set the settings the procedure returned for NODE-A in C:\ProgramData\Querona\conf\instance.config, and start the service. The node takes the lease and serves clients.

  2. On NODE-B, stop the Querona service and create the master key passphrase file, as described in Join the second node of a cluster.

  3. Set the settings the procedure returned for NODE-B in its instance.config, including the MetadataConnectionString of the cluster’s metabase. When the procedure returned that value empty - because the first node’s connection string holds a password or names the server as a local alias - type it yourself.

  4. Start the service on NODE-B. Its log reports The master key passphrase file was applied and a Cluster: preflight line for each check that needs the cluster’s metabase. The node waits as the standby.

Start NODE-A in cluster mode before NODE-B. A node in cluster mode does not start while the other node still runs outside cluster mode, and its log names the other node’s sessions in the metabase.

6. Check the cluster#

  1. Sign in to the Administrative Portal under the cluster name and open MONITOR ‣ Cluster (see Cluster). Both nodes are Up, NODE-A holds the lease, the master key is usable on both, and NODE-B is Ready to take over.

  2. Read the Cluster: preflight lines in the log of each node and fix every FAIL.

  3. Move the role once with a planned failover, EXEC qua_cluster_failover;, and run EXEC qua_security_verify; on NODE-B while it serves (see Cluster operations and recovery).

The cluster stays in manual failover mode; keep it there (see Clustering).

Instance configuration settings#

Each node reads its instance configuration file, C:\ProgramData\Querona\conf\instance.config by default, once when the Querona service starts. A change takes effect at the next start.

Setting

Set by

Meaning on a cluster node

ClusterModeEnabled

You, from the provisioning result

true makes the node a cluster member: it checks its identity and the cluster against the metabase at start, opens its client ports only while it serves, and does not open the inter-node channel. false (the default) runs the node as a single installation, which a metabase that holds a cluster refuses. The installer never sets it.

InstanceId

Provisioning result

The node’s instance identifier in the metabase. The two nodes have different identifiers.

InstanceName

Provisioning result

The node’s instance name; by default the second node’s is its computer name.

AdministrativeHttpPort

Installer (Cluster node), provisioning result

The administrative HTTP port the node opens in every role, for the health probes and the node management page. It must differ from the TDS and web ports.

MetabaseEngineType

Provisioning result

MSSql: a cluster node runs only on a SQL Server metabase.

MetadataConnectionString

Installer; for the second node, the provisioning result or you

The connection to the cluster’s metabase, in the form that matches its high availability model (see Cluster requirements). When the value starts with dpapi1:, replace it with the complete plain connection string; the next upgrade protects it again.

ClusterPilotMode

You, on each node that needs it

true lets the node start while stored credentials are still under the shared secret, for a pilot cluster only. Not returned by provisioning, and off by default. See Pilot cluster on the shared secret.

SharedSecret

Installer

Not used by a cluster node outside a pilot, but keep it: the installer reads it at an upgrade over a metabase reached with SQL authentication, and such an upgrade over an instance.config without it fails.

IsDefaultPrimary

Installer

No effect in cluster mode: the lease decides which node serves.

ClusterPilotMode and SharedSecret belong to the node and are not stored in the metabase, so set them on each node yourself.

See also#