美文网首页
Jenkins Slave 节点配置和使用

Jenkins Slave 节点配置和使用

作者: awker | 来源:发表于2019-03-12 19:41 被阅读0次

1、jenkins 信息
jenkins master:10.3.200.91
jenkins slave:10.3.200.101

2、jenkins master 配置认证,以便连接到 jenkins salve 执行任务
2.1 jenkins slave 上添加用户 jenkins 和 目录 /data/jenkins

# useradd jenkins
# echo "123456" | passwd --stdin jenkins
# mkdir /data/jenkins
# chown -R jenkins:jenkins /data/jenkins

2.2 jenkins master 上添加凭据

# useradd jenkins
# su - jenkins
$ ssh-keygen
$ ssh-copy-id jenkins@10.3.200.101

$ cat .ssh/id_rsa
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAr6YC4H5RQl70Nk3ABTeTNLRWKJyWHPdi/eEK8BqlQ2dVWGl7
3drk/F5sa+u38Gq9bVCeXYoHFQvkGzrB7ro0oL2kPLvLuMn1K+RjMO3286MVnWXC
uiekAUyB6KfAcvADLozr8t0RKLyeq0PVJNQiezuG9TI8HdFkaCHuCsMADjdtt/7/
B3Mu1qbi4wzyP9c5wllz+3XthiR8HaKOFGKzLR1rnGogtEhAYRvUlwCCUgjwekCh
btwQOgUur0eS+OUsMyBfD+TApZ8QMn2uRHxL/AbagQGU+HYAVoFN6tcIKZnUOoAV
83uv8OoTMNHVbVmPUEm0+AcLGbXyelchxgbyLQIDAQABAoIBAFWMJlSOUSdhNdII
9h/UXHbL6janZRlAh88cvwYIBDua5V9FKNX52ZLsriO1z4Vhh1bpb+gg5KgkfXmh
mXia6izrkEUgNe2PN0CkYIchLyikYk+hk0C1M9SKHa9hnIKeUP5oFjbX4paTnzfM
ts/UHeMlL+rWB5+CL0PkWpqVNL63A8LAzkdBIzQ6QlLhOM/T8Jp+QPU278PewCkW
XWgXCAyBHNuptTEKar+evd/bgFpSXG3/2OyAleKCvln/qvgrC2iq73h02fl8g/5P
QnXtPsrk+OKrzXthkKppsABgP5ryI+gU9peL/qnDBjAvScHztWw2ucla5FBd9hb4
ATgh+UUCgYEA1QoTc+8E7Yebjs2JJ9DWTvx0jyc0/vKLeQB+Lt6LGAkpjmeay6NX
LHSTJdA065BcgumIVuAW6stJSwJdmP4bnLz71wDlLMKcZBUb9LlZFyu9VXyRdOoU
qicrurXzYcYziu6qO5w5IYIDwfMPOCfF1tl+mvzXYpT0kBlVlYz84GsCgYEA0xGs
C95wyS2B9dgpw+3CJ56coJi+bP589wVA30JBDkqoQwabwUEI2gh7EXxQ1BbV3ORo
1bDqnSzFGxTt2b1FgnBXXPA0sVOagDR8d1/g3VfVCNV3MJvNQ/aEAFBz+bWqc7jK
zbRtV88S2LHHL7ZpMaS1WbW5k/n8ZutCXcaxPccCgYAvdOImdj0ryISPiBuggfXr
fHNenEZC8La/CqwRNsPXY9sc/NlPuaAmqAVLbBkNzIe/JdSYPaz9OrGmAu3ksd5m
yPZ0y59BnEyIQueKWWuOLNEtZOVmHOrjiHxGSFfiFOvQbCABzWgwnazGnKVsRffd
R2/biK1WKYZdPzeAa/q85wKBgExQx3RDKWSUH7lUP0WoYdsRbnBiyfd+zJBERgBz
ZDJWrCAP86EccqbjChx4ZoFJAGqt63nYTfwmg94W4yknVkqjc/MWpva209YnJBnF
gPiHGW/oPwBEVSONroyuikBvfwH4ftuBsUdeh+Hx5aNKwR5B/5BANKlcafaMeaKO
hOdhAoGAZfksvOrguNi+fzFjTkpg0rLKHyRYaPtBJoF84xL9NPQIKBD+kCMRpMu+
PHSjFPNYQmJmvPJ3wTwpkG3nDYCPjG4AaT0dpXLXOIIQOILgI9TgQVOEOWe9E93g
bmCv18VXKzKdrDwjDLRP0yug7kr5D9ihI2ur0pQljcpJIP2+cQE=
-----END RSA PRIVATE KEY-----


3、Jenkins --> 系统管理 --> 节点管理 打开节点列表


4、新建节点


5、项目关联
5.1 Pipeline 流水线项目:

pipeline {
    agent { label '101-slave' }
    省略其他内容……
}

5.2 自由风格的软件项目


相关文章

网友评论

      本文标题:Jenkins Slave 节点配置和使用

      本文链接:https://www.haomeiwen.com/subject/dkanpqtx.html