在 EC2 上设置时因连接问题遇到困难

你好,我觉得自己很蠢,因为这看起来应该很明显,但我无法在运行 Ubuntu 18.04 AMI 的 AWS t2.medium 实例上完成 Docker 入门安装。

运行 ./discourse-setup 时,我不断遇到以下错误:

Status: Downloaded newer image for discourse/base:2.0.20200220-2221

app was not started !

./discourse-doctor may help diagnose the problem.

Found 4GB of memory and 2 physical CPU cores

setting db_shared_buffers = 1024MB

setting UNICORN_WORKERS = 4

containers/app.yml memory parameters updated.

Hostname for your Discourse? [discourse.example.com]: discuss.postera.ai

Checking your domain name . . .

WARNING:: This server does not appear to be accessible at discuss.postera.ai:443.

A connection to http://discuss.postera.ai (port 80) also fails.

This suggests that discuss.postera.ai resolves to the wrong IP address

or that traffic is not being routed to your server.

Google: "open ports YOUR CLOUD SERVICE" for information for resolving this problem.

我不确定问题是出在 app was not started,还是因为服务器无法访问。

我已经开放了端口 80 和 443 以允许所有流量,并添加了指向公共 IPv4 地址的 A 记录。在我的本地机器上运行 dighost 命令似乎表明 DNS 映射是正确的。

该实例位于 VPC 的公共子网中。我没有使用负载均衡器(之前试过但无法成功,以为是 nginx 的问题……)。

感谢您的帮助。

EC2 实例的安全组是否允许来自任意位置的 80 和 443 端口入站连接?

6 个赞

我已将它们设置为“任意位置”,出站规则也设置为“全部”,所以我怀疑问题不在这里!Screen Shot 2020-03-14 at 7.54.55 PM|690x243

大家好,这确实是我自己的一个愚蠢错误。我忘了在 Ubuntu 上更改主机名。在使用 DigitalOcean 时,你可以直接输入名称,这一点值得记住。

1 个赞

我不明白服务器的主机名如何会影响在容器内访问 FQDN。这真的很奇怪。

3 个赞