Configuring Distributed Builds with Jenkins
- Initial Lab setup
- Jenkins master
- Configuration: 2 VCPUs 4 GB of RAM
- Operating System: ubuntu 20.04
- Softwares: JDK 11, Jenkins LTS, git
- Jenkins node 1:
- Configuration: 2 VCPU 4 GB of RAM
- Operating System: ubuntu 20.04
- Softwares: Jdk 11, maven latest, git
- Jenkins master
- Note: There should be connectivity between master and node
- Lab Setup Overview
- I will be creating both the machine in AWS
- Now lets install jenkins on jenkins master
- Once the jenkins server is up, set the necessary permissions for the jenkins user to perform actions on jenkins master
- Now we have jenkins master setup. Now we need to configure the jenkins node
- The way jenkins master will communicate with Jenkins node if it is linux
- The jenkins master will login into jenkins node using ssh => username & password or username & key
- So on the nodes for this sessions, lets create a user called as
devopson all the nodes. - We would create a user devops and we would be giving them sudo permissions as well
- Now lets create a devops user with some password
- In linux machines (AWS or in other clouds) login with password might be disabled so we need to enable it first => change PasswordAuthentication to yes in /etc/ssh/sshd_config file and restart sshd service
- Create user
- debian =>
sudo adduser devops - redhat =>
sudo adduser devops & sudo passwd devops
- debian =>
- Grant sudo permissions with no password to devops as this will be used by jenkins
- Refer Here to the previous class room notes to install jdk 11 and maven latest
- When we create jenkins job, how can we tell jenkins to run a partiular job on a particular node
- Jenkins node configuration
- Screen Shots
- Once you save the node we can verify if the node is connected or not
- Screen Shots
- Now lets create a jenkins job which will build the spring pet clinic project
- Now let build to verify if the job is getting scheduled on the remote node or not
- Next Steps: Lets try to fix the problem of maven not found (mvn not found)
