问题原文
原帖链接 · tworec · CC BY-SA 3.0
I have two jenkins instances. I want job at 1st instance to invoke job at 2nd instance, wait until it ends and perform some actions (using artifacts produced by job @ 2nd)
I've come up with this solution - using Jenkins CLI commands via SSH
ssh -p 2222 second-jenkins build second-job -s -v <further options>
But this session disconnects after 10minutes with message:
Received disconnect from 192.168.147.102: 2: User idle has timed out after 600000ms.
I found ssh client option named ServerAliveInterval
ssh -o ServerAliveInterval=30 -p 2222 second-jenkins build second-job -s -v <...>
Documentation for this option says
ServerAliveInterval
Sets a timeout interval in seconds after which if no data has been received from the server, ssh(1) will send a message through the encrypted channel to request a response from the server. The default is 0, indicating that these messages will not be sent to the server. This option applies to protocol version 2 only.
This works but only when server is quiet by at least 30 seconds within every 10 minutes. Of course I can use 1 second instead 30, but it wont work for jobs with continous console output (eg. maven builds).
Is there solution which keep connection alive even for hevy console output jobs?
已采纳解答
原帖链接 · Réda Housni Alaoui · CC BY-SA 4.0
Add this to Jenkins startup to disable the SSHD timeout:
-Dorg.jenkinsci.main.modules.sshd.SSHD.idle-timeout=0
See also https://blog.redaalaoui.me/blog/jenkins-cli-ssh-timeout/
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
