提前感谢。
我计划在生产环境中设置高可用性的 Discourse。以下是我的设计计划和一些环境条件。\n\n1. 设置3台应用服务器和2台Postgres数据库服务器。一台PG服务器始终处于写入模式,另一台处于只读模式。\n\n2. 这3台应用服务器将指向同一个数据库服务器。\n\n3. 每个数据库实例应分别处理读写操作。\n\n4. 生产服务器没有互联网连接,但我可以拉取dockerHub镜像。\n\n5. 我们有自己的GitLab服务器。\n\n6. 是否可以将docker镜像引导并在多台服务器上运行?\n\n请有人帮助我完成此设置。如果有任何链接或建议,请给我发私信。
在某个地方运行 ./launcher bootstrap app 后,您需要保存生成的容器镜像(通常通过将其推送到注册表来完成),然后将其下载并运行到您的三个应用程序服务器上。
您还需要一个中央 Redis 服务器(可能还有它的副本)。您还缺少一个负载均衡器来将请求定向到那些不同的应用程序服务器。
感谢您的回复@Falco
我们正在使用HAProxy负载均衡器和Nexus仓库来存储构件。
您好 @Falco
在我的生产环境中,我没有互联网访问权限。因此,我计划在具有互联网访问权限的机器上执行引导,然后将该引导映像传输到生产服务器。在生产 VM 上执行此操作时,容器无法启动,因为 Unicorn 服务器正在查找某个父进程 ID,因此它没有运行。
请在此方面提供帮助,我是否需要将执行的引导 /var/discourse 目录复制到生产服务器?
“此操作”是指什么?是引导程序还是运行先前已引导的容器映像?
当我运行之前引导的容器映像时
您是如何将图像保存并导出到生产服务器的?
您具体是如何尝试在生产环境中运行此已保存图像的?
之前引导的镜像推送到 Nexus 仓库,然后从 Nexus 仓库拉取到生产服务器。
docker run 命令从 ./launcher start-cmd app 生成,并在生产服务器上运行相同的命令。
在生产环境中启动时,能否分享一下错误日志?
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
您是否正在使用外部 PostgreSQL、Redis 和对象存储?这是高可用性 (HA) 的预期配置,您的生产服务器和构建服务器都需要能够访问这些外部服务。
只是测试场景,在一个服务器上执行 bootstrap,并在另一个服务器上运行带有独立设置的引导容器映像。
那肯定行不通。
提到对象存储有什么原因吗?我们不能使用服务器内部存储吗?
在 HA 设置中,是否需要将执行的 discourse 引导目录复制到所有应用程序服务器?
您将如何处理多个应用程序服务器和用户上传?在所有服务器之间共享网络驱动器?这也许可行,但我们官方的解决方案是使用对象存储,通过 S3 API。
不需要,只要您
是的,我正在使用外部 Postgres 服务器和 Redis 集群
3 个应用程序服务器与应用程序一起用于 Redis 集群。
所以,我需要为 Discourse 的构建目录使用共享目录/存储。谢谢您 @Falco,现在我明白了。
抱歉打扰您了@Falco,我还有一个问题。
执行重建步骤时,会影响Postgres数据库中现有的数据吗?如果会,该如何处理?
是的,重建过程中会运行一些迁移,这些迁移会更改数据和结构。
在 HA 环境中,您需要遵循我们在此处的指南:Introducing Post Deployment Migration
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.