Hoe upgrade ik Discourse in een meervoudige containerconfiguratie?

AI-generated summary

In a discussion about upgrading Discourse in a multiple container setup, alexk asks whether it’s safe to upgrade one container at a time while keeping the other live to ensure zero downtime. pfaffman confirms this approach is correct but adds a critical detail: to avoid database incompatibility, the new container should be bootstrapped with SKIP_POST_DEPLOYMENT_MIGRATIONS: 1, then launched, and only after the old containers are offline should rake db:migrate be run with SKIP_POST_DEPLOYMENT_MIGRATIONS=0. alexk expresses relief, noting that database migrations were their primary concern and appreciates the guidance on controlling them.

Hello! I’ve just got a fresh multiple container Discourse install going and I’m wondering what my best upgrade method might be.

The documentation says:

Minimize downtime when upgrading to new versions of Discourse. You can bootstrap new web processes while your site is running and only after it is built, switch the new image in.

As I read this, I wonder if this means that it’s safe to run a previous version of Discourse live while the other container upgrades?

For example:

Let’s say I have two web-only containers running on separate VMs behind a load balancer. I take one of the container instances out of the load balancers, and I run bootstrap on the latest version. The old version is still in service for zero downtime (is that okay?). Next, I restore the updated container to the load balancer, and repeat the process on the other container.

That sounds about right, doesn’t it?

That’s about right. For true zero downtime upgrades, you need to bootstrap the new container with SKIP_POST_DEPLOYMENT_MIGRATIONS: 1, then launch, then, after the old containers are no longer running, run a SKIP_POST_DEPLOYMENT_MIGRATIONS=0 rake db:migrate. Otherwise, the bootstrap can (but does not for every upgrade) put the database in a state that the old container can’t use anymore.

Oh that’s awesome! Database migrations were exactly my concern, so it’s helpful to know how to control them!