【发布时间】:2020-02-13 10:48:05
【问题描述】:
我正在尝试设置 Jenkins 以进行生产部署。目的是让 Jenkins 在生产服务器上执行 git clone、构建和部署等。
Jenkins 在配置管理服务器 (CentOs 7) 上运行,生产服务器是另一台服务器 (Centos 7)。
我首先在 Jenkins 中创建一个新节点,配置如下:
然后我将生产服务器 IP 地址添加到 Jenkins 已知主机,如下所示
-bash-4.2$ cat /var/lib/jenkins/.ssh/known_hosts
192.168.1.xx ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYblabla=
我确认在 Jenkins 帐户下的配置管理服务器上,我可以通过 ssh 连接到生产服务器。
但在 Jenkins 上,节点状态总是这样:
This agent is offline because Jenkins failed to launch the agent process on it.
节点日志是这样的:
SSHLauncher{host='192.168.1.xx', port=22, credentialsId='service account at w', jvmOptions='', javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15, sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy, tcpNoDelay=true, trackCredentials=true}
[02/12/20 20:57:51] [SSH] Opening SSH connection to 192.168.1.xx:22.
[02/12/20 20:57:51] [SSH] WARNING: SSH Host Keys are not being verified. Man-in-the-middle attacks may be possible against this connection.
ERROR: Server rejected the 1 private key(s) for service_account (credentialId:service_account at webi/method:publickey)
[02/12/20 20:57:51] [SSH] Authentication failed.
Authentication failed.
[02/12/20 20:57:51] Launch failed - cleaning up connection
[02/12/20 20:57:51] [SSH] Connection closed.
任何人都可以帮助解决以下问题:
- 我还需要在生产服务器上安装 Jenkins 吗?
- 如何配置 Jenkins 以在其上运行管道 新节点?
【问题讨论】: