Hudson — Step by step guide to set up master and slave machines

♀尐吖头ヾ 提交于 2019-12-18 15:44:06

问题


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.


回答1:


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.




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/3294386/hudson-step-by-step-guide-to-set-up-master-and-slave-machines

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!