Refer:
Https://wiki.jenkins-ci.org/display/JENKINS/Step+by+step+guide+to+set+up+master+and+slave+machines
1. Create a new slave
Note that slave in Jenkins is called note. So the followingArticleSlave and node in are the same thing.
1) Under manage Jenkins --> manage nodes --> new node: Enter the node name, select dumb slave as the slave type, and then OK.
2) on the slave configuration page, enter the following:
* Number of executors: one or more;
* Enter the following directory on the slave, for example, C: \ Jenkins;
* Usage selection:Leave this machine for tied jobs only;
* Lunch method: Launch slave agents via Java Web Start;
* Avaliablitiy:Keep this slave online as much as possible;
* Save it;
3) log on to the Jenkins master on the server where the slave is located, enter the manage Jenkins --> manage nodes --> new note, click launch, and then install the slave as a Service as follows:
4) after the installation is successful, the following information is displayed:
2. Run the job on slave
Add a label to the above slave to indicate the usefulness of this slave, and select leave this machine for tied jobs only for the uage:
Modify the job in building javahelloworld For Jenkins as follows:
Select restrict where this project can be run and enter the note (slave) label.
In addition, because the svn address is correct, Jenkins will prompt you to enter the svn user name and password.
At this time, the job will run on the server where the slave is located. Of course, the environment required for the build should be configured on the slave and run as follows:
Note: Jenkins slave does not take effect immediately when you modify the environment variables of the slave system. You need to restart the Jenkins slave service. For example, if I have installed ant on slave and cannot be found after it is set to path, we need to restart Jenkins slave service.
For more information, see:
Https://wiki.jenkins-ci.org/display/JENKINS/Distributed+buildshttp://community.jboss.org/wiki/HudsonWindowsSlavesSetup
Complete!