简体   繁体   English

我可以使用负载平衡器来扩展Azure Service Fabric应用程序

[英]Can I use load balancer for scaling Azure Service Fabric apps

Recently came to know about Azure Service Fabric and seems a good way to develop scaling applications as bunch of micro services. 最近了解了Azure Service Fabric,似乎是将扩展应用程序开发为一堆微服务的好方法。 Everywhere it is telling that we need to have stateless front end web services and stateful partitioned internal services. 它告诉我们,我们需要拥有无状态前端Web服务和有状态分区内部服务。 The internal services scale by partitioning the data . 内部服务通过分区数据来扩展

But what happens to the front end services in load? 但是负载中的前端服务会发生什么? .The chances are very less as they are doing nothing but relying to internal stateful services. 除了依靠内部的有状态服务之外,他们无所事事的可能性很小。 Still should we use load balancer before front end services? 我们还应该在前端服务之前使用负载均衡器吗? If so, can we host the same too via Service Fabric's Stateless model using OWIN or any other web host? 如果是这样,我们是否可以通过使用OWIN或任何其他Web主机的Service Fabric的无状态模型来托管相同的内容?

The question is asked already in SO but as comment. 问题已在SO中提出,但作为评论。 It didnt get reply as the original question was different. 由于最初的问题不同,它没有得到答复。 Azure Service Fabric usage Azure Service Fabric用法

Yes, you'll definitely want to distribute load across your stateless services as well. 是的,你肯定也希望在无状态服务中分配负载。 The key difference is that since they are stateless, they can handle requests in a round-robin fashion. 关键的区别在于,由于它们是无状态的,因此它们可以以循环方式处理请求。

Whereas stateful services have partitions, which map to individual chunks of the service's state, stateless services simply have instances, which are identical clones of each other, just on different nodes. 有状态服务具有映射到服务状态的各个块的分区,而无状态服务仅具有实例,这些实例是彼此相同的克隆,仅在不同节点上。 You can set the number of instances in on the default service definition in the application manifest. 您可以在应用程序清单中的默认服务定义中设置实例数。 For instance, this declaration will ensure that there are always 5 instances of your stateless service running in the cluster: 例如,此声明将确保群集中始终有5个无状态服务实例:

<Service Name="Stateless1">
   <StatelessService ServiceTypeName="Stateless1Type" InstanceCount="5">
     <SingletonPartition />
   </StatelessService>
</Service>

You can also set the InstanceCount to -1, in which case Service Fabric will create an instance of your stateless service on each node. 您还可以将InstanceCount设置为-1,在这种情况下,Service Fabric将在每个节点上创建无状态服务的实例。

The Azure load-balancer will round-robin your incoming traffic across each of your instances. Azure负载均衡器将在您的每个实例中循环传入流量。 Unfortunately, there isn't a good way to simulate this in a one-box environment right now. 不幸的是,现在还没有一种在单箱环境中模拟这种方法的好方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM