在Web角色(S)和云服务多个站点策略(S) [英] Multiple site strategy on web role(s) and cloud service(s)

查看:165
本文介绍了在Web角色(S)和云服务多个站点策略(S)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有我们迁移到Azure的3面向公众的Web应用程序。所有网站使用端口80。

We have 3 public facing web applications which we are migrating to Azure. All sites use port 80.

选项

OPTIONS

据我了解,有使用Web角色时,三个不同的选项:

As far as I understand, there are three different options when using Web Roles:

1。所有3个站点存在在一个Web角色在一个单一的云服务

  • 在HTTP访问可以通过hostHeader在 ServiceDefinition.csdef中配置
  • 这是最便宜
  • 要求所有项目都需要在同一时间出版
  • 的位点不能单独缩放,仅作为一个整体
  • 在Visual Studio
  • 在1云服务项目
  • HTTP access can be configured by hostHeader in ServiceDefinition.csdef
  • This is the cheapest
  • Requires that all projects need to be published at the same time
  • The sites cannot be scaled separately, only as a whole
  • 1 Cloud Service project in Visual Studio

2。在一个单一的云服务托管在一个单独的Web角色的每个网站

  • 在HTTP访问可以通过hostHeader在 ServiceDefinition.csdef中配置
  • 在每个网站都会有自己的实例
  • 要求所有项目都需要在同一时间出版
  • 在该网站可以单独缩放
  • 在Visual Studio
  • 在1云服务项目
  • HTTP access can be configured by hostHeader in ServiceDefinition.csdef
  • Each site will have their own instance
  • Requires that all projects need to be published at the same time
  • The sites CAN be scaled separately
  • 1 Cloud Service project in Visual Studio

3。在不同的云服务托管在一个网站的角色每个站点

  • 在每个网站都会有自己的cloudapp.net DNS和IP
  • 在每个网站都会有自己的实例
  • 在网站可以另行公布
  • 在该网站可以单独缩放
  • 在Visual Studio中的多个云服务项目

还有什么显著,我很想念?

Is there anything else significant which I am missing?

可能的SOLULTION

POSSIBLE SOLULTION

选项1和2的组合。

主机一切都在一个云服务:发布它们放在一起是好的,因为它们都引用一个公共库项目,将需要在所有项目中持续更新

Hosting everything in one cloud service: Publishing them all together is fine since they all reference a common library project which would need to be updated consistently across all projects.

托管在一个Web角色两个网站:它们可以缩放在一起的感觉真好

Hosting two sites in one web role: They can be scaled together fine.

托管在它自己的Web角色的第三个站点也需要因大量需求高峰自身的缩放。

Hosting the third site in it's own web role Will needs its own scaling because of massive peak demands.

ServiceDefinition.csdef中

<ServiceDefinition name="WebTestCloudService.Test" xmlns="..." schemaVersion="2012-10.1.8">
  <WebRole name="AzureWebTest1" vmsize="Small">
    <Sites>
      <Site name="AzureWebTest1">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="test1.mydomain.com" />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="80" />
    </Endpoints>
  </WebRole>
  <WebRole name="AzureWebTest2" vmsize="Small">
    <Sites>
      <Site name="AzureWebTest2">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="test2.mydomain.com" />
        </Bindings>
      </Site>
      <Site name="AzureWebTest3" physicalDirectory="..AzureWebTest4">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="test3.mydomain.com" />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="80" />
    </Endpoints>
  </WebRole>
</ServiceDefinition>

请确认我在正确的轨道?任何投入将是AP preciated。

Please confirm that I am on the right track? Any input would be appreciated.

推荐答案

听起来像是你在正确的轨道上。澄清的几个要点:

Sounds like you're on the right track. A few points of clarification:

  • 请记住,确定网站在不同的网络角色相同的部署中运行时,则需要单独的端口号为每个Web角色。如果您希望所有站点都在端口80,你需要选择#1或#3
  • 在一个单独的部署,而你需要的发布的所有角色code一次,你可以选择的更新的一个特定的角色,而不是所有角色。
  • 您也可以寻找替代性技术的部署部署你的web code独立,如存储您的网站zip'd的斑点,然后下载/解压缩/安装的网站(S)根据需要,而无需重新部署。
  • 您也可以保持在Blob存储所有的静态内容和更新这些对象在任何时​​间为零重新部署。
  • Keep in mind that, when defining sites to run in separate web roles within the same deployment, you'll need separate port numbers for each web role. If you want all sites to be on port 80, you'll need option #1 or #3
  • Within a single deployment, while you need to publish all role code at once, you can choose to update a specific role instead of all roles.
  • You can also look into alternative techniques for deploying your web code independent of your deployment, such as storing your websites zip'd in blobs, then download/unzip/install website(s) as needed, without redeploying.
  • You can also keep all your static content in blob storage and update these objects at any time with zero redeployment.

这篇关于在Web角色(S)和云服务多个站点策略(S)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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