Docs/System & infrastructure/Running several servers (pools)
DartRelay 2.1 documentation
System & infrastructure

Running several servers (pools)

A pool is two or more DartRelay servers that share one database and sit behind a load balancer under one address. This page explains what a pool is for, what it does not do, how to add servers to one, and how to take a server out for maintenance without interrupting people.

What a pool is

Most installations need one DartRelay server. You might add more when:

Every server in a pool reads and writes the same database, so they share one configuration: the same Resources, users, themes, tenants, licence and settings. Change something in the console of any server and every server uses it. People reach the pool through one address on your load balancer, which decides which server handles each new visitor.

What a pool does not give you

Important

A pool is capacity and maintenance headroom. It is not failover, and it does not make DartRelay highly available.

What a pool needs

RequirementWhy
A shared database on SQL Server, MySQL or PostgreSQL that every server can reachAll configuration, sessions and seat counts live there. See Databases and migration.
A load balancer in front of the serversGives people one address, terminates HTTPS, and keeps each session on its server. See Load balancer and ADC integration.
The same DartRelay version on every serverSee above.
Every server able to reach your Windows hostsAny server may be asked to start any Resource.

Adding a server to a pool

Start with one working, activated installation that already uses a shared server database. Then, for each additional server:

  1. Run the installer on the new server. When it asks how the server is licensed, choose Another server for an existing installation (join a pool) ("This server shares a database with the others").
  2. Give it the details of the existing installation, including a join token from that installation. A join token can be used once and expires after 24 hours. The installer checks what you enter with the existing installation before anything is installed, and stops with a message if it would not work.
  3. Finish the installation. The new server joins the shared database. It does not need its own product key: it reads the licence from the database.
  4. Add it to your load balancer. Add the new server's address and port to the load balancer's server group, with the same health check as the others.
  5. Check it. Open the pool's address, sign in and launch something. In the browser's developer tools, the response header X-DartRelay-Node on the page request names the server that answered.
Note

Anything specific to one server, such as its identity in the pool, its database connection and whether it starts drained, is set by the installer in that server's own configuration file. Everything else is shared through the database. See Server configuration file.

What is shared and what belongs to one server

SettingWhere it lives
Resources, hosts, users, groups, themes, tenants, security settingsShared database: change once, applies everywhere.
Load balancer settings: trusted proxies, the appliance sign-in options, public URL, server name header, header sign-in and the sign-out addressShared, on System → Load balancer. A change reaches every server within about 30 seconds.
LicenceActivated once; every server reads it from the database.
Server identity in the pool, pool membership, the certificate that protects the pool's shared keys, start drained, database connectionEach server's own configuration file, written by the installer.

A value set in a server's configuration file overrides the console for that one server. That is meant as a break-glass measure only: a field set this way shows a set on this server marker on the Load balancer page and cannot be edited there. Keep load balancer settings in the console so every server behaves the same.

Taking a server out for maintenance (draining)

Draining tells the load balancer to stop sending new visitors to a server while leaving everyone already on it alone. When the last session on it ends, you can update or reboot that server without interrupting anyone.

DartRelay reports its state at /health/ready. A server answers 200 when it is ready for new work, and 503 when it is draining or cannot reach its database or remoting service. Your load balancer's health check should ask that address; see what any load balancer must do.

  1. Drain the server. On System → Load balancer, use Drain for the server you want to take out.
  2. Wait for the load balancer to notice. Its next health check gets 503 and it marks the server down. New sign-ins now go to the other servers.
  3. Wait for sessions to finish. Watch Monitoring live sessions or the Server column on System → Seats until nothing is left on that server, or ask the remaining users to save and sign out.
  4. Do the maintenance.
  5. Put the server back. Undo the drain on System → Load balancer. The next health check returns 200 and the load balancer starts sending visitors to it again.
Important

Draining only works if your load balancer actively checks /health/ready and leaves existing connections alone when a server is marked down. Open-source nginx does neither by default; see the nginx section of Load balancer and ADC integration for what to do instead.

Licensing and seats in a pool

See Licensing and Relay Seats for the seat rule itself.

When a request reaches the wrong server

A session's connection must reach the server that started it. If the load balancer sends it elsewhere, DartRelay refuses it rather than failing silently, and the user sees a message that the session is running on another server. This almost always means the load balancer is not keeping each visitor on one server; check its persistence (stickiness) setting.

Worked example

An accountancy firm has 120 staff and two DartRelay servers, relay-a and relay-b, behind a load balancer at relay.example.com, sharing a SQL Server database. On Tuesday evening the administrator needs to install Windows updates on relay-a. At 6 pm they drain relay-a. New sign-ins all go to relay-b. By 7:30 pm the last session on relay-a has ended; the administrator installs the updates, reboots, and undoes the drain. On Wednesday morning both servers take new sign-ins again. Nobody's work was interrupted, but if relay-a had failed outright at 6 pm instead, the people on it would have lost their open sessions and launched again on relay-b: that is the difference between a pool and failover.

If something goes wrong

Users see "running on another server"

The load balancer is not keeping each visitor on one server. Turn on cookie persistence (preferred) or source-address persistence. See what any load balancer must do.

Single sign-on from the load balancer works on one server only

A server's configuration file is overriding a shared setting. Open System → Load balancer on each server and look for fields marked set on this server.

Draining has no effect

The load balancer is not checking /health/ready, or it treats a down server by cutting its connections. Check its health monitor and its member-down behaviour.

Seat numbers look different on different servers

The servers are probably running different versions. Upgrade them all to the same version.

Every address in the audit log is the load balancer's

The load balancer is not in Trusted proxies, so DartRelay does not believe the client address it forwards. See Trusted proxies.

Still stuck? Email support@dartinnovations.com with what you were doing, what you expected and what you saw. A screenshot helps.