Discourse HA setup in network isolated env

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.

2 Likes

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.

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.

3 Likes

Thanks for the reply @Falco

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

1 Like

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?

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

1 Like

When I’m running the previously bootstrapped container image

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

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

1 Like

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.

1 Like

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

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

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.

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

That’s a sure way that will not work.

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

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

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.

No need for that, as long as you

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

3 app servers using for Redis cluster along with application.

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

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?

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

1 Like

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