WCF服务在多服务器环境下无法工作。

3

我有以下架构:

http://i.stack.imgur.com/ZLvR0.png

负载均衡器在AWS上进行定制。WCF由Windows服务托管。当只有一个API发送请求或两个API发送请求且负载均衡器将两者都重定向到WCF1(或WCF2)服务器时,它可以工作。

当API1和API2同时发送请求时,WCF1返回带有错误的响应:

服务器未提供有意义的回复;这可能是由于合同不匹配、过早的会话关闭或内部服务器错误引起的。

而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)]

我不熟悉负载均衡,似乎配置中缺少一些内容。有什么想法或建议吗?
谢谢。
1个回答

0

AWS负载均衡器仅允许HTTP连接。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接