监控机器集群中的多个Windows服务实例

发布于 2024-08-02 01:54:36 字数 343 浏览 3 评论 0 原文

我已经实现了一个 Windows 服务应用程序,该应用程序将部署到多台计算机并同时运行以处理中央队列中的任务。 我为每个正在运行的服务实例都有一个日志文件。 但我希望能够定期监视服务的所有实例并检索应用程序特定信息,例如每个服务正在处理的任务的名称和 ID。

我正在考虑在每台计算机上添加一个 Web 服务来公开这些只读信息,并编写另一个应用程序(可能是 Web 应用程序)来通过网络检索这些信息并很好地显示它们。 但这是好方法吗? 还有其他想法吗? 我不想使用任何现成的产品。 请提供您的建议。

提前致谢!

[我尝试在下面提供我的实现作为答案。 如果您有兴趣,请阅读。 谢谢。]

I have implemented a windows service application that will be deployed to multiple machines and run concurrently to process tasks in a central queue. I have a log file for each instance of service running. But I want to be able to monitor all instances of the service and retrieve application specific information, such as Name and ID of the task being processed by each service, periodically.

I am thinking to add a web service on each machine to expose those read-only info, and write another app (maybe web app) to retrieve those info across the network and to display them nicely. But is this the good approach? Any other thoughts? And I prefer not to use any off-the-shelf product. Please provide your advice.

Thanks in advance!

[I try to provide my implementaion below as an answer. Read if you are interested. Thanks.]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

笑叹一世浮沉 2024-08-09 01:54:36

如果您的服务有一个 API 可以通过网络检索此信息,那么创建一个检查所有正在运行的服务器状态的客户端将相当容易。

这就是许多计算集群服务的工作方式——它们运行,客户端可以调度任务并查询它们。 任何技术都可以在这里使用,尽管对于 .NET,WCF 可能会让这变得相当简单和强大。

If your service had an API to retrieve this information via networking, it would be fairly easy to make a client that checked the status of all of the running servers.

This is how many computing cluster services work - they run, and a client can schedule tasks as well as query them. Any technology can be used here, although for .NET, WCF would probably make this fairly easy and robust.

沉溺在你眼里的海 2024-08-09 01:54:36

这可能有点过头了,但请查看 System Center Operations Manager 。 如果您不仅想为应用程序的状态提供“仪表板”样式的信息,而且还想为跨多台计算机(或跨数据中心)的计算机和数据库提供“仪表板”式信息,那么 SCOM 是一个不错的起点。

It might be overkill, but check out System Center Operations Manager. If you want to give "dashboard" style information to the status of not only your applications, but the machines and databases across many machines (or across a datacenter), SCOM is a good place to start.

澜川若宁 2024-08-09 01:54:36

我最终实现了与里德·科普西建议的非常相似的东西。 由于应用程序已经是一个 Windows 服务,因此我为要公开的信息定义服务/数据契约,并将 WCF 托管在同一服务上。 该解决方案允许我的客户端(调度程序或 UI 应用程序)从集群中运行的所有服务实例中检索信息。

I ended up implmeneted something very similar to what Reed Copsey suggested. Since the application is already a Windows service, I define service/data contract for the information that I want to expose and host the WCF on the same service. This solution allows my client, either scheduler or UI app, to retrieve the information from all instances of service running in the cluster.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文