Microsoft Azure主从角色 [英] Microsoft Azure Master-Slave worker roles

查看:42
本文介绍了Microsoft Azure主从角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将应用程序移植到azure平台.我想多次运行一个现有的应用程序.我的最初想法如下:我有一个master_process.我有很多slave_processes.每个过程都是Azure中的辅助角色.每个slave_process将独立运行应用程序的实例.我希望master_process启动许多slave_processes并为其提供输入参数.最后,master_process将收集结果.当前,我有一个有效的设置,用于从C#包装程序调用整个应用程序.因此,为了获得成功,我需要做两件事:首先,我必须找到一种在主工作程序内部启动从属工作程序的方法(就像线程一样).其次,我需要找到一种方法来存储从属工作程序的结果并从主工作程序访问这些结果文件.谁能帮我吗?

I am trying to port an application to azure platform. I want to run an existing application multiple times. My initial idea is as follows: I have a master_process. I have many slave_processes. Each process is a worker role in Azure. Each slave_process will run an instance of the application independently. I want master_process to start many slave_processes and provide them the input arguments. At the end, master_process will collect the results. Currently, I have a working setup for calling the whole application from a C# wrapper. So, for the success, I need two things: First, I have to find a way to start slave workers inside of a master worker (just like threads). Second, I need to find a way to store results of the slave workers and reach these result files from master worker. Can anyone help me?

推荐答案

我有一个类似的情况,您可能会发现有用:

I have a similar situation you might find useful:

我在Azure中运行一个大型的顺序批处理过程,这需要进行前后处理.我使用的技术是使用单个多功能工作者角色的实例,但使用仲裁"来指定头节点,然后头节点控制工作流程.

I have a large sequential batch process I run in Azure which requires pre and post processing. The technique I used was to use instances of a single multifunctional worker role, but to use a "quorum" to nominate a head node, which then controls the workflow.

我这样做的方式是使用蔚蓝的页面 Blob作为法定人数(基本上是一种全局互斥锁/锁定),因为一旦某个节点抓住它进行写操作,它将被锁定.为了提高弹性,如果头节点出现问题,则所有节点偶尔都会尝试重新获得仲裁.

They way I do it is using an azure page blob as the quorum (basically a kind of global mutex/lock), because once a node grabs it for writing it's locked. For resilience, in case there's an issue with the head node, all nodes occasionally try to recapture the quorum.

这篇关于Microsoft Azure主从角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆