egi*_*gib 1 ssh amazon-ec2 amazon-web-services jenkins jenkins-plugins
我一直在运行一个单独的 Agent Master EC2 实例,我们在其中运行所有作业。我正在考虑升级我们的解决方案并根据负载添加一些 Jenkins 代理。为此,我尝试使用 Jenkins 中提供的 EC2 插件。配置进展顺利,为了测试这一点,我将最小实例数设置为“1”。一旦代理初始化,Jenkins Master 就可以通过 SSH 连接到代理,但是一旦通过 SSH,它就会返回 404 错误并且实例被终止,我不知道为什么会发生这种情况。这是错误:
Nov 09, 2020 12:15:58 PM hudson.plugins.ec2.EC2Cloud
INFO: The SSH key **** has been successfully checked against the instance console for connections to EC2 (Jenkins Agent 1) - Jenkins Agent (****)
Nov 09, 2020 12:15:58 PM hudson.plugins.ec2.EC2Cloud
INFO: Connected via SSH.
Nov 09, 2020 12:15:58 PM hudson.plugins.ec2.EC2Cloud
INFO: connect fresh as root
Nov 09, 2020 12:15:58 PM hudson.plugins.ec2.EC2Cloud
INFO: Connecting to **** on port ****, with timeout 10000.
Nov 09, 2020 12:15:58 PM hudson.plugins.ec2.EC2Cloud
INFO: Connection allowed after the host key has been verified
Nov 09, 2020 12:15:58 PM hudson.plugins.ec2.EC2Cloud
INFO: Connected via SSH.
Nov 09, 2020 12:15:58 PM hudson.plugins.ec2.EC2Cloud
INFO: Creating tmp directory (/tmp) if it does not exist
Nov 09, 2020 12:16:03 PM hudson.plugins.ec2.EC2Cloud
INFO: Verifying: java -fullversion
openjdk full version "1.8.0_265-8u265-b01-0ubuntu2~20.04-b01"
Nov 09, 2020 12:16:03 PM hudson.plugins.ec2.EC2Cloud
INFO: Verifying: which scp
/usr/bin/scp
Nov 09, 2020 12:16:03 PM hudson.plugins.ec2.EC2Cloud
INFO: Copying remoting.jar to: /tmp
Nov 09, 2020 12:16:03 PM hudson.plugins.ec2.EC2Cloud
INFO: Launching remoting agent (via Trilead SSH2 Connection): java -jar /tmp/remoting.jar -workDir /var/lib/jenkins
HTTP ERROR 404 Not Found
URI: /computer/EC2%20(Jenkins%20Agent%201)%20-%20Jenkins%20Agent%20(i-01c45e1be3ca4ab2f)/logText/progressiveHtml
STATUS: 404
MESSAGE: Not Found
SERVLET: Stapler
Powered by Jetty:// 9.4.30.v20200611
Run Code Online (Sandbox Code Playgroud)
任何人都知道这是从哪里来的,或者之前使用 Jenkins 上的 EC2 插件有过这样的情况吗?
小智 5
INFO: Verifying: which scp
/usr/bin/scp
Nov 09, 2020 12:16:03 PM hudson.plugins.ec2.EC2Cloud
INFO: Copying remoting.jar to: /tmp
Nov 09, 2020 12:16:03 PM hudson.plugins.ec2.EC2Cloud
INFO: Launching remoting agent (via Trilead SSH2 Connection): java -jar
/tmp/remoting.jar -workDir /var/lib/jenkins
Run Code Online (Sandbox Code Playgroud)
似乎 scp lib/package 已经安装/可用,但您使用的远程用户没有工作目录的权限,/var/lib/jenkins这就是它失败并且实例被终止的原因。如果您使用的是Amazon Linux 2 AMI,您可以选择用作/home/ec2-user 远程 FS 根(请参阅图像参考),或者/home/ubuntu如果您使用的是Ubuntu AMI
| 归档时间: |
|
| 查看次数: |
2203 次 |
| 最近记录: |