1

我有一个配置有一个 MVC4 Web 角色和两个后端 Web 角色的 azure 解决方案。我一直在使用内部 http 端点在 IISExpress 上对此进行测试。这很好用。我现在想测试 tcp 端点,因为我们可能会在 Azure live 上使用这些端点,所以我更改了部署选项以使用完整的 IIS,因为据我了解,IISExpress 不支持 tcp 绑定。我还没有对端点进行任何更改,也没有更改有关部署的任何其他内容。这会导致角色环境初始化失败,并出现“角色发现数据不可用错误”。我在输出窗口中有这个:

\Microsoft.Data.Services.Client\v4.0_4.99.2.0__31bf3856ad364e3 
\Microsoft.Data.Services.Client.dll', Skipped loading symbols. Module is optimized and the   
debugger option 'Just My Code' is enabled.
'w3wp.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\assembly\GAC_32\msshrtmi  
\1.7.0.0__31bf3856ad364e35\msshrtmi.dll'
Microsoft.WindowsAzure.ServiceRuntime Information: 100 : Role environment . INITIALIZING
Microsoft.WindowsAzure.ServiceRuntime Information: 100 : Role environment . INITIALED RETURNED.  
HResult=-2147467259
Microsoft.WindowsAzure.ServiceRuntime Error: 102 : Role environment . FAILED TO INITIALIZE
A first chance exception of type 'System.InvalidOperationException' occurred in    
Microsoft.WindowsAzure.ServiceRuntime.dll

我的所有实例都是可见的,无论是作为 IIS 下的站点还是在计算模拟器中。我在模拟器诊断中没有看到任何异常情况,对于 MVC4 Web 角色来说是这样的,对于 WCF 服务来说也是类似的:

[fabric] Role Instance: deployment17(123).Azure.Web.Test.0
[fabric] Role state Unhealthy
[Diagnostics]: UpdateState(Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorStartupInfo,    
Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration, )
[Diagnostics]: Acquired mutex
[Diagnostics] Information: C:\Users\User\AppData\Local\dftmp\Resources\5911e3b3-15ce-4b36-ab50-
f04dda461e60\directory\DiagnosticStore\Monitor
[Diagnostics] Information: D:\Work\CLIENTS\Test\Solutions\Test\Azure\csx\Debug\roles\Web.Test
\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\User\AppData\Local\dftmp\Resources
\5911e3b3-15ce-4b36-ab50-f04dda461e60\directory\DiagnosticStore\Monitor" -StaticConfigFile 
"C:\Users\User\AppData\Local\dftmp\Resources\5911e3b3-15ce-4b36-ab50-f04dda461e60\directory
\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\User\AppData
\Local\dftmp\Resources\5911e3b3-15ce-4b36-ab50-f04dda461e60\directory\DiagnosticStore\Monitor
\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-38fb5936e7b14b058ae4a7c0b516945d 
-InitializedEvent WADM-StartUp-38fb5936e7b14b058ae4a7c0b516945d -parent 15308 -events
[Diagnostics]: Creating config channel server
[MonAgentHost] Output: Agent will exit when WADDM-ShutDown-38fb5936e7b14b058ae4a7c0b516945d is 
signaled.
[MonAgentHost] Output: Will signal WADM-StartUp-38fb5936e7b14b058ae4a7c0b516945d after the agent 
is initialized.
[MonAgentHost] Output: Registered as an event consumer.
[MonAgentHost] Output: Agent will exit when parent process 15308 exits.
[MonAgentHost] Output: Monitoring Agent Started
[Diagnostics]: Starting configuration channel polling
[fabric] Role state Started
[runtime] Role entrypoint . CALLING   OnStart()
[runtime] Role entrypoint . COMPLETED OnStart()
[runtime] Role entrypoint . CALLING   Run()

知道是什么原因造成的吗?是否有进一步的配置步骤可以让 IIS 完全正常工作?

有关我的环境的更多详细信息:

赢 7 x64 | IIS 7.5 | 最新版本的 Azure SDK

4

1 回答 1

1

为了理解您的问题,我创建了一个带有 HTTP/80 和 Internal-HTTP (port-auto) 端点的 MVC4 Web 角色和两个带有内部 TCP 端点的 Worker 角色。我在每个工作角色中设置以下内容:

var endpoints = RoleEnvironment.Roles["WorkerRole1"].Instances.Select(i => i.InstanceEndpoints["EndPoint11"]).ToArray();

var endpoints = RoleEnvironment.Roles["WorkerRole2"].Instances.Select(i => i.InstanceEndpoints["EndPoint12"]).ToArray();

以及 MVC4 HomeController 中的以下内容:

var endpoints = RoleEnvironment.Roles["MVCWebRole1"].Instances.Select(i => i.InstanceEndpoints["HttpInternal"]).ToArray();

我可以使用 IISExpress 和 IIS7.5 运行这个场景,没有任何问题。

如果您只是创建一个显示问题的 helloworld VS2010 解决方案(包括您的完整配置),并在此处分享,我当然可以查看并为您找到解决方案。

于 2012-07-20T00:31:47.250 回答