CrushMFT Documentation

This page in: CrushFTP 11, CrushFTP 10

Session replication#

When a user logs in on the web, the server they logged in on remembers them: that is the session. With several servers behind one address, the user's next click may land on another server, which has never seen them. This page is about what happens then, and the two ways to deal with it.

It concerns the web interface and other logins over HTTP and HTTPS. A connection by SFTP or FTP stays on one server for as long as it lasts; if that server fails, the program connects and logs in again, on whichever server answers.

What happens without anything#

A server that gets a request with a login it does not know treats it as no login: the user is sent to the login page. Behind a load balancer that spreads every request freshly, a user would be thrown out every few clicks.

Way 1: keep each user on one server#

Tell the load balancer to send all requests of one user to the same server: by the user's address, or by a cookie of the balancer's own. Balancers call it "sticky sessions" or "session persistence".

  • Nothing to set on the servers.
  • A user stays logged in for as long as their server is up. When it fails, they log in again on another. Transfers under way are tried again by the browser.

This is the usual way, and for most installations it is enough. See A load balancer in front.

Way 2: let the servers find the session#

A server that does not know a login asks the other servers of the cluster who does. The one that does answers, and the first server passes the request on to it and hands the answer back. The user notices nothing.

Server setting Does Unless you change it
http_token_replication_lookup_allowed turns this on false
session_hop_verify_names the names the other server's certificate is checked against when a request is passed on. Empty: the names of this server's own certificate. empty

How it goes:

  1. The server asks its peers over the replication link, and waits up to 5 seconds for an answer.
  2. It remembers the answer for 5 minutes, so the next requests of that user go straight on.
  3. It passes each request on to the same port on the other server, over HTTPS.

Between members of a cluster the other server's certificate is checked against what that member itself reports, so nothing has to be set for it.

What to know:

  • The request makes a detour through a second server. For clicks that is unnoticeable; for a large upload it is the whole upload going through two servers.
  • It needs each server to reach the others' web ports.
  • When the server that holds the session is down, there is nobody to answer: the user logs in again.

It is a good safety net under way 1: the balancer keeps users on one server, and on the rare request that strays, the servers sort it out.

Which to use#

You have Use
a load balancer that can keep users on a server way 1, with way 2 under it if you like
a load balancer that cannot, or DNS spreading way 2
a rule that a server failure must not end sessions not possible: a session lives on the server that holds it, and when that server fails its users log in again. CrushFTP 11's way of copying every session to every server (replicate_sessions9) could never be turned on in CrushMFT 27 and is gone.
ServerBeat: one server working, one waiting none while things are fine: everybody is on the one server. When the address moves, users log in again.

Logins that are not sessions#

  • Access tokens of the API are known to all servers of a cluster: they are replicated as they are issued. A program with a token can talk to any server. See Access tokens.
  • Single sign-on. A login through SAML or OpenID Connect that begins on one server must end on the same one. Way 1 takes care of that; without it, use way 2.
  • Two-factor codes are checked by the server the login is on; nothing has to be shared for them beyond the users.

Things to know#

  • Sessions end by themselves after their time without use, on whichever server holds them. See the session time-outs in Preferences.
  • The same sealing keys. The login page seals the password in the browser with a key of the server. In a cluster those keys are shared, so a login page fetched from one server can be answered by another.
  • A DMZ holds no sessions of its own in this sense: it passes logins to its server.
  • Nothing here was run for this page: the settings and their behaviour are from the server's code.