[英]WCF service doesn't work in multiple server environment
我有下一個架構:
http://i.stack.imgur.com/ZLvR0.png
負載均衡器是在 AWS 上定制的。 WCF 由 Windows 服務托管。 當只有一個 API 發送請求或兩個 API 發送請求並且負載均衡器將兩者都重定向到 WCF1(或 WCF2)服務器時,它可以工作。
當 API1 和 API2 同時發送請求時,WCF1 返回響應錯誤:
服務器沒有提供有意義的回復; 這可能是由合約不匹配、過早的 session 關閉或內部服務器錯誤引起的。
並且 WCF2 返回錯誤響應:
套接字連接被中止。 這可能是由於處理您的消息時出錯或遠程主機超出接收超時,或者是潛在的網絡資源問題造成的。 本地套接字超時為“00:59:59.7299730”。
端點配置:
var netTcpBinding = new NetTcpBinding
{
ReceiveTimeout = TimeSpan.FromDays(1f),
MaxBufferSize = 52428800,
MaxReceivedMessageSize = 52428800,
SendTimeout = TimeSpan.FromHours(1),
Security = new NetTcpSecurity()
{
Mode = SecurityMode.None,
Message = new MessageSecurityOverTcp()
{
ClientCredentialType = MessageCredentialType.None
},
Transport = new TcpTransportSecurity()
{
ProtectionLevel = System.Net.Security.ProtectionLevel.None,
ClientCredentialType = TcpClientCredentialType.None,
}
}
};
端點地址:
net.tcp://LoadBalancerHost:port/ServiceName;
WCF配置:
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, InstanceContextMode = InstanceContextMode.Single,
IncludeExceptionDetailInFaults = true)]
我不熟悉負載平衡,配置中似乎缺少某些東西。
有什么想法或建議嗎?
謝謝。
AWS 負載均衡器僅允許 HTTP 連接。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.