Jenkins Slave Nodes – using the Swarm Plugin
link: http://www.donaldsimpson.co.uk/2013/03/18/jenkins-slave-nodes-using-the-swarm-plugin/
I’ve been trying out a new (to me at least) way to add a Jenkins Slave Node – using UDP auto discovery via the Jenkins Swarm Plugin
This is a very easy and nice way to do it, with minimal configuration/hassle required so you can quickly and easily add new Jenkins Slave Nodes to your Master Jenkins instance as and when they are required.
Here are my notes from setting this up – it’s pretty simple to do and worked well for me out of the box…
Set up a new instance of Jenkins:
- Make & cd to a working directory
mkdir jenkinsswarm; cd jenkinsswarm
- Fetch jenkins.war
curl -O http://mirrors.karan.org/jenkins/war/1.506/jenkins.war
- Start Jenkins
{/path/to/java/bin/}java -jar jenkins.war
After that, you should get console output along these lines…
Running from: /root/jenkinsswarm/jenkins.war
webroot: $user.home/.jenkins
18-Mar-2013 15:19:26 winstone.Logger logInternal
INFO: Beginning extraction from war file
Jenkins home directory: /root/.jenkins found at: $user.home/.jenkins
18-Mar-2013 15:19:33 winstone.Logger logInternal
INFO: HTTP Listener started: port=8080
18-Mar-2013 15:19:33 winstone.Logger logInternal
INFO: Winstone Servlet Engine v0.9.10 running: controlPort=disabled
18-Mar-2013 15:19:34 jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
18-Mar-2013 15:19:35 jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
18-Mar-2013 15:19:35 jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
18-Mar-2013 15:19:35 jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
18-Mar-2013 15:19:41 jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
18-Mar-2013 15:19:41 jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
18-Mar-2013 15:19:44 org.jenkinsci.main.modules.sshd.SSHD start
INFO: Started SSHD at port 25133
18-Mar-2013 15:19:44 jenkins.InitReactorRunner$1 onAttained
INFO: Completed initialization
18-Mar-2013 15:19:44 hudson.TcpSlaveAgentListener <init>
INFO: JNLP slave agent listener started on TCP port 41790
18-Mar-2013 15:19:44 hudson.WebAppMain$2 runINFO: Jenkins is fully up and running
– that looks happy enough, and as you can see from the line “HTTP Listener started: port=8080” it’s running on the default port, so connect to http://yourhost:8080 and you should see something like this…
the next step is to install the Swarm Plugin (https://wiki.jenkins-ci.org/display/JENKINS/Swarm+Plugin) on this Jenkins Master instance so that Swarm Clients can connect to it.
Do this by going to “Manage Jenkins > Manage Plugins > Available” then selecting to install the “Swarm Plugin“.
Once that’s done you should see that the plugin has been installed…

Now that your new Jenkins server is set up and ready, hop over to your other Jenkins Slave/Client host and do the following…
mkdir for the swarm client
mkdir swarmclient; cd swarmclient/
Get the Swarm Client jar file from the ‘net
curl -O http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/swarm-client/1.8/swarm-client-1.8-jar-with-dependencies.jar
Start up the Client
java -jar swarm-client-1.8-jar-with-dependencies.jar
Found 1 eligible Jenkins.
Connecting to http://mydomain.com:8080/
Attempting to connect to http://mydomain.com:8080/ a2721b16-04e4-0d962
18-Mar-2013 15:33:22 org.apache.commons.httpclient.HttpMethodDirector authenticateHost
WARNING: Required credentials not available for BASIC <any realm>@mydomain.com:8080
18-Mar-2013 15:33:22 org.apache.commons.httpclient.HttpMethodDirector authenticateHost
WARNING: Preemptive authentication requested but no default credentials available
18-Mar-2013 15:33:23 hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Hudson agent is running in headless mode.
18-Mar-2013 15:33:23 hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [http://mydomain.com:8080/]
18-Mar-2013 15:33:23 hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to myhost.mydomain.com:43932
18-Mar-2013 15:33:23 hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
18-Mar-2013 15:33:23 hudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
Now take a look at your browser and you should see a new Node automatically added to the Master Jenkins instance…
A very handy and flexible approach to adding/managing Nodes and workload – many thanks to the developers behind this!
Jenkins Slave Nodes – using the Swarm Plugin的更多相关文章
- Kubernetes之动态Jenkins slave
一.前提 本次实践前,需已完成以下过程: 1.搭建好一个Kubernetes集群(本实践为单节点集群),网上参考较多,不赘述. 2.选取kubernetes集群外的一台服务器安装 NFS服务端,并在集 ...
- Jenkins Slave 设置
Jenkins Slave node环境变量设置有很多trap,在最近的工作当中,我把slave部署在red hat linux 上,进行c++项目的编译部署和发布,但是在执行工程的时候,总会报出某些 ...
- jenkins slave 安装服务与卸载
查看windows 服务 cmd 运行下图用我已经安装的jnlp服务展示效果 : services.msc 关于这个服务名称怎么来的: 我的 工作台路径:如下: 进入jenkins slave 下载j ...
- jenkins slave上执行脚本报错
jenkins slave上执行脚本报错 解决方法:在系统配置中设置shell execuate C:\Windows\system32\cmd.exe 保存即可
- jenkins:应用篇(Gatling plugin的使用)
Jenkins的功能强大,在于它的插件式框架,能扩展功能,自动化当中,很容易想到的是对提交的新代码做测试,这里gatling主要是负责压力测试,也就是所谓的性能.关于gatling,可以参考我前面的博 ...
- 解决jenkins slave 中文乱码 encoding=ANSI_X3.4-1968
jenkins配置slave进行构建时,发现slave构建的控制台输入中文乱码,查看master,slave的jenkins系统信息 file.encoding和sun.jnu.encoding都没有 ...
- jenkins slave启动报错:hudson.util.IOException2: Slave JVM has terminated. Exit code=126
添加mac slave节点报错如下:Expanded the channel window size to 4MB [11/07/14 19:11:54] [SSH] Starting slave p ...
- Jenkins邮件扩展插件Email Extension Plugin配置使用
1.在管理插件中搜索并安装邮件扩展插件Email Extension Plugin: 2.在任务中增加构建后操作步骤,选择Editable Email Notification; 3.在高级中Add ...
- mvn: command not found in Jenkins slave
在Jenkins上添加了一个slave node, 并绑定了一个团队项目,通过shell来执行后续操作,结果卡在了 mvn: command not found 其实这个node上是配置了maven的 ...
随机推荐
- transform详解
1.简介 该算法用于实行容器元素的变换操作.有如下两个使用原型,一个将迭代器区间[first,last)中元素,执行一元函数对象op操作,交换后的结果放在[result,result+(last-fi ...
- 做个简单的Redis监控(源码分享)[转载]
Redis监控 Redis 是目前应用广泛的NoSQL,我做的项目中大部分都是与Redis打交道,发现身边的朋友也更多人在用,相对于memcached 来说,它的优势也确实是可圈可点.在随着业务,数据 ...
- Spring框架总结(十)
XML方式实现AOP编程 Xml实现aop编程: 1) 引入jar文件 [aop 相关jar, 4个] 2) 引入aop名称空间 3)aop 配置 * 配置切面类 (重复执行代码形成的类) * aop ...
- 【小梅哥SOPC学习笔记】SOPC开发常见问题及解决办法集锦
SOPC开发常见问题及解决办法集锦 一.Symbol 'NULL' could not be resolved 近期在评估使用NIOS II处理器进行项目的开发,我使用的软件是Quartus II 1 ...
- Java实现四则运算---任路乾,乐滔
1.GitHub地址:https://github.com/3116004700/ruanjiangongcheng 2.项目需求: 生成的题目中计算过程不能产生负数(完成) 生成的题目中如果存在形如 ...
- [教学] Log.d 日志调试查看(所有平台)
Firemonkey 提供了一个跨平台的日志显示函数 Log.d,当 App 越来越大 Debug 编译越来越慢时,可以利用它在 Release 模式来除错,下列说明如何在各平台查看. 小技巧:可以在 ...
- log4net 入门使用
log4net 是dotnet平台下的一个日记记录组件. 一 NuGet中安装log4net包: 二 配置log4net.config文件 配置文件内容: <?xml version=&quo ...
- 20145218张晓涵 web安全基础实践
20145218张晓涵 web安全基础实践 1.实验后回答问题 SQL注入攻击原理,如何防御 SQL注入漏洞是指在Web应用对后台数据库查询语句处理存在的安全漏洞.也就是,在输入字符串中嵌入SQL指令 ...
- 通用性站点管理后台(Bee OPOA Platform) (5)- 【扩展】基于WebSocket的监视Sql执行功能
开始 底层的东西总是很类似, 看了园里的Fish-Li的一系列文章, 写得真好, 无论是风格还是内容. 本来也想想方便点就用remoting实现监视功能算了, 但这样就需要一个Winform的项目了. ...
- .net core i上 K8S(五).netcore程序的hostip模式
上一章讲了pod的管理,今天再分享一个pod的访问方式 1.Pod的HostIP模式 Pod的HostIP模式,可以通过宿主机访问pod内的服务,创建yaml文件如下 apiVersion: v1 k ...
