Can't launch 2 slaves (having two different masters) on the same machine

206 views
Skip to first unread message

Raouf

unread,
Oct 1, 2013, 10:30:17 AM10/1/13
to jenkins...@googlegroups.com
Hi everybody,

Ii'm using two servers, one for jenkins master, and one for the slave instance 

I'm using Jenkins 1.456 as a main stream version, and was trying to prepare an upgrade to 1.518, so i just installed another jenkins master for testing puropose, and defined different ports for each one (the main master and the test master)

then i added a slave node to the test-master, and i had already a slave node for the main master.

i launch each slave by calling a script through ssh, something like

ssh me@my-slaves-server '/home/me/ slave_test.ksh start'

and the script is calling slaves that way

nohup /.../JAVA-6/bin/java -Xms512m -Xmx1024m -Djava.io.tmpdir=/tmp -jar /.../hudson_slave/jar/${HUDSON_VERSION}/slave.jar -jnlpUrl http://${MASTER_HOST}:${MASTER_PORT}/computer/${SLAVE_HOST}/slave-agent.jnlp   

The problem is, each time i launch the test-slave the main-slave goes offline and i have this stack trace

ERROR: Unable to launch the slave agent for my-slaves-server
java.io.EOFException: unexpected stream termination
	at hudson.remoting.Channel.<init>(Channel.java:408)
	at hudson.remoting.Channel.<init>(Channel.java:366)
	at hudson.remoting.Channel.<init>(Channel.java:327)
	at hudson.remoting.Channel.<init>(Channel.java:323)
	at hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:313)
	at hudson.slaves.CommandLauncher.launch(CommandLauncher.java:122)
	at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:200)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)


Any ideas about this issue ?

Thanks in advance !

Regards,
Raouf.

Les Mikesell

unread,
Oct 1, 2013, 10:37:18 AM10/1/13
to jenkinsci-users
What happens if you use the built-in ssh support instead of your own
script? And for testing, I'd start the slave as a different user for
the 2nd instance.

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

Raouf Abdelhamid

unread,
Oct 1, 2013, 11:18:59 AM10/1/13
to jenkins...@googlegroups.com
Actually i did try it and it worked well. But i don't know exactly wich slave jar was lanched, and i can't just abandon the scripts since they're doing some other stuff (logging, restarting on fail ...etc.)


2013/10/1 Les Mikesell <lesmi...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/sP31OAOj9k0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jenkinsci-use...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Les Mikesell

unread,
Oct 1, 2013, 11:42:12 AM10/1/13
to jenkinsci-users
On Tue, Oct 1, 2013 at 10:18 AM, Raouf Abdelhamid
<abdelham...@gmail.com> wrote:
> Actually i did try it and it worked well. But i don't know exactly wich
> slave jar was lanched, and i can't just abandon the scripts since they're
> doing some other stuff (logging, restarting on fail ...etc.)

The built in support should take care of getting the right jar in the
right place for you - and probably doing everything else jenkins
needs...

In any case, I'd run under different users with different home
directories so the jars and other files don't clobber each other.

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

Raouf

unread,
Oct 3, 2013, 4:26:11 AM10/3/13
to jenkins...@googlegroups.com
What i don't understand is that my scripts worked well when i was using 1.456, i could use as many test slaves as i wanted without having conflicts with the main slaves

The issue occurs only since i moved my test instances to a 1.5xx version, so i'd like to know what happened exactely, and how to get things back to normal.

Regards,
Raouf.

Raouf

unread,
Oct 3, 2013, 10:32:32 AM10/3/13
to jenkins...@googlegroups.com
By the way, i also noticed when using the built in ssh plugin, the slaves are launched by the anonymous account even if i created them with a specific admin user.

Les Mikesell

unread,
Oct 3, 2013, 11:30:21 AM10/3/13
to jenkinsci-users
On Thu, Oct 3, 2013 at 9:32 AM, Raouf <abdelham...@gmail.com> wrote:
> By the way, i also noticed when using the built in ssh plugin, the slaves
> are launched by the anonymous account even if i created them with a specific
> admin user.
>

What is an anonymous account?

And are you trying to run in the same FS root? I wouldn't expect
that to work at all, at least not concurrently.

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

Raouf Abdelhamid

unread,
Oct 3, 2013, 2:52:39 PM10/3/13
to jenkins...@googlegroups.com
when not specified, jenkins seems to use an account called anonymous to communicate with slaves

What's the problem with using the same file system ? can you explain please ?

ps: i'd like to remind you that it was working pretty well under 1.456, so what has changed since then ?


2013/10/3 Les Mikesell <lesmi...@gmail.com>

Les Mikesell

unread,
Oct 3, 2013, 4:24:27 PM10/3/13
to jenkinsci-users
On Thu, Oct 3, 2013 at 1:52 PM, Raouf Abdelhamid
<abdelham...@gmail.com> wrote:
> when not specified, jenkins seems to use an account called anonymous to
> communicate with slaves

That doesn't make any sense to me in the context of ssh which is going
to need a specific matching account as a login on the target node.

> What's the problem with using the same file system ? can you explain please
> ?

Where do the slave jar, etc., and other supporting files live? Not to
mention the potential conflicts if you happen build the same job
concurrently.

> ps: i'd like to remind you that it was working pretty well under 1.456, so
> what has changed since then ?

How many different versions of the slave.jar were you running then?

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

Raouf

unread,
Oct 4, 2013, 3:51:44 AM10/4/13
to jenkins...@googlegroups.com
Of course i'm using a specific account when using ssh, however, when i disconnect (with the same account logged in) a slave from jenkins's interface, i get "Disconnected by anonymous" displayed

Concerning the FS, i was running the same version (1.456) for both masters and slaves, and it always worked well since each one launches a independent java process (some it doesn't matter whether they run from the same jar or not)

But when i moved to 1.518, it looks like there is some conflict (and i suspect the default port) when i launch two slaves, even with two different masters

Les Mikesell

unread,
Oct 4, 2013, 11:35:34 AM10/4/13
to jenkinsci-users
On Fri, Oct 4, 2013 at 2:51 AM, Raouf <abdelham...@gmail.com> wrote:
> Of course i'm using a specific account when using ssh, however, when i
> disconnect (with the same account logged in) a slave from jenkins's
> interface, i get "Disconnected by anonymous" displayed

I think that refers to the user logged into the jenkins interface.
Did you log in and authenticate as some other user in the session
where you did the disconnect?

> Concerning the FS, i was running the same version (1.456) for both masters
> and slaves, and it always worked well since each one launches a independent
> java process (some it doesn't matter whether they run from the same jar or
> not)

How is running a different jar possible? The server should
automatically download the current version of the jar files when
starting via ssh.

> But when i moved to 1.518, it looks like there is some conflict (and i
> suspect the default port) when i launch two slaves, even with two different
> masters

I thought you said it only happens when you start with your custom ssh
script, not the internal ssh support. The ports used shouldn't
change.

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

Raouf Abdelhamid

unread,
Oct 4, 2013, 3:09:36 PM10/4/13
to jenkins...@googlegroups.com
i was logged with another account (let's call it myAccount) however, when i shut down the slave from the jenkins nodes interface, it showed the previous message

i never said i was running a different jar, i said i was running a different java process.

do you have any documentation about jenkins slaves ? I'd like to know more about the default behaviour in that kind of situation


2013/10/4 Les Mikesell <lesmi...@gmail.com>

Les Mikesell

unread,
Oct 4, 2013, 3:35:49 PM10/4/13
to jenkinsci-users
On Fri, Oct 4, 2013 at 2:09 PM, Raouf Abdelhamid
<abdelham...@gmail.com> wrote:
> i was logged with another account (let's call it myAccount) however, when i
> shut down the slave from the jenkins nodes interface, it showed the previous
> message

This login was in the same web session? Are you using the matrix
based security in jenkins, and if so, is the Anonymous user allowed to
connect/disconnect slaves? If you repeat this scenario, do you see
your login name in the top bar of the web page as you disconnect?

> i never said i was running a different jar, i said i was running a different
> java process.

I think it has to be a different jar if jenkins is starting it via
ssh, because it will download it for you. Try setting up a different
user with no jars at all in the target directory.

> do you have any documentation about jenkins slaves ? I'd like to know more
> about the default behaviour in that kind of situation

No - but you could always poke through the source code. But, I would
never have considered running two different masters for slaves in the
same space concurrently in the first place. Why do you think they
shouldn't conflict with each other, especially when they need
different jars of the same name? Perhaps more to the point, why do
you want to do this? Maybe there is a better approach to whatever it
is you are trying to do.

--
Les Mikesell
lesmi...@gmail.com
Reply all
Reply to author
Forward
0 new messages