[英]What's the best way to distribute multiple copies of services across servers?
We have multiple services that do some heavy data processing that we'd like to put multiple copies of them across multiple servers. 我们有多种服务可以处理一些繁重的数据,我们希望将它们的多个副本放置在多个服务器上。 Basically the idea is this:
基本上是这样的:
We've spent quite a bit of time figuring out how to architect this and I think the design should work quite well but I thought I'd see if anyone had any suggestions on how to improve this approach. 我们花了很多时间来弄清楚如何进行架构设计,我认为设计应该可以很好地工作,但是我想我是否可以就如何改进此方法提出任何建议。
The solution is to use a load balancer.. 解决方案是使用负载平衡器。
I am bit biased here - since I am from WSO2 - the open source WSO2 ESB can be used as a load balancer - and it has the flexibility of load balancing and routing based on different criteria. 由于来自WSO2,我对此有点偏见-开源WSO2 ESB可以用作负载平衡器,并且它具有基于不同标准的负载平衡和路由的灵活性。 Also it supports FO load balancing as well...
它还支持FO负载平衡...
Here are few samples related to load balancing with WSO2 ESB... 以下是与使用WSO2 ESB进行负载平衡有关的一些示例...
You can download the product from here ... 您可以从这里下载产品...
eBay is using WSO2 ESB to process more than 1 Billion transactions per day in their main stream API traffic... eBay正在使用WSO2 ESB在其主流API流量中每天处理超过10亿笔交易...
The first server to be contacted will become the "master" server and delegate the various data processing tasks to the other "slave" servers.
要联系的第一台服务器将成为“主”服务器,并将各种数据处理任务委托给其他“从”服务器。
That is definitely not how I would build this. 绝对不是我要如何构建它。
I build this with the intent to use cloud computing (regardless of whether it uses true cloud computing or not). 我建立此数据库的目的是使用云计算(无论它是否使用真正的云计算)。 I would have a service that would receive requests and save those requests to a queue.
我会有一个可以接收请求并将这些请求保存到队列的服务。 I would then have multiple worker applications that will take an item from the queue, mark it in process and do whatever needs done.
然后,我将拥有多个工作程序,这些工作程序将从队列中取出一个项目,将其标记为正在处理中,并执行需要完成的所有操作。 Upon completion the queue item is updated as done.
完成后,队列项目将更新为已完成。
At this point I would either notify the client that the work is done, or you could have the client poll the server for reading the status of the queue. 此时,我要么通知客户端工作已完成,要么可以让客户端轮询服务器以读取队列的状态。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.