add Jenkins slave node

By default Jenkins will execute all jobs on node it is installed – so called master node. If you want to run it on single node, then this is fine, and no need to change it. However, Jankins CI has nice feature where you can particular job instruct to be executed on some other machine ( in Jenkins terminology slave node ) / or some other machines.

In order to archive this, it is first necessary to define slave node. To achieve this, do Manage Jenkins -> Manage Nodes -> New Node and define node. It has to be reachable from Jenkins master, so ensure DNS / iptables is configured properly on master / slave machine.
After finishing above, Jenkins will take some time to configure slave – it will download Java it needs ( in case not already installed ) and rest. Be patient.

Once above is finished, you should see in logs below what will confirm that node is slave and ready for usage.

Expanded the channel window size to 4MB
[08/14/15 11:03:37] [SSH] Starting slave process: cd "/var/jenkins" && java  -jar slave.jar
channel started
Slave.jar version: 2.52
This is a Unix slave
Evacuated stdout
Slave successfully connected and online

Having slave node as main purpose has to run jobs on it. In order to instruct Jenkins job to run on slave, do
New item -> (give name to job and pick up job type - on next screen ) and pick up Restrict where this project can be run
This Restrict where this project can be run defines where job will be run, put here name ( or label in case you assigned it to slave ) of slave node. After this, when job is started, it will be executed on slave specified instead of master.


#continious-integration, #jenkins-ci, #jenkins-slave-node