网址为特定Azure的Web角色实例 [英] URL for Specific Azure Web Role Instance

查看:121
本文介绍了网址为特定Azure的Web角色实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以说,我有3个实例的Azure的Web角色。有没有为我通过URL变化直接访问每个角色的方法?

Lets say i have an Azure Web Role with 3 instances. Is there a way for me to directly access each role via a URL change?

我试着去测试实例的端点individually--这样我的询问。

Im trying to test the endpoints of the instances individually-- thus my inquiry.

修改

我不找实例怎么下来的,我正在寻找如何来ping每个单独的实例的终点。

I am not looking for how to down one of the instances, i'm looking for how to ping an endpoint on each of the instances individually.

推荐答案

输入端点是负载平衡的,所以你不能真正指挥交通,以一个单一的实例。

Input endpoints are load-balanced, so you can't really direct traffic to one single instance.

话虽如此,有几个解决方法:

Having said that, there are a few workarounds:

有是你可以为一个处理一个健康检查活动。在您的实例的所有只有一个,你可以设置实例的忙标志,同时它负载平衡器。拉这一关,你需要某种类型的发布/订阅(服务总线队列?)机制来广播消息的情况下,让他们知道是否包括或从负载平衡器排除自己。你会做这样的事情:

There's a health-check event you can set up a handler for. In all but one of your instances, you could set the instance's busy-flag, taking it out of the load balancer. To pull this off, you'd need some type of pub/sub (service bus queue?) mechanism to broadcast messages to the instances, letting them know whether to include or exclude themselves from the load balancer. you'd do something like:

RoleEnvironment.StatusCheck += RoleEnvironment_StatusCheck;

然后...

void RoleEnvironment_StatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
{
    if(someMagicConditionToRemoveFromLB)
        e.SetBusy();
}

另一种选择是将有一个单独的Web角色实例像ARR运行,提供定制的负载均衡。

Another option would be to have something like ARR running in a separate web role instance, providing custom load balancing.

也许你可以想出其他解决方法,但在一般情况下,网络/工人负载均衡设置不直接实例访问。

Maybe you could come up with other workarounds, but in general, web/worker load balancing isn't set up for direct-instance access.

这篇关于网址为特定Azure的Web角色实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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