I recently inherited a Jenkins-driven Java project where the primary developer just upped and quit. He had deployed the Jenkins WAR to a Tomcat instance on a virtual server, and that is what was considered to be the "build server".
This build server had a slave configured for building and deploying to myserver.example.com
, another virtual server. Over the weekend, the systems staff retired the physical server that the myserver.example.com
virtual lived on, producing the following exception for any Jenkins job configured to deploy to that slave:
When I click on the "See log for more details" link I see the following console output:
[03/18/13 08:13:31] [SSH] Opening SSH connection to myserver.example.com:22.
java.io.IOException: There was a problem while connecting to myserver.example.com:22
at com.trilead.ssh2.Connection.connect(Connection.java:755)
at com.trilead.ssh2.Connection.connect(Connection.java:546)
at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:650)
at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:283)
at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:200)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.net.NoRouteToHostException: No route to host
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.trilead.ssh2.transport.TransportManager.establishConnection(TransportManager.java:342)
at com.trilead.ssh2.transport.TransportManager.initialize(TransportManager.java:450)
at com.trilead.ssh2.Connection.connect(Connection.java:699)
... 9 more
[03/18/13 08:13:34] [SSH] Connection closed.
This makes sense, since the slave (the myserver.example.com
virtual) is offline. However, having no real previous experience with Jenkins, I'm not sure of what the proper steps are for configuring the Jenkins master to build/deploy these jobs to a new slave, and how to set up the new slave. For instance, do I need to install anything on the new slave, or do any kind of setup/config? Thanks in advance!
Adding a slave in Jenkins is pretty simple. Basically, if you are using a unix slave, you need SSH access to the machine. You also need to have the Jenkins SSH Slaves plugin installed. Once you have that, go to the Manage Jenkins option on your Master and choose Manage Nodes.
The steps are then:
There are some assumptions about the tools that are installed on the slave. If you have specialized tools, you may need to install them separately (or look at plugins that handle moving tools over immediately prior to execution). However, if your nodes are built off of a template which has all of your build tools on them (java, ant, etc in your case probably), then this will be all you need to do to get things going.
I encountered the very same problem you did, in my case this was because I had not installed an ssh server on Ubuntu.