How can jenkins master share slave nodes.

2,175 views
Skip to first unread message

Shen Hui

unread,
Oct 10, 2012, 8:52:53 AM10/10/12
to jenkins...@googlegroups.com
Hi buddy,
I have 5 masters, and suppose I have a slave pool with 20 nodes.
Can these 5 master share these 20 slaves; because if i separate 20 slave
into 5 group(each has 4), each attached to a master, that's meaning a single
master can schedule only with 4 slaves; so there is this case, some groups
are busing, and other may be idle. i'd like these 20 slaves can share jobs
schedule among these 5 masters.
Can anybody help me on this? Appreciate very much.





--
View this message in context: http://jenkins.361315.n4.nabble.com/How-can-jenkins-master-share-slave-nodes-tp4642699.html
Sent from the Jenkins users mailing list archive at Nabble.com.

Mark Waite

unread,
Oct 10, 2012, 9:59:22 AM10/10/12
to jenkins...@googlegroups.com
I've run multiple slave agents on a single computer from different masters.  I had to assure that each slave agent had its own dedicated directory, distinct from every other slave agent on that computer.  I appended the name of the master into the slave agent directory name and that was sufficient for my case.

You might also refer to http://jenkins.361315.n4.nabble.com/Multiple-master-with-shared-slave-pool-td3561822.html for comments from an earlier thread.

Mark Waite


From: Shen Hui <shen...@baidu.com>
To: jenkins...@googlegroups.com
Sent: Wednesday, October 10, 2012 6:52 AM
Subject: How can jenkins master share slave nodes.

Shen Hui

unread,
Oct 10, 2012, 10:23:57 PM10/10/12
to jenkins...@googlegroups.com
Yes, Mark, I agree your solution is workable.
But as you said each slave is working in itself sandbox, there is no shared
knowledge between the
masters about each others utilization; that means masters can send jobs into
same slave at the same time.
I wish if one master find a slave is running(its job is delivered by other
master), it will try to deliver job into another slave; that mean masters
share a slave group.



--
View this message in context: http://jenkins.361315.n4.nabble.com/How-can-jenkins-master-share-slave-nodes-tp4642699p4642821.html

Mark Waite

unread,
Oct 11, 2012, 12:04:29 AM10/11/12
to jenkins...@googlegroups.com
Interconnecting multiple Jenkins masters to schedule jobs on slaves seems even more complicated than improving the slave scheduling algorithm, and the slave scheduling algorithm has been quite difficult as far as I can tell.  I'm not aware of any plugins that will help with what you're trying to do.

Mark Waite

Sent: Wednesday, October 10, 2012 8:23 PM
Subject: Re: How can jenkins master share slave nodes.

Shen Hui

unread,
Oct 11, 2012, 1:05:00 AM10/11/12
to jenkins...@googlegroups.com

vf

unread,
Oct 12, 2012, 1:14:22 AM10/12/12
to jenkins...@googlegroups.com
Not sure if i understand you correctly. A slave is only a logical unit, it has not to be a physical machine. You can have multiple slaves running on one host, without interfering each other. So, every master can have as many slave as you want on any hosts, as long as each slave (not host) has its own root-fs. Then it does not matter hou many hosts you have, you can have 5 *independent* jenkins master-slave cluster across your build farm, each one does not care (does not know) the existence of other clusters. You can share all the hardware resources of you 20 hosts, the slave configuration is totally orthognal.

So you can share the hardware resources across 5 independent clasters, each has (theoretically) as many slaves as necessary. but if you want to share the (logical unit) *slave*, i dont think it is possible, even it is, i can not find any reason to do so.



Shen Hui <shen...@baidu.com> schrieb:

--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.

Shen Hui

unread,
Oct 12, 2012, 3:59:22 AM10/12/12
to jenkins...@googlegroups.com

Yes, I do want to share the logical slave, because if there is a master that delivered a job to slave1 (physical machine), and I want another master to deliver its job to slave2(physical); in this case, we can balance the jobs between different physical machine.

 

 

Shen Hui

BB - F2 - AW264|x28530

 

发件人: vf-2 [via Jenkins] [mailto:[hidden email]]
发送时间: 20121012 13:15
收件人: Shen,Hui
主题: Re: How can jenkins master share slave nodes.

 

Not sure if i understand you correctly. A slave is only a logical unit, it has not to be a physical machine. You can have multiple slaves running on one host, without interfering each other. So, every master can have as many slave as you want on any hosts, as long as each slave (not host) has its own root-fs. Then it does not matter hou many hosts you have, you can have 5 *independent* jenkins master-slave cluster across your build farm, each one does not care (does not know) the existence of other clusters. You can share all the hardware resources of you 20 hosts, the slave configuration is totally orthognal.

So you can share the hardware resources across 5 independent clasters, each has (theoretically) as many slaves as necessary. but if you want to share the (logical unit) *slave*, i dont think it is possible, even it is, i can not find any reason to do so.



Shen Hui <[hidden email]> schrieb:

Hi buddy,
I have 5 masters, and suppose I have a slave pool with 20 nodes.
Can these 5 master share these 20 slaves; because if i separate 20 slave
into 5 group(each has 4), each attached to a master, that's meaning a single
master can schedule only with 4 slaves; so there is this case, some groups
are busing, and other may be idle. i'd like these 20 slaves can share jobs
schedule among these 5 masters.
Can anybody help me on this? Appreciate very much.





--
View this message in context: click here.
NAML


View this message in context: 答复: How can jenkins master share slave nodes.

Les Mikesell

unread,
Oct 12, 2012, 8:38:23 AM10/12/12
to jenkins...@googlegroups.com
On Fri, Oct 12, 2012 at 2:59 AM, Shen Hui <shen...@baidu.com> wrote:
> Yes, I do want to share the logical slave, because if there is a master that
> delivered a job to slave1 (physical machine), and I want another master to
> deliver its job to slave2(physical); in this case, we can balance the jobs
> between different physical machine.
>

I don't think jenkins currently has any way to track other sources of
load on the slaves. Why not run all your jobs on one master so the
queuing will work more efficiently?

--
Les Mikesell
lesmi...@gmail.com

Shen Hui

unread,
Oct 16, 2012, 3:29:59 AM10/16/12
to jenkins...@googlegroups.com
Because we have too many jobs (more than 1 thousand) coming from different
divisions; we wish each division use a separated master, and all masters can
share a slave pool.



--
View this message in context: http://jenkins.361315.n4.nabble.com/How-can-jenkins-master-share-slave-nodes-tp4642699p4643446.html

Les Mikesell

unread,
Oct 16, 2012, 11:57:21 AM10/16/12
to jenkins...@googlegroups.com
On Tue, Oct 16, 2012 at 2:29 AM, Shen Hui <shen...@baidu.com> wrote:
> Because we have too many jobs (more than 1 thousand) coming from different
> divisions; we wish each division use a separated master, and all masters can
> share a slave pool.
>

One master with 1000+ jobs and 20 slaves doesn't sound like a big
problem, other than the one mentioned here recently about keeping a
lot of archived builds which jenkins currently keeps in memory.

If you really need separation, maybe you can set up some sort of cloud
of VMs for slaves and let each master spin up a certain number on
demand. I can see where a concept of shared slaves - or perhaps more
generally, scheduling jobs based on slave load (prefer least loaded,
defer at some threshold) would be very useful, but I don't think there
is anything that currently works that way.

--
Les Mikesell
lesmi...@gmail.com

Marek Gimza

unread,
Oct 16, 2012, 12:12:51 PM10/16/12
to jenkins...@googlegroups.com
Mikesell,

Sorry for responding a bit late, but it is better than not at all!

We have a setup where:
1. The Nodes/Slaves are chosen from the master by Node-Label.
2. We use the MultiJob plugin to start all jobs from the master.
3. The WORKSPACE is determined by the parent JOB/BUILD on the master, and passed down to each child job/build.  We had to slightly modify AbstractProject.java, AbstractBuild.java and resources/lib/hudson/project/config-customWorkspace.jelly such that the parent JOB/BUILD could allocate the WORKSPACE using the parent Job's CustomWorkspace and not the Node's "Remote FS Root" path. 

This setup allows all of the builds to share the machines without any conflict for the build's WORKSPACE.

I hope that this helps.

Let me know if you would like to know about the code changes we made to support this setup.

...
Mgimza
Reply all
Reply to author
Forward
0 new messages