Switch job on online Node jenkins

5.9k views Asked by At

I have jenkins and job in jenkins with selection "Node" (Server) by users and "Label Expression" (ex. server1||server2). But, if my server1 is gone to offline, I want to start my job on server2 automatically. Can anyone help me?

Thanks.

1

There are 1 answers

4
Gerold Broser On

Jenkins' node labels are supposed to be used the other way round. See Manage JenkinsManage Nodes → select a node → Configure → Click to the right of the Labels field:

Labels (AKA tags) are used for grouping multiple slaves into one logical group.

So each of your servers (Server1, Server2) should have the same label assigned to it. Let's say build. Define this in Label Expression in your project.

Select Ignore offline nodes under This build is parameterizedNodeNode eligibility.

Such, if a user selects an offline node the other one of the group should be taken (if this one is online).