root@jenkins:~# netstat -antp|grep 50000
tcp6 0 0 :::50000 :: LISTEN 5139/java
1.52 安装Jenkins
root@ubuntu20:~# dpkg -i jenkins_2.414.3_all.deb
配置各种类型的Agent的关键之处在于启动Agent的方式
◼ JNLP Agent对应着“通过Java Web启动代理”这种方式
◼ Master与Slave之间建立一个基于HTTPS协力的Web连接
◼ Slave首次接入Master时,需要提供用于认证的Secret以完成
Bootstrap
配置JNLP Agent创建分布式构建环境的简要步骤
◼ 准备Agent节点,部署好Jenkins
◼ 在Master节点上,添加Agent节点的定义
◼ 在Master节点上,获取将Agent节点连接至Master时需要执行的
命令
◼ 在Agent节点上,打开命令终端,运行Master提示的命令
◼ 在Master节点上验证添加的结果
root@ubuntu20:~# mkdir /home/jenkins/agent -pv
root@ubuntu20:~# chown -R jenkins.jenkins /home/jenkins/agent/
curl -sO http://192.168.1.51:8080/jnlpJars/agent.jar
java -jar agent.jar -jnlpUrl http://192.168.1.51:8080/computer/jenkins01%2D192%2E168%2E1%2E52/jenkins-agent.jnlp -secret db32e82e85dddf69f96f0f50bd13b5380f5f6de1789f0535c01bb650843c844a -workDir “/home/jenkins/agent”
root@ubuntu20:/var/lib/jenkins/plugins# passwd jenkins
New password: 123456
Retype new password:
passwd: password updated successfully
报错,授权即可
Building remotely on jenkins01-1.52 (linux-agent) in workspace /home/jenkins/agent/workspace/spring-boot-helloword2
The recommended git tool is: NONE
java.lang.ClassNotFoundException: org.jenkinsci.plugins.gitclient.Git$GitAPIMasterToSlaveFileCallable
chown -R jenkins:jenkins /var/lib/jenkins/workspace/