连接前端和后端服务通过内部负载均衡器存在问题。

huangapple go评论50阅读模式
英文:

Problem with connecting frontend and backend services through internal load balancer

问题

前端和后端服务似乎分别运行正常,但当我尝试在它们之间进行通信时,我不断收到 ERR_NAME_NOT_RESOLVED 错误。

  • 服务发现已经连接
  • 所有安全组都是开放的

连接前端和后端服务通过内部负载均衡器存在问题。

我认为我们的架构与这个非常相似,如果这有帮助的话。
(https://mohamedwaelbenismail.medium.com/microservices-architecture-deployed-on-ecs-fargate-based-cluster-using-cloudformation-878cb6f90571)

  • 只有当我们将内部负载均衡器更改为公共负载均衡器,允许互联网流量并允许0.0.0.0/0时,它才能正常工作。

  • 健康检查的状态都是 '健康'。

英文:

Frontend and backend service seem to be working fine separately on its own, but when I try to communicate between frontend and backend I keep getting ERR_NAME_NOT_RESOLVED error.

  • Service discovery are all connected
  • All security groups are open

连接前端和后端服务通过内部负载均衡器存在问题。

I think our architecture is very similar to this if that helps.
(https://mohamedwaelbenismail.medium.com/microservices-architecture-deployed-on-ecs-fargate-based-cluster-using-cloudformation-878cb6f90571)

  • It only works if we change the internal load balancer to public load balancer allow internet traffic and allow 0.0.0.0/0.

  • Status of health check are all 'healthy'

答案1

得分: 0

根据你的示意图,你的 React web application 前端永远无法访问到你的后端。你的前端在客户端的浏览器/移动设备上执行。这意味着唯一的方式访问后端是通过 互联网。因此,你的后端不能在内部负载均衡器后面的私有子网中。

你必须重新设计你的应用程序。前端和后端都必须能够从互联网访问,以便你的前端能够查询后端。

英文:

Based on your schematic illustration, your React web application front end will never be able to reach your backend. Your front end executes on a client side in their browsers/mobiles. This means that the only way to reach backend is through internet. So your backend can't be in a private subnet behind an internal load balancer.

You have to re-architect your application. Both frontend and backund must be accessible from the internet, for your front end to be able to query the backend.

huangapple
  • 本文由 发表于 2023年2月16日 12:55:51
  • 转载请务必保留本文链接:https://go.coder-hub.com/75468004.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定