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) a-to add a Jenkins Slave node–using UDP Auto Discovery via the Jenkins Swarm Plugin
This was a very easy and nice-to-do it, with minimal configuration/hassle required so can quickly and easily add NE W Jenkins Slave Nodes to your Master Jenkins instance as and when they is required.
Here is 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 & CDs to a working directory
mkdir Jenkinsswarm; CD Jenkinsswarm
Curl-o Http://mirrors.karan.org/jenkins/war/1.506/jenkins.war
{/path/to/java/bin/}java-jar Jenkins.war
After this, 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 Run
Info:jenkins is fully up and running
–that looks happy enough, and as can see from the line "HTTP Listener started:port=8080" It's running on th e 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 Ma Ster instance So, Swarm clients can connect to it.
Do the ' going to 'Manage Jenkins > Manage Plugins > Available"then selecting to install the"Swarm Plugin".
Once that's done you should see that the plugin have been installed ...
Now this your new Jenkins server is set up and ready, hop-to-your other Jenkins Slave/client host and do the Followin G...
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 your 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