在使用Jenkins的一些问题的整理
Q1. 关于添加node连接Slave时连接不上的原因
已经在Slave 上已经添加了authorized_keys文件,开始在连接时还是报错
[05/15/14 09:37:32] [SSH] Opening SSH connection to 172.16.147.6:22. ERROR: Server rejected the 1 private key(s) for jenkins (credentialId:7265ff8a-1515-4745-a174-e6f550630818/method:publickey) [05/15/14 09:37:32] [SSH] Authentication failed. hudson.AbortException: Authentication failed. at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:1143) at hudson.plugins.sshslaves.SSHLauncher$2.call(SSHLauncher.java:648) 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:1146) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:701) [05/15/14 09:37:32] [SSH] Connection closed. [05/15/14 09:37:32] Launch failed - cleaning up connection
A1. 修改authorized_keys权限
chmod 755 authorized_keys
Q2. 关于首次构建"ERROR: Timeout after 10 minutes"
ERROR: Timeout after 10 minutes ERROR: Error cloning remote repo 'origin'
分析:
vim /etc/default/jenkins JAVA_ARGS="-Djava.awt.headless=true -Dorg.jenkinsci.plugins.gitclient.Git.timeOut=60"
还是行不通。其实这个与git clone下载没有多大关系,而是SSH 连接限制时间造成,由于一般的项目代码Code 都比较大,出错的项目code包含.git目录有20G。
A2:
在项目配置下 Additional Behaviours-->Add 添加-->Advanced clone Behaviours-->Timeout (in minutes) for clone and fetch operation修改时间