简体   繁体   English

Azure表存储,如何避免连接错误(我尝试重试)

[英]Azure Table Storage, How to avoid connection error (I tried retry)

I got lots of errors like No connection could be made because the target machine actively refused it 70.37.127.112:443 我遇到很多错误,例如No connection could be made because the target machine actively refused it 70.37.127.112:443

So I add Microsoft.Practices.TransientFaultHandling to retry. 所以我添加了Microsoft.Practices.TransientFaultHandling重试。

But still, lots of errors (even after retry) 但是仍然有很多错误(即使重试之后)

I like to know: 我想知道:

1st, since Azure is a distributed service, why am I always reach 70.37.127.112 ( I access storage by simple original DefaultEndpointsProtocol=https;AccountName=storage_account;....., then use tableContext.CreateQuery<datatype>("table_name"); ). 1,由于Azure是分布式服务,为什么我总是达到70.37.127.112(我通过简单的原始DefaultEndpointsProtocol=https;AccountName=storage_account;.....,访问存储DefaultEndpointsProtocol=https;AccountName=storage_account;.....,然后使用tableContext.CreateQuery<datatype>("table_name"); )。 I noticed all my tables (even in different Storage account) all hit 70.37.127.112. 我注意到我的所有表(甚至在不同的存储帐户中)都达到70.37.127.112。 My question, is there a way to change it? 我的问题是,有没有办法改变它?

2nd, how to eliminate the error above totally? 2,如何彻底消除以上错误?

error details 错误详情

System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 70.37.127.112:443
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetResponse()
   at System.Data.Services.Client.QueryResult.Execute()
   at System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents)
   at System.Data.Services.Client.DataServiceQuery`1.Execute()
   at System.Data.Services.Client.DataServiceQuery`1.GetEnumerator()
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.Practices.TransientFaultHandling.RetryPolicy.<>c__DisplayClass1.<ExecuteAction>b__0()
   at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction[TResult](Func`1 func)

About your first question, the Azure Fabric Controller is in charge of allocating resources. 关于第一个问题,Azure Fabric Controller负责分配资源。 When you request a service instance (eg Azure Storage) it will find an available server that will be in charge of dealing with the requests. 当您请求服务实例(例如,Azure存储)时,它将找到一个负责处理请求的可用服务器。 This server may be in charge of different service instances, either yours or other people's, since Azure is a shared environment. 由于Azure是共享环境,因此该服务器可能负责您自己或其他人的不同服务实例。

You can use affinity groups, as explained by Nuno Godinho , to have a finer degree of control on how the Fabric Controller will provision your services (eg in the same cluster or in different clusters). 如Nuno Godinho所述 ,您可以使用相似性组来更好地控制结构控制器如何配置您的服务(例如,在同一群集或不同群集中)。

See Inside Windows Azure storage: what's new and under the hood deep dive for a explanation on the architecture. 有关体系结构的说明,请参见Windows Azure内部存储:新增功能和深入了解。

About the second question, on eliminating the error, I noticed that the port being refused is 443. It has happened to me before that this port was being blocked by a firewall or proxy on my own network. 关于第二个问题,关于消除错误,我注意到被拒绝的端口是443。在我的网络上该端口被防火墙或代理阻止之前,这是我所经历的。 Please check if this is the case and have it opened. 请检查是否是这种情况,并将其打开。

If you're sure that your traffic can reach the remote server, the next best course of action is to open a support ticket with Windows Azure's support group. 如果您确定流量可以到达远程服务器,则下一个最佳操作是与Windows Azure的支持小组一起打开支持通知单。 In my experience, they're quick and efficient. 以我的经验,它们快速有效。

For that, go to Support options for Windows Azure and choose Customer Support | 为此,转到Windows Azure的支持选项,然后选择客户支持|。 Windows Azure. Windows Azure。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM