# הגדרת Discourse HA בסביבה מבודדת רשת

**URL:** https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938
**Category:** Self-hosting
**Created:** [14 במרץ,‏ 2022,‏ 8:17pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938 "2022-03-14T20:17:36Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Veeru\_Badavath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/veeru_badavath/32/249978_2.png) [@Veeru\_Badavath](https://meta.discourse.org/u/Veeru_Badavath)
#### Post date: [14 במרץ,‏ 2022,‏ 8:17pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/1 "2022-03-14T20:17:36Z")

</div>

Thanks in advance.  
I’m planning setup discourse with high availability in production environment. The below are my design plan and some environment condition.

1. Setup with 3 application servers and 2 Postgres DB servers. Always one PG server on write mode and another in read only mode.

2. These 3 application servers will points to same DB server.

3. DB each instances should server read and write only operations respectively.

4. Production servers doesn’t have internet connectivity but I can pull dockerHub images.

5. We have our own GitLab server.

6. Is it possible to bootstrap docker image and that image on multiple servers?

Please anyone help for doing this setup. If any links or suggestions please PM me.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [14 במרץ,‏ 2022,‏ 8:57pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/2 "2022-03-14T20:57:04Z")

</div>

> [@Veeru\_Badavath](#):
>
> Is it possible to bootstrap docker image and that image on multiple servers?

After running `./launcher bootstrap app` _somewhere_ you will need to save that resulting container image (usually done by pushing it to a registry) and then download and run it on your three app servers.

> [@Veeru\_Badavath](#):
>
> Setup with 3 application servers and 2 Postgres DB servers.

You will also need a central Redis server (and potentially replicas for it). You are also missing a load balancer to direct requests for those different application servers.

---

<div class="post-metadata">

### Author: ![Veeru\_Badavath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/veeru_badavath/32/249978_2.png) [@Veeru\_Badavath](https://meta.discourse.org/u/Veeru_Badavath)
#### Post date: [15 במרץ,‏ 2022,‏ 1:01pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/3 "2022-03-15T13:01:07Z")

</div>

Thanks for the reply @Falco

We are using HAProxy load-balancer and Nexus repo for artifacts storing.

---

<div class="post-metadata">

### Author: ![Veeru\_Badavath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/veeru_badavath/32/249978_2.png) [@Veeru\_Badavath](https://meta.discourse.org/u/Veeru_Badavath)
#### Post date: [17 במרץ,‏ 2022,‏ 5:43pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/4 "2022-03-17T17:43:08Z")

</div>

Hi @Falco  
In my production env, I dont have internet access, so what I am planning is performing bootstrap on Internet accessible machine taking that bootstrap image to production servers. While doing this on production VM container is not coming up because Unicorn server looking some parent process ID so it is not running.

Please help me here, whether do I need copy bootstrap performed /var/discourse dir to production server?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [17 במרץ,‏ 2022,‏ 5:45pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/5 "2022-03-17T17:45:36Z")

</div>

> [@Veeru\_Badavath](#):
>
> While doing this

What is “this” ? The bootstrap or the running the previously bootstrapped container image?

---

<div class="post-metadata">

### Author: ![Veeru\_Badavath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/veeru_badavath/32/249978_2.png) [@Veeru\_Badavath](https://meta.discourse.org/u/Veeru_Badavath)
#### Post date: [17 במרץ,‏ 2022,‏ 5:46pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/6 "2022-03-17T17:46:23Z")

</div>

When I’m running the previously bootstrapped container image

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [17 במרץ,‏ 2022,‏ 6:11pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/7 "2022-03-17T18:11:48Z")

</div>

How did you save and exported the image to the production server?

How, exactly, are you trying to run this saved image in production?

---

<div class="post-metadata">

### Author: ![Veeru\_Badavath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/veeru_badavath/32/249978_2.png) [@Veeru\_Badavath](https://meta.discourse.org/u/Veeru_Badavath)
#### Post date: [17 במרץ,‏ 2022,‏ 6:17pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/8 "2022-03-17T18:17:23Z")

</div>

previously bootstrapped image pushing to Nexus repo and from Nexus repo pulling in production server.

docker run command generating from `./launcher start-cmd app` and running same command in production server.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [17 במרץ,‏ 2022,‏ 6:22pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/9 "2022-03-17T18:22:59Z")

</div>

Can you share the error log when starting it on production?

---

<div class="post-metadata">

### Author: ![Veeru\_Badavath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/veeru_badavath/32/249978_2.png) [@Veeru\_Badavath](https://meta.discourse.org/u/Veeru_Badavath)
#### Post date: [17 במרץ,‏ 2022,‏ 6:53pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/10 "2022-03-17T18:53:34Z")

</div>

```plaintext
run-parts: executing /etc/runit/1.d/00-ensure-links
run-parts: executing /etc/runit/1.d/00-fix-var-logs
run-parts: executing /etc/runit/1.d/01-cleanup-web-pids
run-parts: executing /etc/runit/1.d/anacron
run-parts: executing /etc/runit/1.d/cleanup-pids
Cleaning stale PID files
run-parts: executing /etc/runit/1.d/copy-env
Started runsvdir, PID is 42
chgrp: invalid group: ‘syslog’
ok: run: redis: (pid 51) 0s
ok: run: postgres: (pid 56) 0s
supervisor pid: 53 unicorn pid: 75
config/unicorn_launcher: line 71: kill: (75) - No such process
config/unicorn_launcher: line 15: kill: (75) - No such process
(53) exiting
ok: run: redis: (pid 51) 7s
ok: run: postgres: (pid 101) 0s
supervisor pid: 96 unicorn pid: 103
config/unicorn_launcher: line 71: kill: (103) - No such process
config/unicorn_launcher: line 15: kill: (103) - No such process
(96) exiting
ok: run: redis: (pid 51) 14s
ok: run: postgres: (pid 127) 0s
supervisor pid: 120 unicorn pid: 129
config/unicorn_launcher: line 71: kill: (129) - No such process
config/unicorn_launcher: line 15: kill: (129) - No such process
(120) exiting
ok: run: redis: (pid 51) 22s
timeout: down: postgres: 0s, normally up, want up
ok: run: redis: (pid 51) 30s
timeout: down: postgres: 1s, normally up, want up
ok: run: redis: (pid 51) 37s
ok: run: postgres: (pid 174) 0s
supervisor pid: 165 unicorn pid: 176
config/unicorn_launcher: line 71: kill: (176) - No such process
config/unicorn_launcher: line 15: kill: (176) - No such process
(165) exiting
ok: run: redis: (pid 51) 48s
ok: run: postgres: (pid 196) 1s
supervisor pid: 191 unicorn pid: 198
config/unicorn_launcher: line 71: kill: (198) - No such process
config/unicorn_launcher: line 15: kill: (198) - No such process
(191) exiting
ok: run: redis: (pid 51) 54s
timeout: down: postgres: 1s, normally up, want up

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [17 במרץ,‏ 2022,‏ 7:51pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/11 "2022-03-17T19:51:40Z")

</div>

Are you using an external PostgreSQL, Redis and Object Storage? That is expected when doing HA, and both your production servers and the build servers need to have access to those external services.

---

<div class="post-metadata">

### Author: ![Veeru\_Badavath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/veeru_badavath/32/249978_2.png) [@Veeru\_Badavath](https://meta.discourse.org/u/Veeru_Badavath)
#### Post date: [17 במרץ,‏ 2022,‏ 8:13pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/12 "2022-03-17T20:13:21Z")

</div>

Just testing the scenario, bootstrap performing on one server and running bootstrapped container image on another server with standalone setup.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [17 במרץ,‏ 2022,‏ 8:15pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/13 "2022-03-17T20:15:06Z")

</div>

That’s a sure way that will not work.

---

<div class="post-metadata">

### Author: ![Veeru\_Badavath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/veeru_badavath/32/249978_2.png) [@Veeru\_Badavath](https://meta.discourse.org/u/Veeru_Badavath)
#### Post date: [17 במרץ,‏ 2022,‏ 8:19pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/14 "2022-03-17T20:19:26Z")

</div>

Any reason for mentioning object storage, can’t we use server internal storage?

---

<div class="post-metadata">

### Author: ![Veeru\_Badavath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/veeru_badavath/32/249978_2.png) [@Veeru\_Badavath](https://meta.discourse.org/u/Veeru_Badavath)
#### Post date: [17 במרץ,‏ 2022,‏ 8:20pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/15 "2022-03-17T20:20:54Z")

</div>

In HA setup do we need to copy bootstrap performed **discourse** directory in all app server?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [17 במרץ,‏ 2022,‏ 8:34pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/16 "2022-03-17T20:34:45Z")

</div>

> [@Veeru\_Badavath](#):
>
> Any reason for mentioning object storage, can’t we use server internal storage?

How are you going to handle multiple app servers and user uploads? A shared network drive between all servers? That may work, but our official solution for that is Object Storage using the S3 API.

> [@Veeru\_Badavath](#):
>
> In HA setup do we need to copy bootstrap performed **discourse** directory in all app server?

No need for that, as long as you

> [@Falco](#):
>
> Are you using an external PostgreSQL, Redis and Object Storage

---

<div class="post-metadata">

### Author: ![Veeru\_Badavath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/veeru_badavath/32/249978_2.png) [@Veeru\_Badavath](https://meta.discourse.org/u/Veeru_Badavath)
#### Post date: [17 במרץ,‏ 2022,‏ 8:43pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/19 "2022-03-17T20:43:26Z")

</div>

> [@Falco](#):
>
> Are you using an external PostgreSQL, Redis and Object Storage

Yes, I’m using external Postgres server and redis cluster

> [@Falco](#):
>
> Are you using an external PostgreSQL, Redis and Object Storage

3 app servers using for Redis cluster along with application.

> [@Falco](#):
>
> How are you going to handle multiple app servers and user uploads? A shared network drive between all servers? That may work, but our official solution for that is Object Storage using the S3 API.

So I need to use shared dir/storage for **discourse** build dir. Thank you @Falco now it is clear for me.

---

<div class="post-metadata">

### Author: ![Veeru\_Badavath](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/veeru_badavath/32/249978_2.png) [@Veeru\_Badavath](https://meta.discourse.org/u/Veeru_Badavath)
#### Post date: [17 במרץ,‏ 2022,‏ 8:49pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/20 "2022-03-17T20:49:26Z")

</div>

sorry for troubling you @Falco, I have one last query.

When performing rebuild step, will it impact existing Data in Postgres DB? if yes then how to handle it?

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [17 במרץ,‏ 2022,‏ 8:55pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/21 "2022-03-17T20:55:09Z")

</div>

> [@Veeru\_Badavath](#):
>
> When performing rebuild step, will it impact existing Data in Postgres DB? if yes then how to handle it?

Yes, there are migrations that will be ran during a rebuild, that will change both data and structure.

In an HA environment you will need to follow the guidance we have here: [Introducing Post Deployment Migration](https://meta.discourse.org/t/introducing-post-deployment-migration/98974)

---

<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: [16 באפריל,‏ 2022,‏ 8:55pm UTC](https://meta.discourse.org/t/discourse-ha-setup-in-network-isolated-env/220938/22 "2022-04-16T20:55:19Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
