- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个谷歌计算引擎,我在上面设置了一个 git repo,一切都很顺利,我在 git 上 pull 零问题。然后,我设置了一个负载均衡器并为我的虚拟机创建了一个 NEG,并且能够让 https 运行。但是,现在当我运行 git pull 它什么也不做。它只是卡在那里没有输出,即使我使用 -v
它没有输出,只是无限期地挂起。我什至不知道负载均衡器和 https 设置是否相关,但我想不出其他任何东西。我已经尝试过重新生成 SSH key 但没有任何效果。有任何想法吗?
这是我的 git remove -v 输出:
origin git@github.com:LukasDeco/thoughtful.git (fetch)
origin git@github.com:LukasDeco/thoughtful.git (push)
和 git 状态:
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: .gitignore
no changes added to commit (use "git add" and/or "git commit -a")
更新:
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
然后我尝试使用 https,这是输出:
fatal: unable to access 'https://github.com/LukasDeco/thoughtful.git/': Failed to connect to github.com port 443: Connection timed out
这似乎是一个网络问题,但我的 VM 上有 default-allow-ssh 防火墙规则,因此端口 22 应该打开。
最佳答案
如 John Hanley 所述在评论中,并在“Compue Engines / Securely connecting to VM instances / Traffic egress using NAT gateways”中详细说明
When an instance does not have an external IP address assigned it cannot make direct connections to external services, including other Google Cloud services.
To allow these instances to reach services on the public internet, you can set up and configure a NAT gateway machine, which can route traffic on behalf of any instance on the network
Cloud NAT is a distributed, software-defined managed service.
It's not based on proxy VMs or appliances.Cloud NAT configures the Andromeda software that powers your VPC network so that it also provides source network address translation (SNAT) for VMs without external IP addresses.
Cloud NAT also provides destination network address translation (DNAT) for established inbound response packets.
关于git - Google Compute Engine VM,添加的负载均衡器现在不能 git pull,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63307465/
我是一名优秀的程序员,十分优秀!