Jenkins SSH从属断开连接以使任务继续执行 [英] Jenkins ssh slave disconnect to make the task continue perform

查看:688
本文介绍了Jenkins SSH从属断开连接以使任务继续执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Mac奴隶上的iOS存档作业,这将花费很长时间,有时需要30分钟 问题是ssh长连接经常断开并导致任务失败.

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?

推荐答案

添加keepAlive选项是

Adding a keepAlive option is a feature request since 2014

作为建议的解决方法,此故障单包括:

As proposed workarounds, this ticket includes:

  1. 通过将以下行添加到此文件的末尾来更改/etc/ssh/ssh_config.这告诉ssh客户端定期发送nop命令,以避免ssh连接断开.
    80的单位是秒.您可以根据网络状况调整此参数.
  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. 在Jenkins从属配置页面中,将Launch方法更改为"Launch slave via execution of command on the Master".有关更多详细信息,请参见Jenkins内置帮助.
  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.

另请参阅"远程处理问题/SSH从属"

这篇关于Jenkins SSH从属断开连接以使任务继续执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆