Can single Jenkins slave serve multiple Jenkins masters?

5,804 views
Skip to first unread message

Kevin

unread,
Jul 16, 2014, 11:51:46 AM7/16/14
to jenkins...@googlegroups.com
Hi, all:

I have two Jenkins masters trying to run a test, and that test resides in single computer which is hooked up with test hardware set.

My question is:
Can I turn that computer (which is connected to test hardware) into a Jenkins slave so that both Jenkins master can run test when needed?

Thanks!

Kevin


Scott Evans

unread,
Jul 16, 2014, 11:55:36 AM7/16/14
to jenkins...@googlegroups.com
What you'd need to do is set up multiple agents on the slave node, one agent for each Jenkins master.  You would also need to set up independent workspaces for each agent as well.  This is assuming that your test hardware can handle more than one job at a time.  We do this a lot and it works fine, assuming that multiple slave jobs can run simultaneously without conflict. 

Scott


--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kevin

unread,
Jul 16, 2014, 2:59:31 PM7/16/14
to jenkins...@googlegroups.com
Hi, Scott:

Thanks for the answer!

With the first slave running, I setup a different workspace for 2nd slave, and try to launch 2nd slave. It seems work, but when I click "File"--> "Install as a service" on this following window:



It fails and never returns. All I see is a circle rolling in this window and never stops. If I close this window, the master Jenkins will report this slave goes offline.

Anything I should check to fix this issue?

Thanks!

Kevin

Kevin

unread,
Jul 16, 2014, 3:18:20 PM7/16/14
to jenkins...@googlegroups.com
Also, when start 2nd slave, do we suppose to see two "Jenkins Slave" items on windows service list?


Kevin

On Wednesday, 16 July 2014 11:55:36 UTC-4, SA Evans wrote:

Scott Evans

unread,
Jul 16, 2014, 3:30:49 PM7/16/14
to jenkins...@googlegroups.com
Kevin,

I don't do my windows slaves by service, I do the java start on them, so I don't know what you'd see/experience if you tried to start more than one as a service.

Scott

Slide

unread,
Jul 16, 2014, 3:45:57 PM7/16/14
to Jenkins User Mailing List

Stephen Connolly

unread,
Jul 17, 2014, 4:03:13 AM7/17/14
to jenkins...@googlegroups.com
You can have multiple jenkins masters configured with the same connection details (ensure you select distinct remote paths mind) and connect them to the same machine.

The only issue you may see is if all the Jenkins masters try to run builds on that node at the same time. The Jenkins masters have no way to communicate or coordinate the sharing of the same physical resource.

If the risk of multiple parallel usage is a major worry there are some ways to work around that:

1. Have a prefix or suffix start command that obtains a "lock" file or exits with a non-zero exit code and do not have the slaves with "Always connected" strategy.... requires manual setup, and if for any reason the "lock" file is stale no builds will take place until you manually intervene

<warning message="advert">
2. Use a commercial offering for sharing slaves between masters a.k.a. Jenkins Operations Center by CloudBees.
</warning>

But if you don't see that as a major risk, just go ahead and connect the three masters to the same machine!


Reply all
Reply to author
Forward
0 new messages