goodrain / rainbond

No need to know Kubernetes' cloud native application management platform | 不用懂 Kubernetes 的云原生应用管理平台
https://www.rainbond.com
GNU Lesser General Public License v3.0
5k stars 783 forks source link

SpringCloud Nacos Rainbond 负载均衡问题 #1787

Closed lokywang closed 10 months ago

lokywang commented 11 months ago

我们使用Rainbond 作为PaaS平台,治理模式为:内置 ServiceMesh 模式

服务为SpringCloud框架的微服务,Nacos作为服务的注册发现. Nacos部署在物理机上 image

通过第三方引用的方式,其他服务可以在Nacos注册发现 image

image

现在碰到的问题是服务之间没有负载均衡调用 image image

会出现服务满载,而其他服务负载很低的情况,通过Nacos进行下线高负载应用时,另一台服务CPU则服务满载

这种情况应该是什么问题导致的呢? Service Mesh的负载均衡机制问题吗?

查询了一些资料,还是没有头绪~ 感谢帮助~~~

Issues-translate-bot commented 11 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Title: SpringCloud Nacos Rainbond load balancing problem

We use Rainbond as the PaaS platform, and the governance model is: built-in ServiceMesh model

The service is a microservice of the Spring Cloud framework, and Nacos is used as a registration discovery of the service. Nacos is deployed on a physical machine image

Through third-party references, other services can be registered and discovered in Nacos image

image

The problem we are encountering now is that there is no load balancing call between services. image image

There will be situations where the service is fully loaded and the load of other services is very low. When high-load applications are offline through Nacos, the other service CPU is fully loaded.

What problem should be causing this situation? Is there a problem with the load balancing mechanism of Service Mesh?

I checked some information, but still have no clue~ Thanks for the help~~~

zzzhangqi commented 11 months ago

@lokywang

在没有 nacos 作为注册中心和服务发现时,使用内置 Service Mesh模式,默认情况下 A 组件访问 B 组件,A 通过 127.0.0.1:port 访问 B,当 B 存在多个实例时,会默认负载均衡代理。

采用 Nacos 作为注册中心和服务发现时,仅仅起到服务注册到 Nacos 时的负载均衡,服务之间的调用还是通过 Nacos 代理和分配。

举个例子:有 A 服务(2实例)和 B 服务(2实例)和 Nacos,这时相当于有 4 个实例注册到 Nacos,在 Nacos 中会展示实例注册的 POD IP,当 A 服务调用 B 服务时,A 服务会在 Nacos 中查到 B 服务并获取 B 服务所注册的 POD IP,A 具体访问 B 服务的哪个实例由 Nacos 决定。

所以这一层应该排查你的 Nacos 配置或者代码中的配置,同时我发现你的截图中有 Gateway,这一层是否有 fegin 代理。

从我的经验来看,这个问题跟 Service Mesh 治理模式无关。以上是一些思路,具体还需你再排查,给出更多的排查结果才能更进一步的详细分析问题。

Issues-translate-bot commented 11 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@lokywang

When there is no nacos as the registration center and service discovery, the built-in Service Mesh mode is used. By default, component A accesses component B, and A accesses B through 127.0.0.1:port. When multiple instances of B exist, the load balancing proxy will be used by default.

When Nacos is used as the registration center and service discovery, it only serves as load balancing when services are registered to Nacos. Calls between services are still proxied and distributed through Nacos.

For example: there are service A (2 instances) and service B (2 instances) and Nacos. At this time, it is equivalent to 4 instances registered to Nacos. The POD IP of the instance registration will be displayed in Nacos. When service A calls service B At this time, service A will find service B in Nacos and obtain the POD IP registered by service B. The specific instance of service B that A accesses is determined by Nacos.

So this layer should check your Nacos configuration or the configuration in the code. At the same time, I found that there is a Gateway in your screenshot. Is there a fegin proxy in this layer?

From my experience, this issue has nothing to do with the Service Mesh governance model. The above are some ideas. You still need to investigate further. Only by providing more investigation results can you analyze the problem in more detail.

ZhangSetSail commented 10 months ago

问题是否得到解决,如果没有什么问题该issues将在明天关闭

Issues-translate-bot commented 10 months ago

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Has the issue been resolved? If nothing goes wrong the issues will be closed tomorrow.