2012-03-25 54 views
0

我得到了很多錯誤,像No connection could be made because the target machine actively refused it 70.37.127.112:443Azure的表存儲,如何避免連接錯誤(我試過重試)

所以我添加Microsoft.Practices.TransientFaultHandling重試。

但儘管如此,許多錯誤(甚至重試後)

的我想知道:

1,由於Azure是一個分佈式服務,爲什麼我總是達到70.37.127.112(我訪問存儲通過簡單原件DefaultEndpointsProtocol=https;AccountName=storage_account;.....,然後使用tableContext.CreateQuery<datatype>("table_name");)。我注意到我的所有表(即使在不同的存儲帳戶)都達到了70.37.127.112。我的問題是否有改變它的方法?

2,如何完全消除上面的錯誤?

錯誤的詳細信息

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) 

回答

1

關於你的第一個問題,在Azure結構控制器負責分配資源。當您請求服務實例(例如Azure存儲)時,它將找到一個負責處理請求的可用服務器。由於Azure是共享環境,因此該服務器可能負責不同的服務實例,無論是您的還是其他人的服務實例。

您可以使用關聯組as explained by Nuno Godinho更好地控制結構控制器如何配置您的服務(例如在相同羣集或不同羣集中)。

請參閱Inside Windows Azure storage: what's new and under the hood deep dive對架構的解釋。

關於第二個問題,關於消除錯誤,我注意到被拒絕的端口是443.在我之前發生過這個端口被我自己的網絡上的防火牆或代理阻塞的情況。請檢查是否是這種情況,並打開它。

如果您確定您的流量可以到達遠程服務器,則下一個最佳行動方案是使用Windows Azure支持小組打開支持服務單。根據我的經驗,他們快速高效。

爲此,請轉至Support options for Windows Azure並選擇客戶支持| Windows Azure。

+0

大多數請求都很好,所以我認爲這不是防火牆問題(並且部署在Azure上,所以我現在不接觸防火牆)。我也用一些表的http,相同的錯誤。我會向他們提交一張票,謝謝你的建議。 – 2012-03-25 12:54:49

+1

我想你可能會混淆SQL Azure的主服務器和2複製備份在這裏爲什麼存儲服務器。存儲服務並不像那樣(即「主」這個術語在這裏並不適用)。有分區服務器,分區大師等。總之,而不是我嘗試在評論中解釋,請觀看布拉德:http://channel9.msdn.com/Events/BUILD/BUILD2011/SAC-961T – dunnry 2012-03-25 14:16:26

+0

謝謝你指出,dunnry。當然,3次複製的是數據,而不是爲請求提供服務的計算服務器。我會更新答案。 – 2012-03-25 16:52:41