C# 高可用性

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4335/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-07-31 15:57:09  来源:igfitidea点击:

High availability

提问by Codebrain

Is there anyway to configure a WCF service with a failover endpoint if the primary endpoint dies? Kind of like being able to specify a failover server in a SQL cluster.

如果主端点挂了,是否可以使用故障转移端点配置 WCF 服务?有点像能够在 SQL 集群中指定故障转移服务器。

Specifically I am using the TCP/IP binding for speed, but on the rare occurrence that the machine is not available I would like to redirect traffic to the failover server. Not too bothered about losing messages. I'd just prefer not to write the code to handle re-routing.

具体来说,我使用 TCP/IP 绑定来提高速度,但在极少数情况下机器不可用时,我想将流量重定向到故障转移服务器。不太担心丢失消息。我只是不想编写代码来处理重新路由。

采纳答案by Kev

You need to use a layer 4 load balancerin front of the two endpoints. Prob best to stick with a dedicated piece of hardware.

您需要在两个端点之前使用第 4 层负载均衡器。最好坚持使用专用硬件。

回答by Kev

Without trying to sound too vague but I think Windows Network Load Balancing (NLB) should handle this for you.

不要试图听起来太模糊,但我认为 Windows 网络负载平衡 (NLB) 应该为您处理这个问题。

回答by Kev

Haven't done it yet with WCF but plan to have a local DNS entry pointing to our Network Load Balancing (NLB) virtual iP address which will direct all traffic to one of our servers hosting services within IIS. I have used NLB for this exact scenario in the past for web sites and see no reason why it will not work well with WCF.

尚未使用 WCF 完成此操作,但计划有一个本地 DNS 条目指向我们的网络负载平衡 (NLB) 虚拟 IP 地址,它将所有流量定向到我们在 IIS 中托管服务的服务器之一。过去,我曾将 NLB 用于网站的这种确切场景,并且看不出为什么它不能与 WCF 很好地配合使用。

The beauty of it is that you can take servers in and out of the virtual cluster at will and NLB takes care of all the ugly re-directing to an available node. It also comes with a great price tag: $FREE with your Windows Server license.

它的美妙之处在于您可以随意将服务器移入和移出虚拟集群,而 NLB 会处理所有丑陋的重定向到可用节点。它还具有很高的价格标签:Windows Server 许可证免费。

回答by Brian

We've had good luck with BigIP as a solution, though it's not cheap or easy to set up.

BigIP 作为解决方案我们很幸运,尽管它并不便宜或易于设置。

One nice feature is it allows you to set up your SSL certificate (and backdoor to the CA) at the load balancer's common endpoint. Then you can use protocols to transfer the requests back to the WCF servers so the entire transmission is encrypted.

一个不错的功能是它允许您在负载均衡器的公共端点设置 SSL 证书(以及 CA 的后门)。然后您可以使用协议将请求传输回 WCF 服务器,以便对整个传输进行加密。