c# - WCF 服务在多服务器环境中不起作用

我有下一个架构:

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

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

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

The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error.

WCF2 返回错误响应:

The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '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 连接。

https://stackoverflow.com/questions/38868645/

相关文章:

php - 模拟 Controller 从 WebTestCase 调用的服务

mysql - 如何匹配两个表之间varchar字段中的字符串

c# - 使用 Entity Framework 定义关系/FK 的两端是否重要?

android - 键盘打开android时布局正在缩小

python - 在 Python 中查找对称矩阵的 SVD

android - 如果暂停时间太长,为什么应用程序无法从最近启动

maven - 如何配置 pom.xml 文件以使用 Nexus Repository manage

c++ - 如何从 MAC 中的/Library/Framework 文件夹中包含 C++ 中的文件

android - firebase 重复用户名和自定义登录

google-maps - 谷歌地图 -> 根据给定距离制作环形路线?