Hudson -- Step by step guide to set up master and slave machines
Asked Answered
V

3

9

As you can see, the link to that on the hudson website is dead.

So, I was hoping for a little step by step for setting up a windows slave with a linux master.

I managed to setup hudson on the windows machine, but how do i link the slave to report back to the master and initiate build from the master to run on the windows slave.

Basically how is the flow of data between the master/slave achieved, I know this can be done but there is no documentation online that explicitly says do this.

I would appreciate as detailed as an answer you could give.

Please, and thank you.

Vitascope answered 20/7, 2010 at 21:10 Comment(4)
Here's a blog post I wrote after finding that dead link - hopefully it will get you started.Zigrang
nice blog post, any idea how to setup a windows slave w/ linux master, and manage the "/" vs. "\" I would really appreciate any help you could provide, I am in the same position you were in the blog post. :)Vitascope
Hmm, my post is a bit Linux specific as it relies on SSH, which you don't get by default on Windows. I'll try to play around with this a bit later, but I'm afraid I haven't tried setting up a slave on Windows yet.Zigrang
thanks anyways. i will report back if i find anything new. Please do the same.Vitascope
S
6

I actually archived the JNLP section of the http://wiki.hudson-ci.org/display/HUDSON/Step+by+step+guide+to+set+up+master+and+slave+machines site. Here it is for your reference:

JNLP
The guide will start the slaves through JNLP manually. In a real production environment it is suggested that the slaves are started automatically. The guide assumes that the master is a linux machine and the slave is a Windows machine.

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.

Swamy answered 21/7, 2010 at 18:25 Comment(2)
exactly how to do it. i figured it out just before i read you post. what does the dir in batch command do? how can I run shell scripts in a windows build.Vitascope
I think the point of the "dir" is just to demonstrate that the build is working. For Windows, add 1 or more "Execute Windows batch command" sections. Use them just like you were running a batch file in CMD.EXE.Swamy
L
1

when creating node select [leave this node for selected jobs only] under usage section and give some label name. And when creating job check restrict where this project can run check box then give label name in textbox displayed

Loveliesbleeding answered 30/5, 2011 at 10:16 Comment(0)
C
0

First you need to create a new node. You can do this from http://hudson:8080/computer/, click "New Node" on the left.

The easiest way to start a node is to, from the slave, click on the newly created node on that page and launch the Java client from there.

Cramer answered 20/7, 2010 at 21:14 Comment(5)
Where did I crest that new node on the slave or the master?Vitascope
@garbagecollector: You do this using the web interface on the master.Cramer
then where is the connection between slave and master?Vitascope
@garbagecollector: From the slave, using a browser, you go to the newly created node's page on the master's web interface, and click onto the launch icon. This will start a slave which will connect to the master automatically. Why don't you simply try the steps I lined out?Cramer
No, I have no idea. You might find better help in the hudson mailing list.Cramer

© 2022 - 2024 — McMap. All rights reserved.