Sunday, September 8, 2019

Slave agent on Ubuntu using ssh

Install Jenkins on the Master Node


wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | apt-key add - echo deb http://pkg.jenkins-ci.org/debian binary/ > /etc/apt/sources.list.d/jenkins.list apt-get update apt-get install jenkins


Install Jenkins Agent on the Slave Node

running on master node:

sudo -iu jenkins

ssh root@<slave_ip> mkdir -p .ssh

cat .ssh/id_rsa.pub | ssh root@<slave_ip> 'cat >> .ssh/authorized_keys'

running on slave node:

mkdir ~/bin

cd bin

wget http://<master_ip>:8080/jnlpJars/slave.jar

sudo apt-get install default-jre 

start slave agent: 

ssh root@<slave_ip> java -jar /root/bin/slave.jar 

No comments:

Post a Comment