【发布时间】:2017-01-03 16:46:27
【问题描述】:
我的配置:
- 专用服务器 (Ubuntu 16.04 LTS) 仅用于 Jenkins (2.7.1),
- 超过 100 多个 Jenkins 作业,每个作业都向 AWS (Vagrantfile) 调用 vagrant 实例,
- 每个作业(配置脚本)可能需要 1-2 小时才能运行,
- 大部分服务器配置文件(如 SSH)都有默认系统配置。
当我同时运行多个 Jenkins 实例时,它们更有可能因以下错误而失败:
00:00:00.774 + vagrant up --no-provision --destroy-on-error --provider=aws
00:00:09.635 Bringing machine 'MT-aws' up with 'aws' provider...
...
00:01:16.498 MT-aws: Running: inline script
...
00:01:26.415 ==> MT-aws: + echo
00:01:26.415 ==> MT-aws: + sleep 20
00:01:26.427 The SSH connection was unexpectedly closed by the remote end. This
00:01:26.427 usually indicates that SSH within the guest machine was unable to
00:01:26.427 properly start up. Please boot the VM in GUI mode to check whether
00:01:26.427 it is booting properly.
00:01:26.625 Build step 'Execute shell' marked build as failure
事实:
- 配置脚本在随机位置失败(失败前没有特定代码),
- 服务器没有过载,并且有足够的空闲 RAM 和 Gbit 网络访问权限,
- 并行运行的作业越多,失败的可能性就越大,
- 单独重新运行同一个作业通常可以正常工作,
-
/etc/ssh/ssh_config中的默认设置,对于 Jenkins,没有~/.ssh/config。
如何解决上述 SSH 被意外关闭的问题?
我是否需要增加一些 SSH 超时设置或其他什么?
【问题讨论】:
标签: linux amazon-web-services jenkins ssh vagrant