node.js - 计算引擎 : "This site can’ t be reached"

标签 node.js google-cloud-platform google-compute-engine

情况:

我关注 this教程。

当我到达创建实例并执行必要命令的部分时,我会看到以下内容:

To see the application running, go to http://[YOUR_INSTANCE_IP]:8080,

where [YOUR_INSTANCE_IP] is the external IP address of your instance.

问题:

页面无法加载。我收到以下错误消息:

This site can’t be reached

问题:

可能出了什么问题?

之前的所有步骤都运行良好,我可以在本地访问我的网站。

我通过检查等待 Compute Engine 实例准备就绪:

gcloud compute instances get-serial-port-output my-app-instance --zone us-central1-f 

虽然我重复了所有步骤两次,但我仍然遇到错误消息。

一定少了点什么。


编辑:

我的防火墙规则:

enter image description here

最佳答案

我猜你没有将防火墙标签应用于实例?

首先,您可以检查您的计算实例标签。

gcloud compute instances describe my-app-instance

在您的示例中,您应该在标签项中看到 http-server,如下所示

tags:
  fingerprint: xxxxxxx
  items:
  - http-server
  - https-server

如果不存在,则应将标签添加到现有 VM 实例,使用此 gcloud 命令:

gcloud compute instances add-tags [YOUR_INSTANCE_NAME] --tags http-server,https-server

要在创建实例时添加标签,请在语句中包含该标志:

gcloud compute instances create [YOUR_INSTANCE_NAME] --tags http-server,https-server

关于node.js - 计算引擎 : "This site can’ t be reached",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42098008/

相关文章:

javascript - Node JS 与 C++ 集成

javascript - 尝试注册两个具有相同名称 RCTVideo 的 View

node.js - koa中独立的路由器和 Controller

python - 从 GCP 安装文档运行 "[CRITICAL] WORKER TIMEOUT"时,日志中的 "Hello Cloud Run with Python"

node.js - Electron在特定应用中打开文件/目录

node.js - 无法使用 google-cloud-node 设置 Cache-Control max-age header

google-cloud-platform - Terraform GCP 虚拟机实例创建 - 错误 403

google-cloud-platform - GCP - 如何使用 gcloud 过滤启动磁盘?

php - "Heavy"并发用户数 Nginx - Laravel - Google 计算引擎

google-cloud-platform - 如何使用 terraform 在 Google Compute Engine 上启用允许 HTTP 流量/允许 HTTP 流量