# High Availability

**URL:** https://meta.discourse.org/t/high-availability/71311
**Category:** Self-hosting
**Created:** [October 3, 2017, 11:31am UTC](https://meta.discourse.org/t/high-availability/71311 "2017-10-03T11:31:02Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Rob\_Spencer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_spencer/32/79869_2.png) [@Rob\_Spencer](https://meta.discourse.org/u/Rob_Spencer)
#### Post date: [October 3, 2017, 11:31am UTC](https://meta.discourse.org/t/high-availability/71311/1 "2017-10-03T11:31:02Z")

</div>

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 🙂

Cheers

Rob

---

<div class="post-metadata">

### Author: ![Rob\_Spencer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_spencer/32/79869_2.png) [@Rob\_Spencer](https://meta.discourse.org/u/Rob_Spencer)
#### Post date: [October 3, 2017, 12:49pm UTC](https://meta.discourse.org/t/high-availability/71311/2 "2017-10-03T12:49:49Z")

</div>

Cancel the above 🙂

Looks like Docker is the thing I’m after.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 3, 2017, 1:12pm UTC](https://meta.discourse.org/t/high-availability/71311/3 "2017-10-03T13:12:25Z")

</div>

You can minimize downtime rebuilding with a two container setup.

---

<div class="post-metadata">

### Author: ![Rob\_Spencer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_spencer/32/79869_2.png) [@Rob\_Spencer](https://meta.discourse.org/u/Rob_Spencer)
#### Post date: [October 3, 2017, 1:22pm UTC](https://meta.discourse.org/t/high-availability/71311/4 "2017-10-03T13:22:16Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 3, 2017, 1:28pm UTC](https://meta.discourse.org/t/high-availability/71311/5 "2017-10-03T13:28:32Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Rob\_Spencer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_spencer/32/79869_2.png) [@Rob\_Spencer](https://meta.discourse.org/u/Rob_Spencer)
#### Post date: [October 3, 2017, 1:48pm UTC](https://meta.discourse.org/t/high-availability/71311/6 "2017-10-03T13:48:31Z")

</div>

It looks like there’s a huge gap in the documentation between installing Discourse following this guide: [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](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](https://meta.discourse.org/t/how-to-run-separate-web-and-data-containers/26361/2)

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

---

<div class="post-metadata">

### Author: ![Rob\_Spencer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_spencer/32/79869_2.png) [@Rob\_Spencer](https://meta.discourse.org/u/Rob_Spencer)
#### Post date: [October 3, 2017, 2:45pm UTC](https://meta.discourse.org/t/high-availability/71311/7 "2017-10-03T14:45:06Z")

</div>

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

```

---

<div class="post-metadata">

### Author: ![Rob\_Spencer](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rob_spencer/32/79869_2.png) [@Rob\_Spencer](https://meta.discourse.org/u/Rob_Spencer)
#### Post date: [October 3, 2017, 3:06pm UTC](https://meta.discourse.org/t/high-availability/71311/8 "2017-10-03T15:06:42Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [October 3, 2017, 3:38pm UTC](https://meta.discourse.org/t/high-availability/71311/9 "2017-10-03T15:38:22Z")

</div>

See [Move from standalone container to separate web and data containers](https://meta.discourse.org/t/how-to-move-from-standalone-container-to-separate-web-and-data-containers/29413)

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

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [October 30, 2019, 8:53pm UTC](https://meta.discourse.org/t/high-availability/71311/10 "2019-10-30T20:53:53Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [July 15, 2023, 3:04am UTC](https://meta.discourse.org/t/high-availability/71311/11 "2023-07-15T03:04:41Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [July 15, 2023, 5:28am UTC](https://meta.discourse.org/t/high-availability/71311/12 "2023-07-15T05:28:23Z")

</div>


