简体   繁体   中英

cannot connect Jenkins slave with master

I have installed a Jenkins master on my Mac OS, version is 2.90.
I have installed a Jenkins slave on my ubuntu, and created a user called jenkins at /home/jenkins.
I have copied my pub key from master to slave and using

ssh jenkins@slave_ip

I can login from master to slave with no password.
However, I cannot create a new slave at Jenkins, it has the following issues:
1. Launch method does not have option "Launch slave agents via SSH",therefore I cannot set credentials.
2. since launch method only has "Launch agent via execution of command on the master" and another option for windows, I input Launch command as: ssh -v jenkins@slave_ip. but master cannot connect with slave.

To troubleshoot, I login slave manually, I see master does ssh to slave successfully. as it shows:

sudo tail -f /var/log/auth.log:
Nov 19 00:10:32 ip-172-31-18-180 sshd[8908]: Accepted publickey for     
jenkins from my_master_ip port 62411 ssh2: RSA     
80:23:0e:1b:34:c1:90:52:a6:df:d0:24:6f:10:80:73
Nov 19 00:10:32 ip-172-31-18-180 sshd[8908]: pam_unix(sshd:session):    
session opened for user jenkins by (uid=0)

so I doubt maybe Jenkins credential is not set because master does not send private key to slave. (I do not have this option in my Jenkins UI)

what should I do? how to make Launch method option "Launch slave agents via SSH" show, so that I can input credential of master?

you should use Launch slave agents via SSH to connect the ubuntu as slave.

you should install https://wiki.jenkins.io/display/JENKINS/SSH+Slaves+plugin

than add the Host & Credentials

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM