我可以安全地运行同一 Windows 服务的多个实例吗?

发布于 2024-10-07 19:42:11 字数 269 浏览 0 评论 0原文

我有一个在服务器上运行的 Windows 服务。它是我们现有系统的一个“帮助应用程序”,它使用特定的数据库配置执行非常具体的任务(根据配置下载 html 文件)。

我们现在正在开发一个与现有系统非常相似的系统(至少从表面上看,该服务会产生影响)。我需要有一个不同的服务实例来运行具有不同数据库配置的同一服务器,以便它可以为新系统以及现有系统执行其任务。

有人可以告诉我,如果我在同一个盒子上安装同一服务的第二个实例是否会导致问题?

我打算从与原始安装目录不同的目录安装该服务。

I have a windows service running on a server. It's a 'helper app' for a system we have and it does a very specific task (downloads html files based on the config) with a specific database configuration.

We're now developing a system that's very similar to the existing system (at least on the face of it, where this service has an impact). I need to have a different instance of the service to run the same server with a different database configuration, so it can do its task for the new system, as well as the existing system.

Can somebody tell me if it's going to cause problems if I install a second instance of the same service on the same box?

I intend to install the service from a different directory from where the original is installed.

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

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

发布评论

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

评论(2

星星的軌跡 2024-10-14 19:42:11

事实证明我不能。我需要为服务的每个实例指定一个唯一的名称。不过没什么大不了的。

It turns out I couldn't. I needed to give each instance of the service a unique name. Not a big deal though.

南薇 2024-10-14 19:42:11

只要程序本身不会以导致各个实例发生冲突的方式执行操作(例如尝试同时写入相同的文件等),这根本就不是问题。只要每个都被配置/编码以保持其自身,就可以了。

This won't be a problem at all as long as the program itself does not do things in a way that would cause the various instances to conflict - like trying to write to the same files at the same time, or the like. As long as each is configured/coded to keep to itself, it will be fine.

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