Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/jenkins/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法通过jenkins连接到AWS从属服务器_Jenkins_Ssh_Amazon Ec2_Continuous Integration_Jenkins Plugins - Fatal编程技术网

无法通过jenkins连接到AWS从属服务器

无法通过jenkins连接到AWS从属服务器,jenkins,ssh,amazon-ec2,continuous-integration,jenkins-plugins,Jenkins,Ssh,Amazon Ec2,Continuous Integration,Jenkins Plugins,我正在尝试使用jenkins中的EC2插件配置主从配置。配置了EC2插件后,jenkins成功地启动了从机,我甚至可以用ssh连接到该从机。但当我查看jenkins中的节点日志时,我发现jenkins无法连接到slave。以下是我看到的: This node is offline because Jenkins failed to launch the slave agent on it. See log for more details INFO: Authenticating as ub

我正在尝试使用jenkins中的EC2插件配置主从配置。配置了EC2插件后,jenkins成功地启动了从机,我甚至可以用ssh连接到该从机。但当我查看jenkins中的节点日志时,我发现jenkins无法连接到slave。以下是我看到的:

This node is offline because Jenkins failed to launch the slave agent   on it. See log for more details
INFO: Authenticating as ubuntu
Jan 31, 2017 6:29:00 PM null
INFO: Connecting to ip-10-226-254-52.ec2.internal on port 22, with timeout 10000.
Jan 31, 2017 6:29:10 PM null
INFO: Failed to connect via ssh: The kexTimeout (10000 ms) expired.
Jan 31, 2017 6:29:10 PM null
INFO: Waiting for SSH to come up. Sleeping 5.
Jan 31, 2017 6:29:15 PM null
INFO: Connecting to ip-10-226-254-52.ec2.internal on port 22, with timeout 10000.
Jan 31, 2017 6:29:25 PM null
INFO: Failed to connect via ssh: The kexTimeout (10000 ms) expired.
Jan 31, 2017 6:29:25 PM null
INFO: Waiting for SSH to come up. Sleeping 5.
ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins
java.lang.NullPointerException
at hudson.plugins.ec2.ssh.EC2UnixLauncher.bootstrap(EC2UnixLauncher.java:309)
at hudson.plugins.ec2.ssh.EC2UnixLauncher.launch(EC2UnixLauncher.java:131)
at hudson.plugins.ec2.EC2ComputerLauncher.launch(EC2ComputerLauncher.java:122)
at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:253)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

我在网上查过了,但帮不了什么忙。如果你们中有人熟悉这种错误,请帮助我。提前谢谢。

我想我自己也明白了。我为从属设备指定的安全组没有SSH端口(22),因此未在主设备的安全组上打开。打开SSH端口后,我可以连接到从属节点 注意:我对主服务器和从服务器使用相同的安全组

INFO: Connected via SSH.
Feb 02, 2017 4:29:59 PM null
INFO: connect fresh as root

您是否指定了jenkins用户/进程用于连接的SSH密钥?@MichaelJ-是的,我指定了用于从命令行进行SSH的密钥。以下是示例控制台jenkins output
INFO:Launching实例:i-04f2269ce08edf96d 2017年2月1日3:13:41 AM null信息:引导()2017年2月1日3:13:41 AM null信息:获取密钥对。。。2017年2月1日凌晨3:13:41空信息:使用密钥:fst load demo
我还看到jenkins正在尝试连接到从属实例,持续
信息:等待SSH出现。睡觉5。2017年2月1日上午4:59:58空信息:连接到端口22上的10.226.254.15,超时10000。2017年2月1日上午5:00:08空信息:无法通过ssh连接:kexTimeout(10000毫秒)已过期。2017年2月1日上午5:00:08空信息:等待SSH出现。睡觉5。2017年2月1日上午5:00:13空信息:连接到端口22上的10.226.254.15,超时10000