【发布时间】:2021-04-23 16:24:56
【问题描述】:
情况:
我正在关注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
虽然我将所有步骤重复了两次,但我仍然遇到错误消息。
一定少了点什么。
编辑:
我的防火墙规则:
【问题讨论】:
-
你能在你的服务器上通过 SSH 验证服务是否在监听 8080 端口吗?即 netstat --listen 我还会检查您的服务器是否使用标签“http-server”。你可以运行“gcloud compute instances describe”
-
@Carlos 好像没有监听 8080 端口。netstat --listen 命令的输出中至少没有出现“8080”
-
好的,至少我们知道服务已关闭。您在串行控制台中是否遇到任何错误?它是否显示启动脚本成功运行并安装了应用程序?
-
这个命令“gcloud compute instances get-serial-port-output my-app-instance --zone us-central1-f”是否返回了教程中讨论的成功(即:“完成运行启动脚本”)?
-
@Coder1000 你能解决这个问题吗?如果是这样,请提供解决方案作为自我回答,这也将有助于社区遇到类似问题。
标签: node.js google-cloud-platform google-compute-engine