Discourse double branch offices installation

I think it would be something like this:

  • split the Postgres database and Redis server out of the container (see howto about using an existing database server)
  • set up streaming replication for Postgres and a sentinel cluster for Redis (a 1-1-1 cluster, with the 3rd “C” server cloud somewhere)
  • set DISCOURSE_REDIS_SENTINELS in office A to the addresses of sentinels A,C
  • copy the web_only.yml to a server in office B
  • set DISCOURSE_DB_REPLICA_{HOST,PORT} to the office B replica, but DB_HOST/PORT to the office A (discourse/config/discourse_defaults.conf at main · discourse/discourse · GitHub)
  • set DISCOURSE_REDIS_HOST/PORT to the office B Redis server
  • set DISCOURSE_REDIS_SENTINELS in office B to sentinels B,C

Aaand there’s more to cover that I haven’t got into yet, like synchronizing uploads/backups (use S3 I guess?)

Now that I’m writing this down, I’m not actually sure that anyone has actually done this before. You might run into problems that require code changes.

edit: after reading about redis sentinel some more, I think my above advice is at least a little bit wrong. So, good luck!