Step by step guide to set up master and slave machines

1.  Manage Hudson --> Manage Nodes

2.  New Node --> Enter Node Name (can only choose Dumb Slave currently)

From (http://stackoverflow.com/questions/3294386/hudson-step-by-step-guide-to-set-up-master-and-slave-machines)( Thanks William Leara)

Master machine

1. Click the "Build Executor Status" link on the left sidebar (in earlier releases Go to "Manage Hudson"->"Configure Executors")
2. For each slave, do the following configuration
3. Press the "New Node" link on the left sidebar (in earlier releases press the "Add" button under the "Slaves" section)
4. "Name" - Enter a name for the slave, ex "slave1"
5. "# of executors" - Enter the number of executors for the slave, that is the number of concurrent builds allowed on the slave. A good value to start with would be the number of processors.
6. "remote FS root" - Enter the absolute path of this work directory on the slave, such as '/export/home/hudson'. The directory will be created on the slave and all data needed in a build will be stored there. ex "c:\temp\hudson_tst"
7. "usage" - Set it to "Utilize this slave as much as possible"
8. "labels" - Enter any number of labels for the slave, ex "windows", "linux", "jdk"
9. Press "Save" to store all slave configurations
10. Go to the main page
11. Create a new free style project and configure it as:
12. Check the "Tie this project to node" check box
13. Select one of the slaves in the combo box in the "Tie this project to node" section
14. Check the "Execute Windows batch command"
15. Enter "dir" into the text area in the "Execute Windows batch command" section
16. Save the configuration by pressing "Save"

Slave machine

1. Start a web browser and go to the Hudson main page (located on the master machine)
2. Click on the slave's name in the Build executor list, and a page describing the slave is shown
3. Launch the slave agent by clicking on the "Launch slave agent" link
4. Wait until the web start application has started and shown a window stating that the slave is connected to the master server ("Connected")
5. Go to the Hudson main page on the master server
6. Verify that the slave is no longer marked as offline
7. Start the build that was tied to the slave (ie step 5 above). This will start a build on the slave, you can verify that it was executed on the slave by going to the "remote FS root" that was specified for the slave. It should now contain a folder called "workspace".
8. Go to the build history and verify that it was executed on the slave.

Notes

1. When setting up slave, it is likely that you will also need to install additional software. Remember to kill the slave agent and restart it from the command line (the browser may still have previous environment). After restart, check the System Information for the node to ensure that Path/PATH and environment variables are correct.
2. When using git as SCM, specify the full path of git.exe (Windows) or git (Linux) in the Home field of Node Configuration > Tool Locations for Git.

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Nov 18, 2009

    David Aldrich says:

    Looking forward to this page being available. I am just getting started with a m...

    Looking forward to this page being available. I am just getting started with a master/slave configuration and know nothing!

  2. Dec 04, 2009

    Martin Thomas says:

    Waiting for this page to come and still looking for clues about the master/slave...

    Waiting for this page to come and still looking for clues about the master/slave configuration.

  3. Jan 28, 2010

    Alex Lombardi says:

    I am trying to set up several slaves as windows services on one machine and then...

    I am trying to set up several slaves as windows services on one machine and then connecting them to a master on another windows server, and am getting nowhere with this. I can not find any documentation anywhere on what the process would be to do this. I have configured and added slaves on the same machine as my master, but that's obviously not what I want. Any help please?

    1. Feb 22, 2010

      Joshua Darling says:

      I'm probably too late for you, but maybe this will be helpful for other people w...

      I'm probably too late for you, but maybe this will be helpful for other people who come here.

      Here is what has worked for me for most of my build projects.

      Log onto the machine that you want to set up as a slave. Connect to your server (http://servername:8080, replacing servername with the actual name of the server) and click on Manage Hudson. Click on Manage Nodes and then click on New Node. Give it a name and choose Dumb Slave and click OK (for future slaves you can just copy from existing). Fill in the fields, leaving settings at their defaults, and click Save.

      Now that it is created, you can click on it in the list of nodes. It should show a page that tells you how to launch the slave. Since you are already on the slave machine, you just need to click the Launch button. It will start up the slave under Java and will say it is connected if it all went well.

      Then you simply click on the File menu in that java window and choose Install as a Windows Service. It should then set up the service and shut down the slave agent you had just launched. From there, you don't really have much to do besides send builds to it.

      Like I said, this has worked for me with most of my build configurations, so I guess this could be considered the basic setup. In some cases, there is more that needs to be done but I am still fumbling through those situations and have nothing positive to report yet.

  4. Sep 07, 2010

    Mital Vora says:

    Can I create slaves of different OSes. like I am working on a project which is p...

    Can I create slaves of different OSes. like I am working on a project which is ported to windows/linux/mac. I have setup separate Hudson CIs for the same. I was thinking If I can merge them into a single hudson.

    jobs particular to any OS should be given to that os's slave.

    I have found no documentation which can explain me Master/Slave Hudson properly.

    If this is not available / implemented currently with hudson.. this is one of the cool thing which would help lot of people who are developing cross-platform apps.

    Thanks :)

    1. Sep 14, 2010

      David Aldrich says:

      You can certainly create slaves on different o/s's. We have our Hudson master on...

      You can certainly create slaves on different o/s's. We have our Hudson master on Windows and we have Hudson slaves on Windows and Linux. Having set-up the slaves, you can assign them to a job by specifying their label in the 'Restrict where this project can be run' field of the project. So what you want is already possible.

      I would suggest you post your questions to Hudson user's mail list.

      David

  5. May 13, 2011

    Yang Chen says:

    I setup one Windows slave for one Windows master, they are two physical machines...

    I setup one Windows slave for one Windows master, they are two physical machines. The "Remote FS root" is set to "E:\hudson".  I want to create one job named TEST to run a bat script aaa.bat on the slave. The content of aaa.bat is:

    cd F:\project

    call bbb.bat

    The bbb.bat is in F:\project. But when I run the job, hudson try to find and run the bbb.bat in E:\hudson\TEST. The "cd F:\project" is not used. If I added "echo %cd%" after "cd F:\project" to print the current directory, it prints something like "E:\hudson\TEST". Can anybody tell me how to resolve this? I want the "cd" command takes effect. Thanks.