Still now we have setup the Jenkins and executed some sample now. This helps only building/running job only on master server. If we have parallel build or multiple jobs needs to be perform single server won’t help much, either we may need more hardware or additional server. For that Jenkins is giving master-slave feature, which helps to run then build or jobs on multiple servers.
In this post we should like to demonstrate how to create a master-slave environment in Jenkins. Jenkins makes it possible to configure multiple nodes as slave.
Refer Our Jenkins Articles on Jenkins Page
To achieve this with following easy steps,
- Setup Jenkins Master
- Installing Slave Linux and Windows
- Adding new slave node on Jenkins master
Step1: Setup Jenkins Master
You can install Jenkins on any machine windows/linux. In our case we would like to take CentOS 7, For Ubuntu follow Jenkins Installation
Install Jenkins in Redhat/centos 7
# wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
# rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
Install jenkins
# yum install jenkins
Install java
# yum install java-1.8.0-openjdk
Setup firewall
# firewall-cmd –zone=public –add-port=8080/tcp –permanent
# firewall-cmd –reload
Start Jenkins
# systemctl restart jenkins.service
Step2: Installing Slave Linux and Windows
Install java using following command,
# yum install java -y
Add Jenkins user to authenticate slave server, you can any user name.
# useradd Jenkins
# passwd Jenkins
Step3: Follow this URL for complete URL.