I'm using Jenkins (1.573) and Swarm plugin (2.0): https://wiki.jenkins-ci.org/display/JENKINS/Swarm+Plugin.
Downloaded the jar from http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/swarm-client/2.0/
I have already installed the Plugin in Jenkins (master) and from one of the Linux machine (which I would like to use as a Slave) I downloaded the swarm client jar with dependencies 2.0 and ran the following command:
Note:
$p variable has the password stored in it.
One can use mode as normal (instead of exclusive).
$ java -jar swarm-client-2.0-jar-with-dependencies.jar -name "`hostname -a`_01" -fsroot "`pwd`/`hostname -a`_01" -master http://jenkins_server.yo.company.com:8081 -disableSslVerification -username c123456 -password $p -description "`hostname -a` " -executors 5 -labels "ANSIBLE_CENTOS CENTOS" -mode 'exclusive' -retry 3
Discovering Jenkins master
Dec 03, 2015 3:52:58 PM org.apache.commons.httpclient.HttpMethodBase getResponseBody
WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
Attempting to connect to http://jenkins_server.yo.company.com:8081/ 1229493c-3bd5-4cf4-9210-3392089f2ee2 with ID 1893f0ea
Could not obtain CSRF crumb. Response code: 404
Dec 03, 2015 3:53:01 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up slave: jmeter01_01-1893f0ea
Dec 03, 2015 3:53:01 PM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Dec 03, 2015 3:53:01 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [http://jenkins_server.tsh.thomson.com:8081/]
Dec 03, 2015 3:53:02 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to jenkins_server.tsh.thomson.com:53605
Dec 03, 2015 3:53:02 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Dec 03, 2015 3:53:02 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
In Jenkins master, I'm seeing the slave is successfully created (using JLNP auth) but slave's name is little weird.
Instead of creating the slave name as the hostname (i.e. jmeter01 in my case or jmeter01.yo.company.com), it's suffixing the slave name with a RANDOM alphanumeric value. Sometimes as jmeter01_01-ee12355ec and sometimes, jmeter01_01-1893f0ea.
I would like the slave name to be just: jmeter01_01 or someserver_01 or someserver.fq.dn_01
What I may be giving wrong?