Multiple site strategy on web role(s) and cloud service(s)

北城以北 提交于 2019-12-30 03:15:13

问题


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

OPTIONS

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

1. All 3 sites hosted in ONE web role in a single cloud service:

  • 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. Each site hosted on a SEPARATE web role in a single cloud service:

  • 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. Each site hosted on a web roles in SEPARATE cloud services:

  • Each site will have their own cloudapp.net DNS and IP
  • Each site will have their own instance
  • Sites can be published separately
  • The sites CAN be scaled separately
  • Multiple Cloud Service projects in Visual Studio

Is there anything else significant which I am missing?

POSSIBLE SOLULTION

A combination of option 1 and 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.

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

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>

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


回答1:


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

  • 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.


来源:https://stackoverflow.com/questions/17464912/multiple-site-strategy-on-web-roles-and-cloud-services

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!