Having one slave attached to 2 different masters ?

53 views
Skip to first unread message

Taher Furniturewala

unread,
Aug 12, 2015, 8:54:49 PM8/12/15
to Jenkins Users

Hi ,

 

Does anyone know if this is possible and if they have done it ? ie  Having a slave being attached to and working for 2 different Jenkins masters ?

 

Thanks

Taher .

 

 




This email and any attachments may contain confidential and privileged material for the sole use of the intended recipient. Any review, copying, or distribution of this email (or any attachments) by others is prohibited. If you are not the intended recipient, please contact the sender immediately and permanently delete this email and any attachments. No employee or agent of TiVo Inc. is authorized to conclude any binding agreement on behalf of TiVo Inc. by email. Binding agreements with TiVo Inc. may only be made by a signed written agreement.

Björn Pedersen

unread,
Aug 13, 2015, 3:09:50 AM8/13/15
to Jenkins Users
Hi,

it should be no problem to e.g. have  ssh-slaves  from to different masters running on the same machine(if you ensure to use different ports. But of course you will have 2 slave.jar running then. A single slave.jar process is always bound to a single master only.

Khai Do

unread,
Aug 13, 2015, 12:35:05 PM8/13/15
to Jenkins Users
Yes, we do that with ssh connected slaves.  if what you are really after is multi-master configuration you should check out the gearman plugin: https://wiki.jenkins-ci.org/display/JENKINS/Gearman+Plugin

Chanda Unmack

unread,
Aug 17, 2015, 4:56:58 PM8/17/15
to jenkins...@googlegroups.com
We've done that with both ssh slaves and windows slaves with jnlp; ssh is definitely easier :)
Both require separate root fs in the slave definition and for windows, had to modify the jenkins-slave.xml to change the name of the service so that each one is unique.

Taher Furniturewala

unread,
Aug 17, 2015, 11:27:50 PM8/17/15
to jenkins...@googlegroups.com

Thank you [Bjorn , Khai , Chanda ]  for the responses .

 

I have set different remote root directories for both slaves and also set different ports for both .  Am trying to connect via ssh .

 

Its still not happening : ie the connection is not maintained .  Slave ‘a’ connects and then gets disconnected  when slave ‘b’ connects .  The ps output on the master shows only 1 slave jar process at any time .

 

The below is see in the log of the slave which gets disconnected .   : any ideas ?

 

Note: Both the masters are at Jenkins 1.580.1  

 

<===[JENKINS REMOTING CAPACITY]===>channel started

Slave.jar version: 2.47

This is a Unix slave

Slave successfully connected and online

debug1: client_input_channel_req: channel 0 rtype exit-status reply 0

debug1: channel 0: free: client-session, nchannels 1

debug1: fd 0 clearing O_NONBLOCK

debug1: fd 1 clearing O_NONBLOCK

debug1: fd 2 clearing O_NONBLOCK

debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 41.1 seconds

debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0

debug1: Exit status 143

ERROR: Connection terminated

java.io.IOException: Unexpected termination of the channel

        at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:50)

Caused by: java.io.EOFException

        at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2325)

        at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2794)

        at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:801)

        at java.io.ObjectInputStream.<init>(ObjectInputStream.java:299)

        at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:40)

        at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)

        at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:48)

ERROR: Process terminated with exit code 143

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAEMChJjT4ih8cPtNveARw4sWzZrxShhZQiCgz0%2B%3DA%2BJ-u0WozA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Khai Do

unread,
Oct 16, 2015, 12:25:40 PM10/16/15
to Jenkins Users, tfurni...@tivo.com
I usually connect with 2 different users on the slave so that each connection has it's own WORKSPACE directory.  Try that and see if it works for you.
Reply all
Reply to author
Forward
0 new messages