High Availability

Hey guys,

I just wanted to bounce some ideas around for HA…

I have prod server running discourse under nginx, which I need to install some plugins on. For various reasons, I can’t afford any downtime. There is also a test server running the same setup.

My plan is:

  1. Enable readonly mode in prod.
  2. Backup and restore to test, (restore from tombstone for the images)
  3. Update nginx on the prod box to repoint to test.
  4. Install plugins and rebuild
  5. Update nginx to point back to prod
  6. Disable readonly mode in prod
  7. Shutdown test app

How does that sound? What am I missing?

Happy to turn this into a How To… if there’s value in that :slight_smile:

Cheers

Rob

Cancel the above :slight_smile:

Looks like Docker is the thing I’m after.

You can minimize downtime rebuilding with a two container setup.

Just looking into this now.

I’m guessing I just create a second dir called /var/discourseB or something, then build a single container in that?

Is there a way to duplicate a container?

Will nginx run in both containers?

You create separate data and web containers. You can search here and look in the samples directory in /var/discourse

It looks like there’s a huge gap in the documentation between installing Discourse following this guide: https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md

and running separate containers using this guide: How to run separate web and data containers? - #2 by jamesmarkcook

How do I get one of the samples installed into a container?

Looks like you copy a sample into the containers folder, the run

./launcher rebuild <new container>

You can also copy an existing container for example

cp containers/app.yml containers/app2.yml

then rebuild this new app2 container with

./launch rebuild app2

The only thing I need to figure out now is how to make the outer nginx point to the right container, as the inner nginx is sitting in the shared container.

See How to move from standalone container to separate web and data containers

With your solution you could just put each instance on a different port and configure Nginx to use whichever one is available.

2 Likes