今天公司把以前的项目全部换成用jenkins发布,服务器这边搭建起来还是比较容易的。但是slaves这边还是比较麻烦,遇到一堆问题:
问题一:
我用的是ssh去链接slaves的,让公司的运维在slaves加入了公钥,安装了jdk后发现服务器和客户端通讯一直报错,开始以为是jdk的版本,位数安装出问题。最后查看了日志:
[07/03/14 14:23:16] [SSH] Opening SSH connection to xx.xx.xx.xx:22. [07/03/14 14:23:17] [SSH] Authentication successful. SSH connection reports a garbage before a command execution. Check your .bashrc, .profile, and so on to make sure it is quiet. The received junk text is as follows: hudson.AbortException at hudson.plugins.sshslaves.SSHLauncher.verifyNoHeaderJunk(SSHLauncher.java:802) at hudson.plugins.sshslaves.SSHLauncher.access$100(SSHLauncher.java:126) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:650) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:642) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) at java.util.concurrent.FutureTask.run(FutureTask.java:166) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) at java.lang.Thread.run(Thread.java:722) [07/03/14 14:23:17] [SSH] Connection closed.
原来问题出在我在Slave Node节点的.bashrc中增加的那段个性化签名。Jenkins无法识别这段签名,从而抛出异常,导致Connect失败。注释掉这段签名后就可以看到Slave Node的状态为Online了。
原文地址:http://www.cnblogs.com/dev-i7e/p/3822336.html