为什么我不能在我的ServiceDefinition文件中输入LoadBalancerProbe?

Jal*_*hra 0 load-balancing azure

我试图为我的Azure服务设置一个CustomLoadBalancerProbe.

根据这些信息:http://msdn.microsoft.com/en-us/library/windowsazure/jj151530.aspx#LoadBalancerProbes

应该可以将标记添加到服务定义文件中.但是当我尝试这个时,我只收到一条消息,说这对于servicedefinition文件来说是无效的.

然后我google了一下,发现了这个:http://www.windowsazure.com/en-us/manage/windows/common-tasks/how-to-load-balance-virtual-machines/

这里它告诉我,虚拟机的负载平衡仅在azure的预览版本中可用.

所以我现在有点困惑:

1)VM的负载平衡与架构中描述的负载均衡探测器的使用有区别吗?(链接1)

2)如果否:是否只是不支持?

3)如果是:为什么我无法将探针输入服务定义文件?

San*_*tia 8

LoadBalancerProbes元素仅在SDK的1.7版(或更高版本)中受支持.现在,它的棘手部分是你需要在定义Web/Worker角色之前添加它.像这样:

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="WindowsAzure6" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8">
  <LoadBalancerProbes>
    <LoadBalancerProbe name="MyProbe" protocol="http" intervalInSeconds="300" path="/something.aspx" port="80" timeoutInSeconds="30" />
  </LoadBalancerProbes>
  <WebRole name="WebRole1" vmsize="Small">
    ...
  </WebRole>
</ServiceDefinition>
Run Code Online (Sandbox Code Playgroud)

如果在定义Web/Worker角色之后添加它,则Visual Studio中将出现"无效的子元素"错误:

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="WindowsAzure6" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8">
  <WebRole name="WebRole1" vmsize="Small">
    ...
  </WebRole>
  <LoadBalancerProbes>
    <LoadBalancerProbe name="MyProbe" protocol="http" intervalInSeconds="300" path="/something.aspx" port="80" timeoutInSeconds="30" />
  </LoadBalancerProbes>
</ServiceDefinition>
Run Code Online (Sandbox Code Playgroud)