推荐的多主/多从 Jenkins 设置负载平衡方法是什么
我想设置一个 N-master x M-slave Jenkins 构建/执行场。
我希望允许多个项目运行自己的 Jenkins 主服务器,每个项目将其构建分发到同一个 Jenkins 从属服务器池中。
所以每个从站都会有单独配置的工作区等等。
在从站之间平衡作业的推荐方法是什么? 即,如果 Master 1 已经在 Slave 1 上启动了一项工作,并且 Master 2 来运行一项工作,我希望它选择 1 以外的一个 Slave 来运行该工作。
建议的设置方法是什么?
I would like to setup an N-master x M-slave Jenkins build/execution farm.
I'd like to allow multiple projects to run their own Jenkins master server, each distributing their builds into the same pool of Jenkins slaves.
So each slave will have separately configured workspaces and so on.
What is the recommended way of load balancing the jobs across the slaves?
i.e. if Master 1 has kicked off a job on Slave 1, and Master 2 comes along to run a job, I'd like it to pick a slave other than 1 to run that job on.
What is the recommended way of setting that up?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有几种方法可以做到这一点。您可以创建在任何打开的执行器上运行的作业。执行器是 Jenkins 运行作业的基础。假设 Jenkins 的每个实例都有一个执行器,如果一个 master 在 Slave1 上执行某些操作,它将占用一个执行器。因此,当 master 2 尝试运行某些内容时,它将在 Slave2(或任何其他可用的执行器)上运行它,因为 Slave1 很忙。
这取决于两件事:
Jenkins 确实会尽可能地管理负载,但我建议为机器上的每个可用核心配备一个执行程序,这样您的机器就不会被拖垮,并让 Jenkins 处理它们实际运行的位置。您甚至还可以将作业与特定机器绑定。
祝你好运。
There are couple of ways you could do this. You could create the job to run on any open executor. An executor is what Jenkins runs jobs on. Assuming each instance of Jenkins has one executor, if one master executes something on Slave1 it will then take up one executor. So when master two tries to run something, it will run it on Slave2 (or any other executor that is available), since Slave1 is busy.
This depends on two things:
Jenkins does manage load as best as it can, but I would recommend having one executor for every core available on the machine, so your machines aren't flogged down, and let Jenkins handle where they are actually run. You can even tie jobs to specific machines as well.
Good luck.