Google compute engine 如何在google计算引擎上打开端口
在google compute engine上,我可以通过“localhost”访问服务器上的端口,但我不能使用来自同一服务器或外部客户机的IP地址访问同一端口。我试图在web控制台页面上创建一个新的防火墙规则,并且可以从Linux命令中看到它,但是仍然无法访问8888端口Google compute engine 如何在google计算引擎上打开端口,google-compute-engine,google-cloud-platform,Google Compute Engine,Google Cloud Platform,在google compute engine上,我可以通过“localhost”访问服务器上的端口,但我不能使用来自同一服务器或外部客户机的IP地址访问同一端口。我试图在web控制台页面上创建一个新的防火墙规则,并且可以从Linux命令中看到它,但是仍然无法访问8888端口 $ gcloud compute firewall-rules list NAME NETWORK SRC_RANGES RULES
$ gcloud compute firewall-rules list
NAME NETWORK SRC_RANGES RULES SRC_TAGS TARGET_TAGS
allow8888 default 0.0.0.0/0 tcp:8888,udp:8888
default-allow-http default 0.0.0.0/0 tcp:80 http-server
default-allow-https default 0.0.0.0/0 tcp:443 https-server
通过更改本地tcp服务器设置文件解决了此问题
将本地tcp服务器设置文件从“localhost”更改为“0.0.0.0”,从而解决了从“localhost”到“0.0.0”的问题
转到etc/hosts并更新您的主机条目它应该可以工作嘿!要更改这些文件,这些文件位于何处?编辑建议位于/etc/hosts文件