我正在尝试使用HTTPS L7负载均衡器为GKE设置HTTPS负载均衡器,但由于某种原因无效.甚至是HTTP负载平衡演练中的HTTP负载均衡器.转发规则的IP地址已创建,我可以ping和telnet到端口80.但是当通过curl请求时,它会给我一个错误.
<title>502 Server Error</title> </head> <body text=#000000
bgcolor=#ffffff> <h1>Error: Server Error</h1> <h2>The server
encountered a temporary error and could not complete your request.
<p>Please try again in 30 seconds.</h2> <h2></h2> </body></html>
Run Code Online (Sandbox Code Playgroud)
所有步骤都很好,我创建了一个没有任何标签的防火墙$ {NODE_PORT},但它没有用.
有谁遇到过这个问题?
google-compute-engine google-kubernetes-engine google-cloud-http-load-balancer
GCP提供两个负载平衡器,即网络和HTTP,其中前者在第4 层工作,后者在第7层工作.
还有一个文档说明即使HTTP流量也可以由网络负载平衡器进行负载平衡.这略微混淆了为GCP中的Web应用程序选择哪个负载均衡器.在为项目选择一个之前,最好先了解这些差异.
基于工作流程,设置,基于区域/区域,会话亲和性选项以及其他设置,它们之间有何区别?
load-balancing google-compute-engine google-cloud-platform google-cloud-network-load-balancer google-cloud-http-load-balancer
我们有一个API服务器,正在使用HTTP负载平衡器。我们发现,如果HTTP请求的数据很大,则L7负载平衡器将返回502错误。
我们已经确认,在不使用负载均衡器的情况下访问API时,它可以工作(直接访问API服务器。)
这个问题可能是类似的问题。HTTP负载平衡器削减了大型请求正文的一部分
有人说使用L4网络负载平衡器是一种可能的解决方案,但由于某些原因,例如基于URL的负载平衡和跨区域负载平衡,我们不希望使用它。
// Response OK (data size is 1024)
curl -H "Content-Type: application/json" -X POST -d '{"xx": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}' https://xxxxxxxxxxxxxxx.com/xx/xxxxxxxxxxxx/xxxxxxxxx
// Response NG (data size is 1025)
curl -H "Content-Type: application/json" -X POST -d '{"xx": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}' https://xxxxxxxxxxxxxxx.com/xx/xxxxxxxxxxxx/xxxxxxxxx
Run Code Online (Sandbox Code Playgroud)
LB对发布数据的大小似乎有一些限制。测试显示限制约为1024个字节。
更新1
@chaintng 救了我。链接的帖子上有人说,如果帖子数据超过1024字节,则会curl添加"Expect: 100-continue Header"。
// Response NG (data size is 1025. without "Expect: ")
curl -H "Content-Type: application/json" -X POST -d '{"xx": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"}' https://xxxxxxxxxxxxxxx.com/xx/xxxxxxxxxxxx/xxxxxxxxx
// Response OK (data size is 1025. with "Expect: ") …Run Code Online (Sandbox Code Playgroud) google-app-engine google-cloud-platform google-cloud-http-load-balancer
我在 App Engine 上有一个具有自定义域和 Google 提供的 SSL 证书的实例,但现在我需要在其前面放置一个 Google Cloud Load Balancer。
我按照此处的说明进行操作(进行了调整以针对 App Engine 而不是 Cloud Run 执行此操作): https: //cloud.google.com/load-balancing/docs/https/setting-up-https-serverless
我首先执行了该指南中的步骤,然后更新了 GoDaddy 中的 DNS 记录以指向负载均衡器的 IP。
问题是,在我更新 GoDaddy DNS 记录以指向负载均衡器的 IP 后,花了将近一个小时才再次可访问。当尝试通过浏览器或代码访问该网站时,我收到 SSL 错误。
核心问题似乎是负载均衡器的 SSL 证书停留在 的状态,PROVISIONING并且域停留在 的状态FAILED_NOT_VISIBLE,对此文档说:
该网域的 DNS 记录无法解析为 Google Cloud 负载均衡器的 IP 地址。要解决此问题,请更新 DNS A/AAAA 记录以指向负载均衡器的 IP 地址。
https://cloud.google.com/load-balancing/docs/ssl-certificates/troubleshooting#domain-status
这些文档是这样说的PROVISIONING:
Google Cloud 正在与证书颁发机构合作颁发证书。配置 Google 管理的证书最多可能需要 60 分钟
我仍然需要对我的生产项目执行此操作。也许如果我交换步骤的顺序(在创建 SSL 证书之前将 DNS 记录指向 …
dns google-app-engine google-cloud-platform google-cloud-load-balancer google-cloud-http-load-balancer