[英]GCP: HTTP(S) Load Balancing backend service region select
What we have:我们有什么:
What we want:我们想要什么:
Did the GCP HTTP(S) load balancing is capable to do such think, or there is a technical limitation? GCP HTTP(S) 负载平衡是否能够做到这样的想法,或者存在技术限制?
Any ideas will be much appreciated!任何想法将不胜感激!
I think that you can achieve the most with HTTPS Global load balancer (GLB).我认为您可以使用 HTTPS 全局负载平衡器 (GLB) 获得最大的收益。 You have here an article that can help you in the setup.
您在这里有一篇文章可以帮助您进行设置。
Only the redirect condition seems tricky.只有重定向条件似乎很棘手。 Initially the GLB route to the closest region to the user (thus based on IP), and then you can set up a sticky param, either based on IP or on cookies.
最初 GLB 路由到离用户最近的区域(因此基于 IP),然后您可以设置一个粘性参数,基于 IP 或基于 cookie。 I'm not sure that feat your latest requirement.
我不确定这是否符合您的最新要求。 You can also route to a backend according with the url path provided.
您还可以根据提供的 url 路径路由到后端。 But not from the JWT claims.
但不是来自 JWT 的声明。
If you want one hostname to serve all users, you can use HTTP(S) load balancer for achieving this.如果您希望一个主机名为所有用户提供服务,您可以使用 HTTP(S) 负载平衡器来实现这一目标。 Here is an article which gives more insight about the same 1 .
这是一篇文章,它提供了关于相同1的更多见解。
Your need to redirect based on user information and not from the IP, can be achieved via Session affinity: 2您需要根据用户信息而不是 IP 进行重定向,可以通过 Session affinity 来实现: 2
Google Cloud HTTP(S) Load Balancing offers two types of session affinity: Google Cloud HTTP(S) 负载平衡提供两种类型的会话关联:
Client IP affinity 3 sends requests from the same client IP address to the same backend. Client IP affinity 3将来自相同客户端 IP 地址的请求发送到相同的后端。
Generated cookie affinity 4 sets a client cookie when the first request is made, then sends requests with that cookie to the same backend. Generated cookie affinity 4在发出第一个请求时设置客户端 cookie,然后将带有该 cookie 的请求发送到同一后端。
When you use session affinity, the RATE balancing mode is recommended, rather than UTILIZATION.当您使用会话亲和性时,建议使用 RATE 平衡模式,而不是 UTILIZATION。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.