Jenkins chooses incorrect node

233 kali dilihat
Langsung ke pesan pertama yang belum dibaca

Alex Domoradov

belum dibaca,
25 Feb 2016, 04.30.0725/02/16
kepadaJenkins Users

Hello,


Some time ago Jenkins has started run jobs on slave node (win 7).


[EnvInject] - Loading node environment variables.

Installing JDK jdk-8u74-oth-JPR
Downloading JDK from http://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-windows-x64.exe

Downloading 196405336 bytes

Installing D:\jenkins\tools\hudson.model.JDK\jdk-sun-1.8.74\jdk.exe

[jdk-sun-1.8.74] $ D:\jenkins\tools\hudson.model.JDK\jdk-sun-1.8.74\jdk.exe /s ADDLOCAL="ToolsFeature" REBOOT=ReallySuppress INSTALLDIR=D:\jenkins\tools\hudson.model.JDK\jdk-sun-1.8.74 /L D:\jenkins\tools\hudson.model.JDK\install1182473847874408631log

Building remotely on win7 (WINDOWS) in workspace D:\jenkins\workspace\resin-deploy

Cloning the remote Git repository
...
[EnvInject] - Injecting environment variables from a build step.
[EnvInject] - Injecting as environment variables the properties content 
JAVA_HOME=/var/lib/jenkins/tools/hudson.model.JDK/jdk-sun-1.8.74

[EnvInject] - Variables injected successfully.
FATAL: Cannot find executable from the chosen Ant installation "ant-1.9.6"
Build step 'Invoke Ant' marked build as failure
SSH: Current build result is [FAILURE], not going to run.
Finished: FAILURE


The slave node was connected via



> java -jar d:\jenkins-slave.jar -jnlpUrl http://jenkins.example.net:8080/computer/win7/slave-agent.jnlp -secret {SECRET}


 

For example build 10 was built on Master node (linux) and build 11 was built on Slave (windows 7). How can I revert the old behavior and tell Jenkins build all jobs on master node by default ?

Victor Martinez

belum dibaca,
25 Feb 2016, 07.19.5325/02/16
kepadaJenkins Users
Hi,

 You might need to configure your jobs in order to use the 'master' label, it's part of the 'Restrict where this project can be run' configuration. Although using your master for building and so on it's ideal.

Cheers

Alex Domoradov

belum dibaca,
25 Feb 2016, 07.42.2925/02/16
kepadaJenkins Users
So, every time when I'll create a new job I must specify a node? Have I correctly understood?

It's a little bit strange, because we have another instance with Jenkins (ver. 1.565.2) and there all jobs by default executes on MASTER node. If I need a job will execute on some specific node then I just specify it on job settings page as you mentioned before.

Victor Martinez

belum dibaca,
25 Feb 2016, 08.19.1725/02/16
kepadaJenkins Users
I don't know now how that version of Jenkins used to distribute the load and the default node setup. AFAIK, if that jenkins infrastructure is based on one master then those jobs will be always triggered by those 'master slave', otherwise those jobs will require where to run.

Jenkins tries to allocate those jobs to the last node is was executed on, by default, unless that node is busy then will choose another one:

Alex Domoradov

belum dibaca,
25 Feb 2016, 10.35.5325/02/16
kepadaJenkins Users
Thanks, will bear in mind

R. Tyler Croy

belum dibaca,
25 Feb 2016, 11.14.0125/02/16
kepadajenkins...@googlegroups.com
(replies inline)

On Thu, 25 Feb 2016, Alex Domoradov wrote:

> Some time ago Jenkins has started run jobs on slave node (win 7).



You have a couple options to consider. One when configuring build nodes,
choosing "Only build jobs with label restrictions matching this node" will
ensure that only when you explicitly "Restrict where this project can be run"
and enter the appropriate label. This will ensure Jenkins doesn't schedule work
on that node unless a job has explicitly requested it.


Additionally/optionally, it's a good practice to label all nodes, including the master,
with labels that describe its capabilities. In your example I would suggest
labeling all nodes which are intended to perform ant builds with the "ant"
label, then restricting your project to only build on nodes labelled with
"ant". This syntax can be combined to include multiple labels via a label
expression, e.g. "ant && linux"
> --
> 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/59c9cda5-424b-4ff6-a05c-d602ad07f515%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


- R. Tyler Croy

------------------------------------------------------
Code: <https://github.com/rtyler>
Chatter: <https://twitter.com/agentdero>

% gpg --keyserver keys.gnupg.net --recv-key 3F51E16F
------------------------------------------------------
signature.asc
Balas ke semua
Balas ke penulis
Teruskan
0 pesan baru