在Windows Azure的:什么是Web角色,辅助角色和VM角色? [英] In Windows Azure: What are web role, worker role and VM role?

查看:237
本文介绍了在Windows Azure的:什么是Web角色,辅助角色和VM角色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的应用程序包含一个Web角色:它是一个简单的Web应用程序。我需要在托管Windows Azure的应用程序,所以我创建了一个Web角色。其实我是想知道这些角色都是。什么是他们的意义明智的编码或存储明智?

The application I work on contains a web role: it's a simple web application. I needed to host the application in Windows Azure, so I created a web role. I actually want to know what these roles are for. What is their significance coding wise or storage wise?

推荐答案

修改2013年3月3日 - 更新以引用UDP端点,虚拟机和更多的语言

修改2013年6月6日 - 更新,以反映VM角色停产,并更新到网络/辅助角色的基准操作系统映像到Windows Server 2012

由@Vladimir很好的链接。更澄清一点:所有三个角色(网络,工人,VM)基本上是在Windows Server 2008 Web和辅助角色几乎是一样的:

Good link by @Vladimir. A bit more clarification: All three roles (web, worker, VM) are essentially Windows Server 2008. Web and Worker roles are nearly identical:


  • 网络角色都是Windows <击> 2008 2012虚拟机与IIS启用

  • 辅助角色都是Windows <击> 2008 2012虚拟机与IIS禁用(你可以手动启用它)

  • VM角色是Windows Server 2008的图像,你通过Hyper-V的局部构造,并上传到Azure中的(和现在停产,不再作为2013年5月31日

  • 虚拟机是Azure中创建Windows或Linux镜像,存储在自己的存储虚拟硬盘,并有多项增强了虚拟机的作用。例如:由于VHD是在自己的存储帐户,您可以轻松创建您的VHD映像模板,将其复制到新的虚拟硬盘,甚至上传到<一个href=\"http://blogs.msdn.com/b/windowsazure/archive/2013/02/04/windows-azure-and-vm-depot-better-together.aspx\">VM车厂(仅限Linux)。

  • Web roles are Windows 2008 2012 VMs with IIS enabled
  • Worker roles are Windows 2008 2012 VMs with IIS disabled (and you could manually enable it)
  • VM roles are Windows Server 2008 images you construct locally via Hyper-V and upload to Azure (and are now discontinued and no longer available as of May 31, 2013
  • Virtual Machines are Windows or Linux images created in Azure, stored as a vhd in your own storage, and have several enhancements over VM role. For example: since the vhd is in your own storage account, you can easily create an image template from your vhd, copy it to a new vhd, or even upload it to VM Depot (Linux only).

要回答有关如何处理这些角色做题:平台培训工具包(下面提到)会给你很多好的想法和样本,但这里有一些简单的用例:

To answer your question about what to do with these roles: The Platform Training kit (mentioned below) will give you lots of good ideas and samples, but here are some straightforward use cases:


  • 您可以运行任何code暴露一个TCP,HTTP,HTTPS或UDP端点(Web应用程序,SOAP / REST服务等)。你需要想一想的无国籍虽然处事的方式 - 如果你有多个虚拟机实例中运行,用户流量在这些实例分布。该平台培训教材将告诉您如何使用存储或高速缓存来处理这个问题。

  • 您可以运行code的生活掀起了队列或定时器。也许有按需任务,例如缩略图代基于用户输入的照片,或计算。这些不需要外部提供端点。你可以把你的请求队列,然后有个任务运行的只是此队列饲料关闭(你可以扩展在多个实例这一过程中,与所有实例消耗的队列中的消息)。

  • 您可以运行.NET,Java,PHP和Python中,节点,红宝石等,您只需要为您的项目code一起分发相应的运行时code。所有的语言可以使REST调用在Azure API和几种语言(包括上面提到的)有照顾这对你的SDK。所有语言的SDK是这里,用在GitHub上源$ C ​​$ C,的here

  • 与VM角色,您可以安装并不能可靠地自动非常复杂/耗时的安装,安装需要人工干预,安装和运行软件。你必须应对这种情况下,操作系统的维护。除VM角色,现在有虚拟机,提供基于云计算的虚拟机施工Windows和Linux同时支持一起。我建议在VM角色的虚拟机。

  • You can run any code that exposes a tcp, http, https, or udp endpoint (web applications, SOAP/REST services, etc.). You need to think about the stateless way of doing things though - if you have more than one VM instance running, user traffic is distributed across those instances. The platform training kit will show you how to use storage or cache to deal with this.
  • You can run code that lives off a queue or a timer. Maybe you have on-demand tasks such as thumbnail-generation of photos, or calculations based on user input. These don't need externally-available endpoints. You can push your requests to a queue, and then have a task running which simply feeds off this queue (and you can scale this process across multiple instances, with queue messages consumed by all instances).
  • You can run .NET, Java, php, python, node, ruby, etc. You just need to distribute the appropriate runtime code along with your project code. All languages can make REST calls to the Azure API, and several languages (including those mentioned above) have SDKs that take care of this for you. All language SDKs are here, with source code on github, here.
  • With a VM role, you can install and run software with very complex/time-consuming installations, installations that require manual intervention, and installations that can't be reliably automated. You must deal with OS maintenance in this case. Beyond VM Role, there are now Virtual Machines, providing cloud-based VM construction along with both Windows and Linux support. I'd suggest Virtual Machines over VM Role.

随着Web和辅助角色,操作系统和相关补丁照顾你;你建立你的应用程序的组件,而无需管理虚拟机。随着VM角色,您构建一个完整的Windows Server <击> 2008 2012图像,在Windows Azure挂钩添加到它,并推动整个虚拟机到云(然后保持一段时间的VM映像)。与虚拟机,你只需从一个画廊,这将会为您创建并作为Blob存储的VHD存储选择一个操作系统映像。然后,RDP / SSH,并将它设置你喜欢。

With Web and Worker roles, the OS and related patches are taken care of for you; you build your app's components without having to manage a VM. With VM roles, you build a complete Windows Server 2008 2012 image, add the Windows Azure hooks to it, and push the entire VM into the cloud (and then maintain the VM image over time). With Virtual Machines, you simply pick an OS image from a gallery, which gets created for you and stored as a vhd in blob storage. You then RDP/ssh and set it up how you like.

穿着设计师的帽子,这是它变得好玩和有趣。您可以在Web角色或辅助角色运行的Web服务(并且能够在任一打开端口);您可以在一个Worker角色主机Tomcat或其他Web服务器。你可以选择一个网站加服务在一个单一的角色组合,或将其分成不同的可扩展性需求的多重作用。

Wearing the architect hat, this is where it gets fun and interesting. You can run web services in a Web Role or worker role (and be able to open ports in either); You can host Tomcat or other web servers in a Worker role. you can choose to combine a website plus services in a single role, or split them into multiple roles for different scalability needs.

对于一个良好的开端,看看在平台培训工具包,并开始通过练习走路。

For a good start, take a look at the Platform Training Kit and start walking through the exercises.

这篇关于在Windows Azure的:什么是Web角色,辅助角色和VM角色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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