Jenkins ssh slave disconnect to make the task continue perform

非 Y 不嫁゛ 提交于 2019-12-08 05:57:53

问题


I have a iOS archive job on a mac slave which will take a long time sometimes 30min The question is the ssh long connection often disconnect and caused the task fail.

Now I want to ask how can I do to avoid this question? What I'm looking for is when the long connection disconnect but the task continue to perform. How can I do?


回答1:


Adding a keepAlive option is a feature request since 2014

As proposed workarounds, this ticket includes:

  1. Change the /etc/ssh/ssh_config by appending the following line to the end of this file. This tells the ssh client to send nop command periodically to avoid the ssh connection being disconnected.
    The unit of 80 is seconds. You may tune this parameter based on your network condition.
ServerAliveInterval 80
  1. In the Jenkins slave configuration page, change the Launch method to "Launch slave via execution of command on the Master". See the Jenkins built-in help for more details.

So far, I haven't see any issues in this configuration. Hope this helps.

See also "Remoting issues / SSH slaves".



来源:https://stackoverflow.com/questions/49441671/jenkins-ssh-slave-disconnect-to-make-the-task-continue-perform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!