jenkins 添加 nodes

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 20:35   1418   0

背景:使用 docker 搭了 jenkins 服务,需要添加 node 测试。jenkins docker 镜像 jenkins/jenkins:2.152

1 由于Jenkins是Java程序,添加的SLAVE客户端服务器必须安装Java JDK环境

2 jenkins 登陆后, manage jenkins --> manage nodes --> new node --> node name: name001(你需要添加的nodes名称,随意) , permanent agent: yes --> remote root diretory: /root , usage: use the node as much as possible, lauch method: launch agent agents via ssh, host: 192.168.1.3(你需要添加的nodes ip), credentials: add: jenkins:{ kind: username with password, username: root (你需要添加的nodes 的用户名), password: 321321(你需要添加的nodes 的密码)}, advanced --> javapath: /user/bin/java

问题: [SSH] WARNING: No entry currently exists in the Known Hosts file for this host

原因: jenkins 的 knowhosts 文件中没有 192.168.1.3(你需要添加的nodes ip)的信息,添加进去

解决方法:

进入容器,ssh 登陆 192.168.1.3,得到 known_hsots 信息

将 known_hosts 信息复制到 jenkins 容器的 /var/jenkins_home/.ssh/known_hosts 文件中

[root@myjenkins .ssh]# docker exec -it jenkins sh
#ssh 192.168.1.3
#cat /root/.ssh/known_hosts
#cat /root/.ssh/known_hosts >> /var/jenkins_home/.ssh/known_hosts

参考:

https://www.cnblogs.com/jsonhc/p/7372359.html

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP