Azure的角色和实例 [英] Azure Roles and Instances

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

问题描述

我可以有一个Web角色,并在同一实例辅助角色来看,还是我必须获得2个独立的托管实例和支付两倍我会这样呢?

Can I have a Web Role and a Worker role run on the same instance, or do I have to obtain 2 separate hosting instances and pay twice the amount I would otherwise?

我有我想举办在Azure上一个WCF Web API。我也有监听到Azure存储队列辅助角色。每一个消息被添加到队列时,它将获得并运行一个小任务根据消息

I have a WCF Web API that I want to host on Azure. I also have a Worker Role that listens to a Queue in Azure Storage. Every time a message is added to the Queue, it will obtain that and run a small task depending on the message.

我在想,如果我可以在同一个实例上运行两个或没有。

I was wondering if I can just run these two on the same instance or not.

推荐答案

辅助角色和Web角色是的Windows Server 2008与IIS运行,只是简单的模板Windows Server 2008的IIS没有运行。最关键的是一个角色是Windows Server虚拟机的定义。为每个角色你有一个或多个实例

"Worker Role" and "Web Role" are just simple templates for "Windows Server 2008 with IIS running" and "Windows Server 2008 without IIS running." The key is that a "role" is a definition of a Windows Server virtual machine. For each "role" you have one or more instances.

在Windows Azure中,这两种类型的角色必须安装的软件,在任何一个启动脚本修改注册表设置等,或的OnStart()处理程序,并让双方的能力运行在运行()方法code。

In Windows Azure, both role types have the ability to install software, modify registry settings, etc. in either a startup script or OnStart() handler, and both let you run code in the Run() method.

在你的情况,你可以在一个Web角色在你的运行()方法运行WCF的Web服务,然后(在相同的角色),揭开序幕过程侦听排队张贴您的WCF Web服务消息。没有必要有一个新的角色。

In your case, you can run your WCF Web Service in a Web Role, and then in your Run() method (in the same role), kick off a process that listens to queue messages posted by your WCF web services. No need to have a new role.

现在:一旦你进入大批量的情况下,您可能希望将code分割成单独的角色,这样你就可以独立地扩展他们(无论是在虚拟机的大小和数量VM)

Now: Once you get into high-volume situations, you might want to split your code into separate roles, so you can scale them independently (both in VM size and VM quantity).

我贴这个另一个答案这里

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

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