Hudson——设置主机和从机的分步指南 [英] Hudson -- Step by step guide to set up master and slave machines

查看:32
本文介绍了Hudson——设置主机和从机的分步指南的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如您所见,hudson 网站上的链接是 死了.

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

所以,我希望一步一步地设置一个带有 linux master 的 windows slave.

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

我设法在 windows 机器上设置了 hudson,但是我如何链接从机以向主机报告并从主机启动构建以在 windows 从机上运行.

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.

基本上master/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.

请,谢谢.

推荐答案

我其实存档了http://wiki.hudson-ci.org/display/HUDSON/Step+by+step+guide+to+设置+设置+主+和+从+机器站点.供大家参考:

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
该指南将通过 JNLP 手动启动 slave.在实际生产环境中,建议自动启动从站.本指南假设 master 是一台 linux 机器,slave 是一台 Windows 机器.

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.

主机
1. 点击左侧边栏的Build Executor Status"链接(在早期版本中转到Manage Hudson"->Configure Executors")
2.对于每个slave,做如下配置
3. 点击左侧边栏上的新节点"链接(在早期版本中,点击从属"部分下的添加"按钮)
4.名称" - 输入从站的名称,例如slave1"
5.# of executors"——输入slave的执行者数量,即slave上允许的并发构建数.一个好的值是处理器的数量.
6.remote FS root"——输入这个工作目录在slave上的绝对路径,比如'/export/home/hudson'.该目录将在从属服务器上创建,并且构建所需的所有数据都将存储在那里.例如c: emphudson_tst"
7. usage" - 设置为Utilize this slave as much as possible"
8. labels" - 输入任意数量的slave标签,例如windows"、linux"、jdk"
9. 按保存"保存所有从站配置
10. 进入主页面
11.新建一个free style项目,配置为:
12.选中将此项目绑定到节点"复选框
13. 在将此项目绑定到节点"部分的组合框中选择一个从站
14.勾选执行Windows批处理命令"
15. 在执行 Windows 批处理命令"部分的文本区域中输入dir"
16.按保存"保存配置

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: emphudson_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"

从机
1. 启动网络浏览器并转到 Hudson 主页(位于主机上)
2.在Build executor列表中点击slave的名字,会出现一个描述slave的页面
3. 单击启动从代理"链接启动从代理
4. 等到 web start 应用程序启动并显示一个窗口,说明从属服务器已连接到主服务器(已连接")
5. 转到主服务器上的 Hudson 主页
6.验证slave不再被标记为离线
7. 启动绑定到从属设备的构建(即上面的第 5 步).这将在从站上开始构建,您可以通过转到为从站指定的远程 FS 根"来验证它是否在从站上执行.它现在应该包含一个名为工作区"的文件夹.
8. 转到构建历史并验证它是否在从属服务器上执行.

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.

这篇关于Hudson——设置主机和从机的分步指南的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆