[英]How to deploy multiple web roles in Azure
I had gone through multiple articles and SO Questions like - this , this , and this (and many others) -我已通过多篇文章和做题一样了这个 , 这个和这个 (以及其他许多)
However none of them serves my issue. 但是它们都不适合我的问题。 I would like to deploy two web roles in one cloud service.
我想在一个云服务中部署两个Web角色。 I tried deploying the same but found one is running whereas other web role throws – Internet Explorer cannot display the webpage / connection timeout in firefox.
我尝试部署相同但发现一个正在运行而其他Web角色抛出 - Internet Explorer无法在firefox中显示网页/连接超时。
Here is what I tried so far: - 这是我到目前为止所尝试的: -
I have two web roles (App and Service), when I deployed either App or Service to a cloudservice for eg http://xxxx.cloudapp.net , it works fine. 我有两个Web角色(应用程序和服务),当我将应用程序或服务部署到云服务时,例如http://xxxx.cloudapp.net ,它工作正常。
But when I tried deploying both App on port 8080 & Service on port 80 in http://xxxx.cloudapp.net , and tried browsing - http://xxxx.cloudapp.net , it displays Service page. 但是,当我尝试在端口8080上部署应用程序并在端口80上的服务http://xxxx.cloudapp.net ,并尝试浏览 - http://xxxx.cloudapp.net时 ,它显示服务页面。
Whereas, while browsing App using - http://xxxx.cloudapp.net:8080 , it throws error – Internet Explorer cannot display the webpage / connection timeout in firefox. 然而,在使用-http://xxxx.cloudapp.net:8080浏览App时,它会抛出错误 - Internet Explorer无法在firefox中显示网页/连接超时。
But my app works fine when just App is deployed on port 80. 但是当我的应用程序部署在端口80上时,我的应用程序工作正常
Here is the ServiceDefinition file : - 这是ServiceDefinition文件: -
<ServiceDefinition name="AppServiceAzure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0">
<WebRole name="MyService" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<Certificates>
<Certificate name="mycert" storeLocation="LocalMachine" storeName="My" />
</Certificates>
</WebRole>
<WebRole name="MyApp" vmsize="Small">
<Sites>
<Site name="Web">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="8080" />
</Endpoints>
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
<Certificates>
<Certificate name="mycert" storeLocation="LocalMachine" storeName="My" />
</Certificates>
</WebRole>
</ServiceDefinition>
What I am missing here? 我在这里缺少什么?
Each Windows Azure Compute instance represents a virtual server of either of following role. 每个Windows Azure Compute实例代表以下任一角色的虚拟服务器。
Windows Azure Compute instance
|
|_______[front-end] web server (Web role)
|
|
|_____Site1
|
|
|_____Site2
|
|
|_____Site3 etc.
or 要么
|
|
|
|_______back-end/.NET] application server (Worker role)
or
|
|
|
|_______VM
I suggest two approaches: 1) create Multiple sites in one role.(you will get different endpoints) 2) Or deploy one webrole to staging and other role to production . 我建议两种方法:1)在一个角色中创建多个站点。(您将获得不同的端点)2)或者将一个webrole部署到暂存 ,将其他角色部署到生产 。 (again you will get different endpoints)
(你会得到不同的终点)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.