我无法从计算引擎连接我的glassfish服务器

时间:2019-09-04 10:48:44

标签: google-cloud-platform google-compute-engine ubuntu-18.04 glassfish-4

我正使用ubuntu 18.04 lts在Google计算引擎和glassfish服务器中完美运行,如下图所示:

enter image description here

已经为gcp vm配置了静态IP:

enter image description here

,我删除了S以便可以访问服务器 enter image description here

并且我还添加了端口8080以便能够连接,并且没有任何东西使我抛出错误 已经尝试过:http://34.94.96.242:8080 这是http://34.94.96.242:4848 而且我仍然没有访问权限

1 个答案:

答案 0 :(得分:0)

您是否尝试过在Compute Engine中访问您的glassfish服务器?我的意思是使用例如:

curl localhost:[PORT]

在终端上查看输出,如果确定,则安装正确,并且可能缺少防火墙规则,因此必须使用特定端口创建它。

例如,为了在端口22中启用流量以使用SSH,您需要在云Shell中执行以下命令:

gcloud计算防火墙规则创建default-allow-ssh --allow tcp:22

或打开8080端口

gcloud计算防火墙规则创建default-allow-glassfish --allow tcp:808

documentation逐步介绍了如何在GCP中设置防火墙规则。