Configuring a Cluster State Database
The cluster state database stores a single copy of Seq configuration (users, API keys, signals, dashboards, etc.) shared by all Seq nodes in the cluster.
The cluster nodes also use the database as a consensus broker for cluster membership and leader elections. The nodes participating in the cluster each contact the database approximately once per second in normal operation.
The cluster state database does not store application log data, traces, or indexes: each node maintains its own local replica of these. For that reason, the cluster state database isn't sufficient to preserve all of the cluster's data in the absence of any Seq nodes.
Seq supports cluster state databases on recent Microsoft SQL Server and PostgreSQL versions, including cloud variants of these such as Azure SQL Database and Amazon RDS.
Choose the database engine you are most familiar with and confident operating, from a vendor that can provide adequate support. The Seq support team will be glad to help with database configuration, but cannot troubleshoot all possible database configuration issues.
Database and User Account
These instructions assume a server or cluster of either database engine has already been provisioned.
In production settings, Seq should use a separate database (catalog) and user account (login) from any other application. The Seq user should have full control of the Seq database, so that schema migrations can be performed automatically, but should not otherwise have administrative access to the server.
The examples below show the essentials of configuring a Seq database and user account with username/password authentication on each supported database engine.
The example SQL statements below are illustrative: correct, secure, optimal configuration will depend on your chosen database.
CREATE LOGIN SeqLogin WITH PASSWORD = 'YourSecurePa$$wordHere!';
GO
CREATE DATABASE Seq;
GO
USE Seq;
GO
ALTER AUTHORIZATION ON DATABASE::Seq TO SeqLogin;
GO
Connection Strings
Cluster Worksheet Update
Add the Cluster State Database Connection String to the cluster worksheet.
Seq nodes use .NET connection strings to configure the cluster state database connection. Connection string syntax varies depending on which database platform is used:
Below are example connection strings for the simple database configurations shown in the previous step, assuming the database server hostnames mssql.local
and pgsql.local
:
Server=mssql.local,1433;User Id=SeqUser;Password=YourSecurePa$$wordHere!;
Note that non-production test configurations using Microsoft SQL Server without a trusted server certificate will need to append the insecure option TrustServerCertificate=True;
to the connection string.
Updated about 1 month ago