gpt4 book ai didi

java - 集群和负载均衡的区别?

转载 作者:IT老高 更新时间:2023-10-28 20:41:25 25 4
gpt4 key购买 nike

集群负载均衡有什么区别?

我知道这是一个简单的问题。但是我问了几个人这个问题,但没有人给出可靠的答案。

我也google了很多,没有得到准确的答案。

希望我们的 Stack 用户能给我最好的答案。

最佳答案

来自 Software journal blog摘录。

Clustering has a formal meaning. A cluster is a group of resources that are trying to achieve a common objective, and are aware of one another. Clustering usually involves setting up the resources (servers usually) to exchange details on a particular channel (port) and keep exchanging their states, so a resource’s state is replicated at other places as well. It usually also includes load balancing, wherein, the request is routed to one of the resources in the cluster as per the load balancing policy.

Load balancing can also happen without clustering when we have multiple independent servers that have same setup, but other than that, are unaware of each other. Then, we can use a load balancer to forward requests to either one server or other, but one server does not use the other server’s resources. Also, one resource does not share its state with other resources. Each load balancer basically does following tasks: Continuously check which servers are up. When a new request is received, send it to one of the servers as per the load balancing policy. When a request is received for a user who already has a session, send the user to the same server (This part is important, as otherwise user would keep going between different servers, but not able to really do any work). This part is not required for serving static pages, in that case, there are no user sessions.

关于java - 集群和负载均衡的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15092137/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com