今天我在 GCP 上的一台 VM 突然无法访问 HTTP 了,从 Web Console 登录上去看一切都很正常,例如我尝试这些操作:
[root@liqiang.io]# curl -I http://localhost
HTTP/1.1 302 Found
Content-Type: text/html; charset=utf-8
Location: https://localhost/
Date: Thu, 01 Aug 2019 07:59:20 GMT
[root@liqiang.io]# ping domain.liqiang.io
PING rancher.liqiang.io (34.92.31.200) 56(84) bytes of data.
64 bytes from 249.33.92.34.bc.googleusercontent.com (34.92.31.200): icmp_seq=1 ttl=76 time=0.925 ms
64 bytes from 249.33.92.34.bc.googleusercontent.com (34.92.31.200): icmp_seq=2 ttl=76 time=0.357 ms
[root@liqiang.io]# curl -I http://domain.liqiang.io
最后一个通过域名访问死活就是不通。于是尝试用 IP 来访问,也是死活都不通。于是登录管理页面查看一下,发现 VM 有个建议是升级配置,说我这个 VM 使用资源过多,当前资源可能不足,我使用的最低配置,1C1.75G,所以就决定升级一下,升级到 2C3.5G,结果居然可以了。
所以这里猜测的结论就是:
- GCP 资源不足可能会导致公网 IP 无法使用。