如何使用.NET在MSCS集群节点之间进行协调/通信

时间:2022-05-27 22:23:29

I have to a develop a .NET Windows Service application that should run on an Active/Active cluster.

我必须开发一个应该在主动/主动群集上运行的.NET Windows服务应用程序。

A Windows Service instance (one instance among many in cluster nodes) should listen to an IBM Websphere MQ and distribute the queue items to all cluster nodes (including the distributor node) based on the load on each service instance. When the primary node fails, another service instance on secondary node should takeover the distribution task. Also, the distributor node should be able to control the concurrency level of TaskScheduler instance in Windows Service on all the nodes. For this, I should be able to communicate between cluster nodes without having a DB table or another queue.

Windows服务实例(群集节点中的许多实例中的一个实例)应该侦听IBM Websphere MQ,并根据每个服务实例上的负载将队列项分发到所有群集节点(包括分发服务器节点)。当主节点发生故障时,辅助节点上的另一个服务实例应该接管分发任务。此外,分发服务器节点应该能够在所有节点上控制Windows服务中的TaskScheduler实例的并发级别。为此,我应该能够在没有DB表或其他队列的情况下在集群节点之间进行通信。

I googled and found there is a C/C++ Platform SDK available. But, Is there any .NET API available to check the hearbeat and to perform intra-communication between nodes inside a cluster server? Or if you could suggest me a best way to implement this would be very helpful. Thanks.

我用Google搜索并发现有一个C / C ++ Platform SDK可用。但是,是否有任何.NET API可用于检查听力和在群集服务器内的节点之间执行内部通信?或者,如果你可以建议我一个最好的方法来实现这将是非常有帮助的。谢谢。

1 个解决方案

#1


1  

There are probably much better platforms than Windows Clustering for this, but since you asked about Windows Clustering here's my take:

可能有比Windows Clustering更好的平台,但是由于你在这里询问了Windows群集,我的看法是:

The MSCS/WSFC cluster API doesn't really provide a mechanism for intra-process communication beyond the fairly limited cluster database (really just a replicated registry key). But you could use the cluster API/tools to host the coordinator process and provide high availability.

MSCS / WSFC集群API实际上并没有为相当有限的集群数据库(实际上只是复制的注册表项)之外的进程内通信提供机制。但您可以使用群集API /工具来托管协调程序进程并提供高可用性。

The easiest way to do this would be to just build a normal Windows service for your coordinator and then use the built in "Generic Service" cluster resource/application type to monitor it. That will let you assign an IP address to the coordinator that will follow it around the cluster. Note that moving the coordinator service will be disruptive, so if the node crashes that is hosting the coordinator, there will be downtime while it is started up on the surviving node.

最简单的方法是为协调器构建一个普通的Windows服务,然后使用内置的“通用服务”群集资源/应用程序类型来监视它。这将允许您为协调器分配IP地址,协调器将围绕群集进行跟踪。请注意,移动协调器服务将具有破坏性,因此如果节点崩溃承载协调器,则在幸存节点上启动时会出现停机。

I don't really see any reason to make the processing agents cluster aware. Just run them as services on each node, and let the coordinator monitor which ones are online.

我真的没有理由让处理代理群集知道。只需在每个节点上将它们作为服务运行,然后让协调器监控哪些是在线的。

#1


1  

There are probably much better platforms than Windows Clustering for this, but since you asked about Windows Clustering here's my take:

可能有比Windows Clustering更好的平台,但是由于你在这里询问了Windows群集,我的看法是:

The MSCS/WSFC cluster API doesn't really provide a mechanism for intra-process communication beyond the fairly limited cluster database (really just a replicated registry key). But you could use the cluster API/tools to host the coordinator process and provide high availability.

MSCS / WSFC集群API实际上并没有为相当有限的集群数据库(实际上只是复制的注册表项)之外的进程内通信提供机制。但您可以使用群集API /工具来托管协调程序进程并提供高可用性。

The easiest way to do this would be to just build a normal Windows service for your coordinator and then use the built in "Generic Service" cluster resource/application type to monitor it. That will let you assign an IP address to the coordinator that will follow it around the cluster. Note that moving the coordinator service will be disruptive, so if the node crashes that is hosting the coordinator, there will be downtime while it is started up on the surviving node.

最简单的方法是为协调器构建一个普通的Windows服务,然后使用内置的“通用服务”群集资源/应用程序类型来监视它。这将允许您为协调器分配IP地址,协调器将围绕群集进行跟踪。请注意,移动协调器服务将具有破坏性,因此如果节点崩溃承载协调器,则在幸存节点上启动时会出现停机。

I don't really see any reason to make the processing agents cluster aware. Just run them as services on each node, and let the coordinator monitor which ones are online.

我真的没有理由让处理代理群集知道。只需在每个节点上将它们作为服务运行,然后让协调器监控哪些是在线的。