jakimfett
(jakimfett)
2017 年 1 月 3 日午前 7:58
1
Has anyone played with a HAProxy/nginx/etc?
I could have sworn there was a how-to guide for a way to do distributed hosting, either via Docker or via multiple instances of Discourse all hitting a single high availability database server, but I can’t seem to find a guide for it.
Any thoughts? I’m currently serving a small single Discourse site, but am interested in learning as much as I can about scaling and load balancing of Discourse.
「いいね!」 5
jakimfett
(jakimfett)
2017 年 1 月 3 日午前 8:11
2
Found it , less than fifteen minutes after I posted. I’ll put any info on snags or clarifications that might be helpful into the conversation here.
jakimfett
(jakimfett)
2017 年 1 月 3 日午前 8:18
3
The documentation is very fragmented. I’m going to attempt to pull it all together here.
Any chance I could get some input from @nx2zdk or @jspdng ?
This is an advanced setup. Don’t follow this unless you are experienced with Linux server administration and Docker.
Hello everyone!
If you don’t want to mess with the firewall rules and security of your server, you can configure your Docker multiple container setup with just links and no exposed ports!
This way you can share your data container (postgres/redis) with other containers without exposing it to the internet.
How to
Edit your data.yml file commenting all the expose …
Multiple Container setup
If you would like to connect web-only and data Discourse docker containers.
There is optional setting for this, which is, you could specify a links key in container configuration (yaml file) to link those containers together ( i.e. linking web-only and data container ).
This way is also known as Docker --link flag.
Usage:
If you are trying to link database container to your web container
Add the following section in containers/web.yml
links:
- link:
name:…
jakimfett
(jakimfett)
2017 年 1 月 3 日午後 3:49
4
Info on avoiding port exposure:
Just in case anybody stumbles here for running several Discourse instances behind https://github.com/jwilder/nginx-proxy:
Set discourse to listen on a local link port and tell the proxy to use the container’s internal port 80 like
expose:
- "127.0.0.1:2836:80"
env:
VIRTUAL_PORT: '80'
Load balancing with nginx:
Enabling http2 on Debian:
Offline page setup:
This guide is intended for advanced users, who are already using nginx outside the docker container. By following this guide you make your setup more complicated and will loose some speed benefits like HTTP2 if you’re not running Ubuntu 16.04 or later. Proceed with caution!
When Discourse is rebuilding or starting up, your users will usually either see an error message from their browser…
[image]
…or a not-so-nice 502 error message from Nginx:
[image]
If you’re a perfectionist l…
Assma
2024 年 12 月 18 日午後 10:27
5
他では明確な答えが見つかりませんでした。
Discourse のスタンドアロン インストールは、標準環境でのシンプルさと堅牢性から推奨されていると理解しています。しかし、高可用性 (HA) を提供するために、スタンドアロン モードを複数のコンテナに拡張する (29413 ) という提案もあれば、完全に分離されたデプロイメントを再設計するという提案もあります。
質問1: HA は、信頼性の高いフェイルオーバーを備えたサービスの複製 (Web および DB) に関することですが、Discourse は Web サービスと DB の両方がコンテナ内でレプリケートされるようなソリューションを提案していますか?
質問2: Web サービスの場合、インスタンス間の負荷分散を確保するためにロードバランサーが必要になります。Discourse の専門家やコミュニティの推奨事項は何ですか?
質問3: コンテナ化された DB の HA について、PostgreSQL レプリケーションを管理する最も好ましい方法はどのようなものですか?
質問4: Redis についても同様の質問です。
pfaffman
(Jay Pfaffman)
2024 年 12 月 19 日午後 7:56
6
Postgres のフェイルオーバーに対処する方法はたくさんあります。好きなものを使用できます。
CDCK ホスティングは HA-proxy を使用しています。私が知る限りでは。好きなロードバランサーを使用でき、(ほとんどの場合) /srv/status を準備完了インジケーターとして使用できます。
「いいね!」 1