简体   繁体   English

在远程计算机上执行负载平衡脚本

[英]Loadbalancing script execution on remote machine

I have several Powershell scripts that I want to execute on 4 remote machines. 我有几个要在4台远程计算机上执行的Powershell脚本。 I want to do that in a load-balanced way. 我想以负载平衡的方式做到这一点。 That is, the application/tool I am looking for (or should build) should schedule 1 script on each of the 4 remote machines and wait. 也就是说,我正在寻找(或应该构建)的应用程序/工具应在4台远程计算机上安排1个脚本并等待。 Anytime a machine completes executing a script, it should schedule another script to it for execution. 每当计算机完成执行脚本时,都应安排另一个脚本执行。 This should continue till all the scripts are executed. 这应该继续直到所有脚本执行完毕。

I am willing to use either C# or Powershell to implement this. 我愿意使用C#或Powershell来实现这一点。 Can someone please tell if there is an easy way to achieve this? 有人可以告诉您是否有一种简单的方法来实现这一目标吗? Is there any tool or app already available to be used? 是否有可用的工具或应用程序可用?

Any help will be greatly appreciated. 任何帮助将不胜感激。

Just write a simple controller and a windows service. 只需编写一个简单的控制器和Windows服务即可。 Install the service on each of your 4 machines, and the controller on your primary machine. 将服务安装在4台计算机的每台计算机上,并将控制器安装在主计算机上。

The service should check in with the controller after each completed script execution to see if there is more work to do. 每次执行完脚本后,服务应与控制器签入,以查看是否还有更多工作要做。 If there is, grab the next script and execute. 如果存在,请获取下一个脚本并执行。 If not, go idle and continue checking in every so often. 如果没有,请保持空闲状态,并经常检查。

The design for this type isn't not very complicated. 这种类型的设计不是很复杂。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM